[Solved]- SQLServerException: Violation of UNIQUE KEY constraint

This article is intended for Server/DC QTM4J users facing the following error while accessing QTM4J screens.

Symptoms:

  1. Error on the UI: Unexpected error occurred. Please try again later. If problem persist contact QMETRY support team.

  2. Sample errors in Jira logs :

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of UNIQUE KEY constraint 'U_AO_5A68F6_4X_REQ_ISSUE_KEY'. Cannot insert duplicate key in object 'dbo.AO_5A68F6_4X_REQ'. The duplicate key value is (SIMPO-11385).

 

Cause/Reason: The above error occurs when there is a Unique key violation which usually occurs when the users double update any records in the MSSQL server database. Usually, the error is seen after Jira Reindex which causes the server cache and DB to go out of sync causing the duplication of object creation errors.

Solution:

Step 1: Go to Manage Apps > Disable and re-enable the QMetry Test Management for the Jira app.

Step 2: Go to QMetry Menu > Test Management screen.

Step 3: Check if the issue is resolved.

For any further queries, please contact QMetry Support along with the following logs: