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:
- Verify whether any attributes or entities within the domain model were renamed with unique constraints on them.
- Change or remove the record by restoring a backup locally.
- 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:
- Deploying an App to Mendix Cloud
- Configuring a Domain Model
- Restoring a Backup
- Restoring a Backup Locally
0 Comments