Notifications

78 views

Description

Schedule job 'Discovery Error Instance Cleanup', which was introduced in London, does not check to see if Discovery plugin is active. The job runs regardless and throws errors in the system logs.

Steps to Reproduce

  1. Use an out of box instance on London with Discovery not activated.
    2. Run scheduled job 'Discovery Error Instance Cleanup' or wait for the job to kick in (runs daily at 09:00 hours).
    3. Check system logs for errors that match the below:

Error 1:

org.mozilla.javascript.EcmaError: undefined is not a function.
Caused by error in <refname> at line 14

11: var parentTable = (type == discoCleanUpType.STATUS) ? 'discovery_status' : 'discovery_schedule';
12: var key = (type == discoCleanUpType.STATUS) ? 'instance_key' : 'instance_data';
13: 
==> 14: var errorManager = new SNC.DiscoveryErrorManager();
15: var msgInstance = new GlideAggregate('automation_error_instance_msg');
16: msgInstance.groupBy(key);
17: msgInstance.query();

Error 2:

org.mozilla.javascript.EcmaError: undefined is not a function.
Caused by error in <refname> at line 31

28: 
29: function cleanIt() {
30: // delete instances where discovery_status no longer exists
==> 31: cleanInstanceByParent(discoCleanUpType.STATUS);
32: 
33: // delete instances where discovery_schedule no longer exists
34: cleanInstanceByParent(discoCleanUpType.SCHEDULE);

Error 3:

Caused by error in <refname> at line 37

34: cleanInstanceByParent(discoCleanUpType.SCHEDULE);
35: }
36: 
==> 37: cleanIt();
28:
29: function cleanIt() {
30: // delete instances where discovery_status no longer exists
==> 31: cleanInstanceByParent(discoCleanUpType.STATUS);
32:
33: // delete instances where discovery_schedule no longer exists
34: cleanInstanceByParent(discoCleanUpType.SCHEDULE);

 

Workaround

This is fixed in the Madrid release, and upgrading is recommended. Previous versions can use this workaround:

  1. Edit the script of the scheduled job 'Discovery Error Instance Cleanup' from the Scheduled Script table (/sysauto_script_list.do)
  2. Add the following after line 29, under function cleanIt() {

if (!GlidePluginManager.isActive('com.snc.discovery.error')) 
return; 

  1. Save the job

Related Problem: PRB1310553

Seen In

There is no data to report.

Fixed In

Madrid

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2019-06-20 16:10:15
Published:2019-01-24