Qualys Knowledge Base data import not working, it only brings 112 records at max.

Nitin15
Tera Contributor

Hi, 

We are trying to fetch knowledge base data from Qualys into third party vulnerabilities table using out of box integration plugin provided by ServiceNow. After proper research and analysis we have come to a conclusion that previous import xmls are not getting deleted from the data source records. Hence the same 112 records keep getting processed again and again. While other attached files on the same data source are completely ignored. 

We have not changed any OOB Script, Configuration or integration mechanisms. Any help around this will be highly appreciated. 

Regards,

Nitin

1 ACCEPTED SOLUTION

Dan Daugherty
ServiceNow Employee
ServiceNow Employee

TinTin, 

Unsure of your version, but I will assume this is pre Kingston as this issue has happened for others pre K but has been fixed for K and beyond.

This issue typically arises when the run as user for the integration has been changed to a user without enough permissions to delete files.

As a first test, you can manually delete all the attachments from the data source in question and rerun the integration. This will allow the integration to pull back the most recent data, attach it and import the current records. If you have changed the run as user or permissions of that user on any other of the integration records for Qualys, you will need to do the same for those as well.

In pre Kingston instances, you will unfortunately need to elevate the permissions of the run as user to allow file deletes. 

Also, regardless of what the root cause is of the multiple attachments, you will need to manually delete the extra attachments manually to get back into a working state.

View solution in original post

4 REPLIES 4

Nitin15
Tera Contributor

An update, every time I execute Qualys Knowledge Base Integration. It gives the following error in the system log:

 

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: }

 

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)) 

 

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(); 

Dan Daugherty
ServiceNow Employee
ServiceNow Employee

TinTin, 

Unsure of your version, but I will assume this is pre Kingston as this issue has happened for others pre K but has been fixed for K and beyond.

This issue typically arises when the run as user for the integration has been changed to a user without enough permissions to delete files.

As a first test, you can manually delete all the attachments from the data source in question and rerun the integration. This will allow the integration to pull back the most recent data, attach it and import the current records. If you have changed the run as user or permissions of that user on any other of the integration records for Qualys, you will need to do the same for those as well.

In pre Kingston instances, you will unfortunately need to elevate the permissions of the run as user to allow file deletes. 

Also, regardless of what the root cause is of the multiple attachments, you will need to manually delete the extra attachments manually to get back into a working state.

What worked for us was changing the Run As field in all the scheduled job related to vulnerability and Qualys integration. We deleted the System Administrator account and this left run as empty. 

Thanks for the feedback. Glad it's working for you now.