Question
Cognizant Technology
US
Last activity: 19 Apr 2024 11:56 EDT
SqlIntegrityConstraintViolationException During deployments
Hello all,
We are getting below error message when ever we deploy code into Production. We use Dynatrace to track/report any issues found. The below error is happening for all production deployments. Anybody have any insight please give some direction to troubleshoot. Thank you.
ERROR DETAILS BELOW:
SqlIntegrityConstraintViolationException
Root causes for requests to Insert into pegarules.pr_assembledclasses that failed with SqlIntegrityConstraintViolationException
100 % (+100 %) were caused by com.ibm.db2.jcc.am.SqlIntegrityConstraintViolationException
Exception messages of com.ibm.db2.jcc.am.SqlIntegrityConstraintViolationException
One or more values in the INSERT statement, UPDATE statement, or foreign key update caused by a DELETE statement are not valid because the primary key, unique constraint or unique index identified by "*****" constrains table "PEGARULES.PR_ASSEMBLEDCLASSE
@SharathM17068267
My hunch is that the product you're deploying has data table instances present in it. The primary key of one of those instances is already present in production, which is causing this issue. I'd recommend to deploy only rule instances, then the deployment should be successful. Then update the instances table by table and see in which table it is failing.