<-- Back

ERROR - M2EE: An error occurred while initializing the Runtime: Trying to insert key/value pair but value 'uniq_xxx' is already used. while deploying a package in Mendix Cloud

Issue

A deployment in Mendix Cloud fails, and the following error is shown in the application logs:

ERROR - M2EE: An error occurred while initializing the Runtime: Trying to insert key/value pair 'com.mendix.connectionbus.mapping.UniqueConstraintKey@zzz'/'uniq_xxxx', but value 'uniq_xxx' is already used
com.mendix.m2ee.api.AdminException: An error occurred while initializing the Runtime: Trying to insert key/value pair 'com.mendix.connectionbus.mapping.UniqueConstraintKey@zzz'/'uniq_xxx', but value 'uniq_xxx' is already used
at com.mendix.basis.impl.MxRuntimeImplBase.start(MxRuntimeImplBase.java:269)

Caused by: java.lang.IllegalArgumentException: Trying to insert key/value pair 'com.mendix.connectionbus.mapping.UniqueConstraintKey@zzz'/'uniq_xxx', but value 'uniq_xxx' is already used

Environment

Applications hosted in Mendix Cloud 

Cause

After deploying a package, the deployment process fails during runtime initialization because an attempt is made to insert a record that already exists in the database. This conflict prevents the deployment from completing successfully and results in the error described above.

Solution / Workaround

To solve the error, follow these steps:

  1. Verify whether any attributes or entities within the domain model were renamed with unique constraints on them. 
  2. Change or remove the record by restoring a backup locally. 
  3. After performing any changes locally to the database, upload it back to the environment by restoring a  backup 

Internal information related

  • 258146, 252666, 234141

Additional information

Mendix documentation:

 

Have more questions? Submit a request

0 Comments

Article is closed for comments.

To provide feedback, please open a ticket here. Don't forget to include the article's URL along with the feedback you would like to provide.