GMU migrateIn issue with JDBC Constraint Violation
search cancel

GMU migrateIn issue with JDBC Constraint Violation

book

Article ID: 105630

calendar_today

Updated On:

Products

STARTER PACK-7 CA Rapid App Security CA API Gateway

Issue/Introduction

The GMU migrateIn execution is failing with conflicts. The result.xml file is showing the below error: 

"Constraint Violation: Could not execute JDBC batch update" 

Environment

SSG 9.x, 10.x
Component: GMU

Cause

It looks like some of the data that are migrating into the target environment already exists. The conflict errors are due to unique key constraint violations. Below is one example of the error message: 

-------------------------------------  
<l7:Mapping action="NewOrExisting" errorType="UniqueKeyConflict" srcId="ae2ccb59122b8e575db3bb56adf2afc9" srcUri="https://localhost.ca.com:8443/restman/1.0/encapsulatedAssertions/ae2ccb59122b8e575db3bb56adf2afc9" type="ENCAPSULATED_ASSERTION"> 
<l7:Properties> 
<l7:Property key="ErrorMessage"> 
<l7:StringValue>(name) must be unique</l7:StringValue> 
</l7:Property> 
</l7:Properties> 
</l7:Mapping> 
-------------------------------------

Or below error could be see in the log

 <l7:Mapping action="NewOrExisting" errorType="InvalidResource" srcId="2aedcac8b1973f382f8cdb3aca99b91f" srcUri="https://sj1010010108194.xxxx.com:8443/restman/1.0/policies/2aedcac8b1973f382f8cdb3aca99b91f" type="POLICY">
  <l7:Property key="ErrorMessage">
  <l7:StringValue>Error attempting to save or update the Policy with id = '2aedcac8b1973f382f8cdb3aca99b91f'.  Constraint Violation: Could not execute JDBC batch update    </l7:StringValue>

Resolution

Check destination database to see if the key data already exists and associated with different row.  Need to remove any conflict data and then re-import the migrated data again.