Replication Job fails with Violation of PRIMARY KEY constraint 'PK_ReplicationJobOperation'. Cannot insert duplicate key in object 'dbo.ReplicationOperation'. Cannot restart.
search cancel

Replication Job fails with Violation of PRIMARY KEY constraint 'PK_ReplicationJobOperation'. Cannot insert duplicate key in object 'dbo.ReplicationOperation'. Cannot restart.

book

Article ID: 158335

calendar_today

Updated On:

Products

IT Management Suite

Issue/Introduction

 

On one of the customer's servers, replication gets interrupted occasionally. If the replication has already written the job details to the ReplicationOperation table, when the job restarts it finds the replication job id already in the ReplicationOperation table and rather than proceding or updating the entry, it throws an error and fails. This is repeated until you manually remove the entry from ReplicationOperation at which point the job proceeds to completion the next time it restarts.

 

The job fails, in this case with a "System.InvalidOperationException: This SqlTransaction has completed; it is no longer usable." exception.

Whenever it attempts to restart it fails because it can't insert into ReplicationOperation because the jobid already exists.

Severity: 2
Critical: True
Date: 7/2/2013 10:44:33 PM
Tick Count: -695410851
Process: AeXSvc (1248)
Thread: 6046
Module: AeXSVC.exe
Source: ReplicationJobThread
Description: A non-fatal exception occured during replication. The replication job will be restarted from the last check point. (JobID: {63092a6b-befc-4d80- 9760-08f7b5bd0efe}, Exception: System.InvalidOperationException: This SqlTransaction has completed; it is no longer usable.
at System.Data.SqlClient.SqlTransaction.ZombieCheck() at System.Data.SqlClient.SqlTransaction.Rollback(String transactionName) at Altiris.NS.Replication.ReplicationJobHelper.UpdateJobDataSet(DataSet dataSet) at Altiris.NS.Replication.DestinationReplicationJobWorker.CreateManifest (ReplicationJob jobItem, String jobId) at Altiris.NS.Replication.DestinationReplicationJobWorker.ProcessJob (ReplicationJob jobItem) at Altiris.NS.Replication.ReplicationJobThread.ProcessJob())


Severity: 2
Critical: False
Date: 7/2/2013 10:46:29 PM
Tick Count: -695295613
Process: AeXSvc (1248)
Thread: 2277
Module: AeXSVC.exe
Source: ReplicationJobThread
Description: A non-fatal exception occured during replication. The replication job will be restarted from the last check point. (JobID: {63092a6b-befc-4d80- 9760-08f7b5bd0efe}, Exception: System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint 'PK_ReplicationJobOperation'. Cannot insert duplicate key in object 'dbo.ReplicationOperation'. The duplicate key value is ({63092a6b- befc-4d80-9760-08f7b5bd0efe}, Privilege, Import, ). The statement has been terminated.

at System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors (RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount) at System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount) at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping) at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping) at System.Data.Common.DbDataAdapter.Update(DataTable dataTable) at Altiris.NS.Replication.ReplicationJobHelper.UpdateJobDataSet(DataSet dataSet) at Altiris.NS.Replication.DestinationReplicationJobWorker.CreateManifest (ReplicationJob jobItem, String jobId) at Altiris.NS.Replication.DestinationReplicationJobWorker.ProcessJob (ReplicationJob jobItem) at Altiris.NS.Replication.ReplicationJobThread.ProcessJob())

Resolution

This issue has been reported to the Symantec Development team.

1. This is very rare
2. This gets cleaned up automatically with the 2 day time-out, and the data will be included in the next differential schedule automatically as well.
 

As a workaround, you can do the following statement which will remove the job from the ReplicationOperation table and allow the job to continue on the next pass:

delete ReplicationOperation
where JobID = '{<JobIDFromLogs>}';


Applies To

ITMS 7.1 SP2 MP1