CMDB Health Duplicate Check Fails with NullPointerException Due to Invalid sys_class_name Values<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } .kb-wrapper, .kb-wrapper * { font-family: 'Lato', sans-serif; } .kb-wrapper { max-width: 100%; line-height: 1.7; color: #000000; } .kb-wrapper h2 { font-size: 14pt; font-weight: 900; color: #032D42; border-bottom: 2px solid #e8fce4; padding-bottom: 6px; margin-top: 22px; margin-bottom: 12px; } .kb-wrapper p, .kb-wrapper li, .kb-wrapper ul, .kb-wrapper ol { font-size: 12pt; color: #000000; } .kb-wrapper ol.kb-steps { list-style: none; counter-reset: kb-step; padding-left: 0; } .kb-wrapper ol.kb-steps > li { counter-increment: kb-step; position: relative; padding-left: 44px; margin-bottom: 14px; } .kb-wrapper ol.kb-steps > li::before { content: counter(kb-step); position: absolute; left: 0; top: 2px; width: 28px; height: 28px; background-color: #032D42; color: #63DF4E; border-radius: 50%; font-weight: 900; font-size: 12pt; display: flex; align-items: center; justify-content: center; } .kb-wrapper .kb-callout { border-left: 4px solid #52B8FF; background-color: #e6f4ff; padding: 12px 16px; margin: 14px 0; } .kb-wrapper .kb-callout p { margin: 0; } .kb-wrapper .kb-warning { border-left: 4px solid #e6a817; background-color: #fff4e0; padding: 12px 16px; margin: 14px 0; } .kb-wrapper .kb-warning p { margin: 0; } .kb-wrapper code, .kb-wrapper .kb-inline-code { background-color: #e6f0f5; color: #032D42; border: 1px solid #b8cfd8; padding: 1px 6px; border-radius: 3px; font-family: 'Lato', monospace; font-size: 11pt; } .kb-wrapper pre.kb-code { background-color: #e6f0f5; color: #032D42; border: 1px solid #b8cfd8; border-radius: 4px; padding: 12px 14px; font-family: 'Lato', monospace; font-size: 11pt; line-height: 1.5; white-space: pre-wrap; overflow-x: auto; margin: 12px 0; } .kb-wrapper .kb-related-links { list-style: disc; padding-left: 22px; } .kb-wrapper .kb-related-links li { margin-bottom: 8px; } .kb-wrapper .kb-link-disclaimer { font-size: 10pt; font-style: italic; color: #555; margin-top: 2px; margin-bottom: 0; } .kb-wrapper a { color: #00718F; text-decoration: underline; } .kb-wrapper a:hover { color: #024F69; } Issue The CMDB Health Dashboard Correctness → Duplicate widget displays no results, and the cmdb_health_duplicate scheduled job terminates unexpectedly while processing a CI class. The following error is recorded in the system logs: SEVERE *** ERROR *** CMDBHealth : DUPLICATE error : java.lang.NullPointerException SEVERE *** ERROR *** CMDBHealth : DUPLICATE Error while processing batch : <cmdb_class_name> Last processed id : <sys_id>. Marking as incomplete and exiting. Symptoms The Correctness → Duplicate widget on the CMDB Health Dashboard is blank or shows no data.The cmdb_health_duplicate scheduled job ends prematurely without completing its run.System logs show a NullPointerException from CMDBHealth : DUPLICATE while processing a specific CMDB class.The log entry Marking as incomplete and exiting appears immediately after the exception, identifying the last processed sys_id.Related warnings may appear in the same log window, including: WARNING *** QueryEventLogger: Invalid query detected, please check logs for details [Unknown field sys_class_name in table <class_label>] Other Correctness widgets (Completeness, Compliance) may continue to populate normally, indicating the failure is scoped to the Duplicate check. Facts The CMDB Health Duplicate check is executed by the cmdb_health_duplicate scheduled job and reads from the cmdb_health_processor_status table to manage batch progression across CI classes.During processing, each CI record's sys_class_name value is used to evaluate relationships and duplicates within its assigned class.If a record carries a sys_class_name value that does not exist in the active CMDB class hierarchy (for example, due to a legacy class, an uninstalled plugin, or manual data manipulation), the class metadata lookup returns null, causing the batch to throw a NullPointerException.When the batch exits, the widget has no completed data set to render and displays empty.Related platform behavior is tracked under PRB1629419, which addresses validation of sys_class_name values against the cmdb_ci hierarchy before they are inserted into the health processor queue. Release All currently supported releases. Cause One or more CI records in the affected class have a sys_class_name value that is invalid or no longer aligned with the CMDB class hierarchy. Common origins include: A CI was migrated or reclassified, but the sys_class_name field was left referencing the prior class.A plugin that previously provided the referenced class is no longer installed, leaving orphaned records.A direct data update (for example, via background script or import) set sys_class_name to a value not present in the active CMDB class hierarchy. During the Duplicate check, the processor attempts to resolve the class metadata for each record. The invalid value returns null, the subsequent dereference throws NullPointerException, and the entire batch for that class is marked incomplete — preventing the widget from rendering any data. Resolution The Duplicate check resumes once each CI record with an invalid sys_class_name value is identified and reclassified to a valid class using supported CMDB tooling. The steps below outline a diagnostic-first approach: identify the affected record, scope the impact, then apply a supported correction. Important: The sys_class_name field controls which CMDB class a CI belongs to, and changes to it affect record visibility, IRE behavior, relationships, and downstream integrations such as Discovery and Service Mapping. Do not modify sys_class_name directly with a script in production. Use the supported reclassification mechanisms described below, and validate the outcome in a sub-production environment first. Identify the affected record. From the error log, capture the sys_id reported on the Last processed id line and the CI class name reported on the Error while processing batch line. Confirm the current sys_class_name value (read-only). Run the following diagnostic in a Background Script (System Definition > Scripts - Background). This script reads the record and logs its values — it does not modify any data. var gr = new GlideRecord('<cmdb_class_table>'); gr.addQuery('sys_id', '<affected_sys_id>'); gr.query(); if (gr.next()) { gs.info('Record name: ' + gr.getValue('name')); gs.info('Current sys_class_name: ' + gr.getValue('sys_class_name')); gs.info('Physical table: ' + gr.getTableName()); } If the Current sys_class_name value does not correspond to an existing CMDB class, or does not match the table the record physically resides in, the record is the source of the failure. Scope the impact (read-only). If the same invalid value is suspected on additional records, use the following read-only query to list candidates. This script also does not modify data — it only logs the matching records for review. var gr = new GlideRecord('cmdb_ci'); gr.addQuery('sys_class_name', '<invalid_class_name>'); gr.query(); while (gr.next()) { gs.info(gr.getValue('sys_id') + ' | ' + gr.getValue('name') + ' | ' + gr.getTableName()); } If a large number of records is returned, treat this as a data-cleanup activity rather than a single-record fix and engage ServiceNow Support or a qualified partner before proceeding. Reclassify the record using supported tooling. Use one of the following supported paths to correct the class assignment: Reclassify from the CI form. Open the affected CI record and use the Reclassify CI action available from the form context menu. This routes the change through the platform's reclassification logic and respects IRE rules.CMDB Class Manager. Navigate to Configuration > CI Class Manager to review the class hierarchy, confirm the intended target class exists, and apply bulk reclassification where supported.Identification and Reconciliation Engine (IRE). For records ingested by Discovery, Service Mapping, or external integrations, ensure the source payload supplies the correct class so that subsequent updates reclassify the CI through the supported reconciliation path. Avoid direct sys_class_name updates via background script in production. These bypass business rules, audit triggers, and reconciliation logic, and can leave records in a state where the physical table and class assignment are inconsistent. Rerun the Duplicate check. Once the records are reclassified: Navigate to Configuration > CMDB Health Dashboard > Correctness.Trigger the Duplicate job from the dashboard, or execute the cmdb_health_duplicate scheduled job from System Definition > Scheduled Jobs. Verify. Confirm that the Duplicate widget now populates and that no further NullPointerException entries appear in the system log for CMDBHealth : DUPLICATE. Note: If the Duplicate job continues to fail after the first record is corrected, review the next batch's log entry. Multiple records across different CI classes can carry invalid sys_class_name values, and each surfaces only after the prior one is resolved. If invalid values are widespread or trace back to a previously installed plugin, open a case with ServiceNow Support for guided remediation. Related Links CMDB Health Dashboard overviewCMDB Correctness KPIs and metricsReclassify a configuration itemCI Class Manager