Scheduled job Clean Temp Files

alexanderl_vend
Kilo Explorer

Hi,

Was wondering if anyone can tell what the Scheduled job: Clean Temp Files really do, have not been able to find anything on the ServiceNow wiki.

But we do see get alot of warning messages in the Log table.

We keep getting these three warnings in our log:

1:

java.lang.SecurityException: Illegal access to method deleteFile(com.glide.script.proxy.File) in class com.glide.util.FileUtil

Caused by error in Schedule Item: 'Clean Temp Files' at line 1

==> 1: cleanTempDir(3600 * 1000 * 24, ["rb_", "sw_", "gw_", "att", "ids", "gurl"]);

2:

3: function cleanTempDir(age, tempFilePrefixes) {

4: var s = GlideSysFileUtil.getTempDir().getAbsolutePath();

2:

java.lang.SecurityException: Illegal access to method deleteFile(com.glide.script.proxy.File) in class com.glide.util.FileUtil

Caused by error in Schedule Item: 'Clean Temp Files' at line 6

3: function cleanTempDir(age, tempFilePrefixes) {

4: var s = GlideSysFileUtil.getTempDir().getAbsolutePath();

5: var dir = new Packages.java.io.File(s);

==> 6: var currentStamp = getCurrentStamp(dir);

7: var kids = dir.list();

8: for (var i =0; i < kids.length; i++) {

9: if (!prefixMatches(kids[i], tempFilePrefixes))

3:

java.lang.SecurityException: Illegal access to method deleteFile(com.glide.script.proxy.File) in class com.glide.util.FileUtil

Caused by error in Schedule Item: 'Clean Temp Files' at line 34

31: var f = new Packages.java.io.File(dir, n);

32: f.createNewFile();

33: var stamp = f.lastModified();

==> 34: GlideFileUtil.deleteFile(f);

35: return stamp;

36: }

Anyone have any ideas?

8 REPLIES 8

Emerce2000
Kilo Expert

We are getting the same errors in our logs, we are on Helsinki, but recently upgraded from Eureka. Would love to clean this up.


Community Alums
Not applicable

Colleagues, solution from HI (PRB683489😞



  1. Backup (Export XML) the existing sys_trigger rows: Schedule - All>Name = Clean Temp Files https://___INSTANCE_NAME___.service-now.com/sys_trigger_list.do?sysparm_query=name%3DClean%20Temp%20...
  2. Check the above link again and delete the rows.
  3. Download the file attached to this incident: sys_trigger_c10d485e0a0a0b170060611b99ccd00c.xml This is the OOB row from demonightlyhelsinki (where system_id = "All Nodes").
  4. Import the above XML file to the instance.
  5. Navigate to the above link again and there should be one row.
  6. Click on the row and then click on the "Execute Now" UI action.
  7. When the list renders again, you should see the appropriate rows for child nodes.
  8. Optionally, tail the application server localhost_log*.txt files and click on each row for each child node and click on "Execute Now", and verify that the scheduled job executes without error.

I was going to test this out on our instance, but cannot access the PRB# and the XML file related to this.   It is confirmed to be in the security and notable fixes for Istanbul under "Platform Miscellaneous".   If anyone plans on cleaning this up before this, i'd open a HI ticket and reference the PRB# in order to get the file.


In case you need the file, I got this from my Istanbul developer instance.



Also note this appears to be listed in Istanbul security and notable fixes under Platform Misc - PRB683489