I see that the Download Replication Job ends with status WARNING due to a database constraint violation error in table ca_query_version.

Document ID : KB000008520
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

I see that the Download Replication Job ends with status warning due to a database constraint violation error in table ca_query_version.

Download - Replication Job Done. Warning: though the job was completed, an error occurred: A database constraint violation error occurred for table: ca_query_version. Please examine the log file for more details.

Concretely, the message and the warning condition can be seen in the engine activity log pane within DSM Explorer:

 

ConstraintError.jpg

Environment:
Client Automation 12.5 and above.
Cause:

The ca_query_version table is populated when we save the static information of a query. This gets populated once to domain Domain Manager. As the data is static and not calculated dynamically the data will never change. So, the replication always runs into warning state as the data is always the same in the Domain Manager and the Enterprise Server. 

Resolution:

As the result of the execution of a query contains static data which is not updated anymore, it becomes obsolete and normally can be deleted after using it.

To delete it, go to the DSM Explorer, locate the query and under it the saved static results can be found. Right click on them to delete them as shown in the image:

 

DeletingSavedStaticQueryResult.jpg

 

After deleting the unwanted data from the GUI, the warning condition in the replication job did not occur anymore.