Duplicate key exception (1658154335099-2)
Recently, we have tried to perform a new installation with our more recent database
In the installation process we have been having the following exception:
Invocation of init method failed; nested exception is liquibase.exception.LiquibaseException: liquibase.exception.MigrationFailedException: Migration failed for changeset classpath:liquibase/liquibase-changeLog.yml::1658154335099-2::ahrybeniuk:
Reason: liquibase.exception.DatabaseException: The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.accession' and the index name 'ndx_uniq_accessionNumber'. The duplicate key value is (<NULL>). [Failed SQL: (1505) CREATE UNIQUE NONCLUSTERED INDEX ndx_uniq_accessionNumber ON accession(accession_number)]
15:59:05,197 main ERROR ContextLoader:313 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'databaseMigration' defined in org.gringlobal.application.config.DatabaseConfig: Invocation of init method failed; nested exception is liquibase.exception.LiquibaseException: liquibase.exception.MigrationFailedException: Migration failed for changeset classpath:liquibase/liquibase-changeLog.yml::1658154335099-2::ahrybeniuk:
Reason: liquibase.exception.DatabaseException: The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.accession' and the index name 'ndx_uniq_accessionNumber'. The duplicate key value is (<NULL>).
We have searched for the error according to the given changeset (1658154335099-2) but it is related to the Inventory table not the Accession table as indicated by the exception.
This problem had not occurred in our previous installations and it is present in our two instances: Wheat and Maize (recently updated).
Full exception is here: 1658154335099-2.log