CMDBHealth : DUPLICATE error : java.util.NoSuchElementException


Description

When running CMDB Health Dashboard - Correctness Score Calculation, the job fails - from cmdb_health_metric_status we can see the duplicate metric fails with incomplete score error.

From instance error log, we can see below error:

CMDBHealth : DUPLICATE Error while processing batch : cmdb_ci_ip_switch Last processed id : 67bf44931b1360901111a8292a4bcbf0. Marking as incomplete and exiting.
CMDBHealth : DUPLICATE error : java.util.NoSuchElementException
at java.util.AbstractList$Itr.next(AbstractList.java:364)
at com.snc.cmdb.identify_reconcile.FollowOnTaskUtil.createIndependentCITask(FollowOnTaskUtil.java:218)
at com.snc.cmdb.identify_reconcile.FollowOnTaskUtil.createIndependentCITask(FollowOnTaskUtil.java:195)
at com.snc.cmdb.identify_reconcile.IndependentCIProcessor.getMatchingIndependentCI(IndependentCIProcessor.java:227)
at com.snc.cmdb.identify_reconcile.IdentificationEngine.runAudit(IdentificationEngine.java:1856)
at com.snc.cmdb.identify_reconcile.IdentificationEngine.runIdentificationAudit(IdentificationEngine.java:1824)
at com.snc.cmdb.health.DuplicateProcessor.processRecords(DuplicateProcessor.java:95)
at com.snc.cmdb.health.MetricProcessor.process(MetricProcessor.java:116)
at com.snc.cmdb.health.MetricProcessorScript.execute(MetricProcessorScript.java:35)
at com.snc.cmdb.health.MetricProcessorScript.jsStaticFunction_duplicateProcessor(MetricProcessorScript.java:59)
at sun.reflect.GeneratedMethodAccessor7827.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138)
...

Steps to Reproduce

1. Create a reconcile_duplicate_task with a large number of duplicate_audit_result

2. Run CMDB Health Dashboard - Correctness Score Calculation

3. Check cmdb_health_metric_status - duplicate metric fails with incomplete score

4. Check error log with source CMDBHealth, there are errors below:

CMDBHealth : DUPLICATE Error while processing batch : cmdb_ci_ip_switch Last processed id : 67bf44931b1360901111a8292a4bcbf0. Marking as incomplete and exiting.
CMDBHealth : DUPLICATE error : java.util.NoSuchElementException

Workaround

Review de-duplicate task, close the one with large number of duplicate_audit_result (e.g. 160 duplicate_audit_result with one task)

(Try to sort the de-dup tasks by updated date and the first one is likely the one)

 

 


Related Problem: PRB1546237