Discovery: Cloud Discovery fails post-clone with "resolveCredentialForAccount(): Inconsistent state" MID Server errorIssue <!-- /*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 { font-family: 'Lato', sans-serif; font-size: 12pt; line-height: 1.7; max-width: 100%; color: #000; } .kb-wrapper p { margin: 0 0 0.75em 0; } .kb-wrapper code { background: #e6f0f5; color: #032D42; border: 1px solid #b8cfd8; padding: 1px 5px; border-radius: 3px; font-size: 11pt; } Cloud Discovery fails after a clone-over to a sub-production instance. The MID Server logs contain the error resolveCredentialForAccount(): Inconsistent state: could not locate credential for service account with id '<account_id>' even though credential sys_id of 'null' was found. The discovery_credentials field on the affected Cloud Service Account (cmdb_ci_cloud_service_account) record appears empty in the UI but contains the literal string null in the underlying XML. Symptoms<!-- /*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 { font-family: 'Lato', sans-serif; font-size: 12pt; line-height: 1.7; max-width: 100%; color: #000; } .kb-wrapper ul { margin: 0 0 0.75em 1.25em; padding: 0; } .kb-wrapper li { margin-bottom: 0.4em; } .kb-wrapper code { background: #e6f0f5; color: #032D42; border: 1px solid #b8cfd8; padding: 1px 5px; border-radius: 3px; font-size: 11pt; } .kb-wrapper table { border-collapse: collapse; width: 100%; margin: 0.75em 0; } .kb-wrapper th { background: #032D42; color: #fff; padding: 7px 10px; text-align: left; font-size: 12pt; } .kb-wrapper td { padding: 7px 10px; border: 1px solid #b8cfd8; vertical-align: top; } .kb-wrapper tr:nth-child(even) td { background: #e8fce4; } Cloud Discovery schedules fail to execute after a clone-over to a sub-production instance.MID Server logs contain the error: resolveCredentialForAccount(): Inconsistent state: could not locate credential for service account with id '<account_id>' even though credential sys_id of 'null' was foundThe discovery_credentials field on the Cloud Service Account record (cmdb_ci_cloud_service_account) appears empty in the UI form.Inspecting the Cloud Service Account record XML reveals the discovery_credentials field contains the literal string null rather than being truly empty.Account validation fails in the Cloud Discovery Workspace. The following table shows the expected versus actual XML field values: StateXML ValueExpected — truly empty<discovery_credential/>Expected — valid credential<discovery_credential display_value="AWS Creds">a48b2ce2dbc584503bf6a851ca961980</discovery_credential>Actual — post-clone artifact<discovery_credential display_value= >null</discovery_credential> Facts<!-- /*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 { font-family: 'Lato', sans-serif; font-size: 12pt; line-height: 1.7; max-width: 100%; color: #000; } .kb-wrapper ul { margin: 0 0 0.75em 1.25em; padding: 0; } .kb-wrapper li { margin-bottom: 0.4em; } .kb-wrapper code { background: #e6f0f5; color: #032D42; border: 1px solid #b8cfd8; padding: 1px 5px; border-radius: 3px; font-size: 11pt; } Can affect any cloud provider's Cloud Service Account records following a clone. Observed with AWS Cloud Discovery configurations, including both IAM instance profile (mid.aws.instance_profile_name) and standard credential-based setups.Occurs when the cmdb_ci_cloud_service_account table is not included in the clone profile Preserve list, causing credential reference fields to carry over from the source instance in a corrupt state.The MID Server treats the literal string null as a sys_id and attempts to resolve a credential record with sys_id = 'null', which does not exist.The discovery_credentials field appears empty in the UI because the display_value attribute is blank, masking the underlying null value from casual inspection.Multiple Cloud Service Account records may be affected simultaneously following a clone; each record must be inspected individually.The following related tables should also be included in the clone profile Preserve list to prevent this and related Cloud Discovery failures: cmp_discovery_ldc_configdiscovery_cloud_results Release<!-- /*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: ; } } All Releases Cause<!-- /*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 { font-family: 'Lato', sans-serif; font-size: 12pt; line-height: 1.7; max-width: 100%; color: #000; } .kb-wrapper p { margin: 0 0 0.75em 0; } .kb-wrapper code { background: #e6f0f5; color: #032D42; border: 1px solid #b8cfd8; padding: 1px 5px; border-radius: 3px; font-size: 11pt; } During a clone-over, if cmdb_ci_cloud_service_account records are carried over from the source instance without proper credential re-association, the discovery_credentials reference field is populated with the literal string null rather than a valid sys_id or a truly empty value. This occurs when the credential record referenced on the source instance does not exist on the target instance and the clone process writes the string null into the XML instead of leaving the field empty. The MID Server's CloudServiceAccountCredentialUtil class reads this value literally and enters an inconsistent state when it cannot resolve a credential record matching sys_id = 'null'. Resolution<!-- /*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 { font-family: 'Lato', sans-serif; font-size: 12pt; line-height: 1.7; max-width: 100%; color: #000; } .kb-wrapper p { margin: 0 0 0.75em 0; } .kb-wrapper code { background: #e6f0f5; color: #032D42; border: 1px solid #b8cfd8; padding: 1px 5px; border-radius: 3px; font-size: 11pt; } .kb-wrapper .steps { list-style: none; margin: 0 0 1em 0; padding: 0; counter-reset: step-counter; } .kb-wrapper .steps > li { counter-increment: step-counter; display: flex; align-items: flex-start; gap: 12px; margin-bottom: 0.75em; } .kb-wrapper .steps > li::before { content: counter(step-counter); background: #032D42; color: #63DF4E; font-weight: 700; font-size: 11pt; border-radius: 50%; min-width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; } .kb-wrapper .step-content { flex: 1; } .kb-wrapper .step-content ul { margin: 0.3em 0 0 1.25em; padding: 0; } .kb-wrapper .step-content li { margin-bottom: 0.3em; list-style: disc; } .kb-wrapper h3 { font-size: 12pt; font-weight: 700; color: #032D42; margin: 1.25em 0 0.5em 0; border-bottom: 2px solid #63DF4E; padding-bottom: 3px; } .kb-wrapper .callout-info { background: #e6f4ff; border-left: 4px solid #52B8FF; padding: 10px 14px; margin: 0.75em 0; border-radius: 0 4px 4px 0; } Immediate fix Navigate to the affected Cloud Service Account record: cmdb_ci_cloud_service_account.do?sys_id=<sys_id>Confirm the issue by appending .XML to the record URL and inspecting the discovery_credentials field for the literal value null.Open the record in the form view, clear the discovery_credentials field so it is truly empty, then save the record.Verify the fix by re-inspecting the record XML — the field should now render as <discovery_credential/>.Re-run the Cloud Discovery schedule and confirm Account Validation succeeds in the Cloud Discovery Workspace.Repeat for all affected Cloud Service Accounts on the instance — check all cmdb_ci_cloud_service_account records where discovery_credentials is not empty but Discovery is failing. Prevent recurrence on future clones Add the following tables to the Preserve list of the clone profile: cmp_discovery_ldc_configdiscovery_cloud_results Per the post-clone Cloud Discovery configuration documentation, after any clone the cmdb_ci_cloud_service_account records must be reviewed and updated with the correct credential references for the target instance environment. Related Links<!-- /*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 { font-family: 'Lato', sans-serif; font-size: 12pt; line-height: 1.7; max-width: 100%; color: #000; } .kb-wrapper ul { margin: 0 0 0.75em 1.25em; padding: 0; } .kb-wrapper li { margin-bottom: 0.5em; } .kb-wrapper .disclaimer { font-style: italic; font-size: 10pt; color: #444; display: block; margin-top: 2px; } Post-clone target configuration for Cloud Discovery schedules