Upload replication failed on domain manager and engine log shows below error. The INSERT statement conflicted with the FOREIGN KEY constraint "$ca_di_r000002c700000000". The conflict occurred in database "mdb", table "dbo.ca_asset_source", column 'asset

book

Article ID: 5964

calendar_today

Updated On:

Products

CA Automation Suite for Data Centers - Configuration Automation CA Client Automation - Asset Management CA Client Automation - IT Client Manager CA Client Automation CA Client Automation - Remote Control CA Client Automation - Asset Intelligence CA Client Automation - Desktop Migration Manager CA Client Automation - Patch Manager

Issue/Introduction

Upload replication failed on domain manager and engine log shows  error with ca_asset_source.

Cause

Error in the log shows that hardware/agent record was replicated to the EM, it never got registered to CORA, so there is no ca_asset_source record at the EM, so when we try to replicate the ca_discovered_software it failed.

Engine log

========

181116-12:42:18.7586278L|006716|000021d8|Domain_tas|DbImplAdo |DbImpl_Ado.cpp |002345|NOTIFY | evalSQLInfo description: The INSERT statement conflicted with the FOREIGN KEY constraint "$ca_di_r000002c700000000". The conflict occurred in database "mdb", table "dbo.ca_asset_source", column 'asset_source_uuid'. source: Microsoft SQL Native Client

181116-12:42:18.7586821L|006716|000021d8|Domain_tas|DbImplAdo |DbImpl_Ado.cpp |002358|NOTIFY | evalSQLInfo class: 16 state: 1 server: CM-DCSVR1

181116-12:42:18.7588121L|006716|000021d8|Domain_tas|CDb |DbImpl_Ado.cpp |002584|NOTIFY | Error Message: ADO Version 6.0 - ExecuteCommandPointer -COM Error: ErrorCode:-2147217873,WordErrorCode:3119, IDispatch error #3119, The INSERT statement conflicted with the FOREIGN KEY constraint "$ca_di_r000002c700000000". The conflict occurred in database "mdb", table "dbo.ca_asset_source", column 'asset_source_uuid'., Microsoft SQL Native Client, (null)

181116-12:42:18.7588867L|006716|000021d8|Domain_tas|amLog | |000000|ERROR | cReplicationJob::DoTableUpdateInsertRow failed to execture db command pointer

181116-12:42:18.7589546L|006716|000021d8|Domain_tas|amLog | |000000|ERROR | GetActionOnError: MS SQL dbErrCat=-3, dbDetailedError=-6, errorInfo=ADO Version 6.0 - ExecuteCommandPointer -COM Error: ErrorCode:-2147217873,WordErrorCode:3119, IDispatch error #3119, The INSERT statement conflicted with the FOREIGN KEY constraint "$ca_di_r000002c700000000". The conflict occurred in database "mdb", table "dbo.ca_asset_source", column 'asset_source_uuid'., Microsoft SQL Native Client, (null)

181116-12:42:18.7591049L|006716|000021d8|Domain_tas|amLog | |000000|ERROR | SetIntermediateStatus2: Upload: A database constraint violation error occurred for table: ca_discovered_software

Environment

ITCM 12.9 Domain Manager/Enterprise Manager Upload Replication.

Resolution

1. Take the Backup of Enterprise Manager MDB.

2. Stop the Replication on Domain Manager and Run the below query on Enterprise Manager SQL Query Analyzer

use mdb

insert into ca_asset_source(asset_source_uuid,subschema_id)

select dis_hw_uuid,'3' from ca_discovered_hardware

where dis_hw_uuid not in(select asset_source_uuid from ca_asset_source)

 

3. Now start the replication again on DM

Open a issue with CA if Upload Replication is still failed .