*Purpose
This page will help you to troubleshoot the Fatal Error message "ERROR: duplicate key value violates unique constraint "<INDEX NAME>" which you may face while running the Snapshot.
*Observed in CAST AIP
Release | Yes/No |
---|---|
8.3.x | |
8.2.x | |
8.1.x | |
8.0.x | |
7.3.x |
*Observed on RDBMS
RDBMS | Yes/No |
---|---|
Oracle Server | |
Microsoft SQL Server | |
CSS3 | |
CSS2 |
Action Plan
- In the CAST-MS log file, identify the table or the view that is involved in the error message.
The Index name follows the error : "ERROR: duplicate key value violates unique constraint "<INDEX NAME>" ".
The Table name is in the UPDATE or INSERT STATEMENT
In the above example the table name is: DS_KeysExtra. - Check if there are indexes that have been dropped in the local and central. To do so compare the count of indexes between the used local and central schema with a fresh local and central schema, for more information refer to SQL Queries - Common SQL Queries - How to retrieve the count of indexes used for a schema In the above example the Unique index "idx_dss_keysextra" was dropped from the table "dss_keysextra", which led to the insertion of duplicated values hence the execution failed.
- If there are indexes that have been dropped:
Delete Duplicated values from the table mentioned in the error message
DELETE FROM dss_keysExtra WHERE ctid NOT IN ( SELECT min(ctid) FROM <TABLE> GROUP BY object_id);
Replace <TABLE> by the name of the table mentioned in the error message
In our example the query is the following:
DELETE FROM dss_keysExtra WHERE ctid NOT IN ( SELECT min(ctid) FROM dss_keysextra GROUP BY object_id);
- Run a component reinstall using the Server Manager Tool.
- Compute snapshot by skipping analysis.
- If the component reinstall does not solve the issue, navingate to the below pages:
- CMS Snapshot Analysis - Compute Snapshot - Fatal Error - Error while executing procedure - duplicate key value violates unique constraint dss metr typ pk
- CMS Snapshot Analysis - Compute Snapshot - Fatal Error - Error while executing procedure - duplicate key value violates unique constraint uidx_efp_objects_statuses - duplicated datafunctions
- CMS Snapshot Analysis - Compute Snapshot - Fatal Error - Error while executing procedure - duplicate key value violates unique constraint uidx - efp - objects -statuses - duplicated objects
- If the above points do not help you, contact Cast Technical Support and provide the Relevant Input in order to reproduce the issue.
Notes/Comments
Related Pages