[Fixed in 2.2.1] Database Upgrade Failed HSQL
Posted: Tue Feb 22, 2022 4:06 pm
Hi I just ran into an issue after updating ubuntu 20.04 to 20.04.3 which resulted in this error being thrown by unimus
We recently were told to switch over to the Beta branch to 2.2.0-Beta3 and it worked without issue. It seems now however, it is referencing what looks like the database was still based on the Stable build 2.1.3 we had prior and its having issues migrating.
Any ideas on what is wrong?
Code: Select all
Feb 22 15:42:36 novus-unimus-eh bash[776]: 2022-02-22 15:42:36.902 INFO 776 --- [cTaskExecutor-1] n.u.s.b.b.step.LoggingPathAccessibility : Checking logging subsystem
Feb 22 15:42:36 novus-unimus-eh bash[776]: 2022-02-22 15:42:36.910 INFO 776 --- [cTaskExecutor-1] n.u.s.b.b.step.DatabaseConnectionCheck : Testing database connection
Feb 22 15:42:38 novus-unimus-eh bash[776]: 2022-02-22 15:42:38.178 INFO 776 --- [cTaskExecutor-1] n.u.s.b.b.step.DatabaseConnectionCheck : Database connection test passed
Feb 22 15:42:38 novus-unimus-eh bash[776]: 2022-02-22 15:42:38.186 INFO 776 --- [cTaskExecutor-1] n.u.s.b.boot.step.DatabaseUpdate : Connecting to database (HSQL, jdbc:hsqldb:file:///etc/unimus/hsql/db;hsqldb.tx=mvcc)
Feb 22 15:42:38 novus-unimus-eh bash[776]: 2022-02-22 15:42:38.191 INFO 776 --- [cTaskExecutor-1] n.u.s.b.boot.step.DatabaseUpdate : Updating database schema
Feb 22 15:42:49 novus-unimus-eh bash[776]: Skipping auto-registration
Feb 22 15:42:49 novus-unimus-eh bash[776]: 2022-02-22 15:42:49.525 WARN 776 --- [cTaskExecutor-1] n.u.b.d.LiquibaseChangeExecListenerImpl : [runFailed] Changelog = 'db/changelog/hsql/db.changelog-master-hsql.xml'. ChangeSet = '2.1.3-12'. Reason = 'liquibase.exception.MigrationFailedException: Migration failed for change set db/changelog/hsql/db.changelog-2.1.3-hsql.xml::2.1.3-12::johnny:
Feb 22 15:42:49 novus-unimus-eh bash[776]: Reason: liquibase.exception.DatabaseException: a FOREIGN KEY constraint already exists on the set of columns: FK_SYNC_RULE_ZONE_ID in statement [ALTER TABLE PUBLIC.sync_rule ADD CONSTRAINT fk_sync_rule_zone_id FOREIGN KEY (to_zone) REFERENCES PUBLIC.zone (id)] [Failed SQL: (-5528) ALTER TABLE PUBLIC.sync_rule ADD CONSTRAINT fk_sync_rule_zone_id FOREIGN KEY (to_zone) REFERENCES PUBLIC.zone (id)]'
Feb 22 15:42:49 novus-unimus-eh bash[776]: 2022-02-22 15:42:49.536 ERROR 776 --- [cTaskExecutor-1] n.u.s.b.boot.step.DatabaseUpdate : Failed to update database schema. Reason = 'liquibase.exception.LiquibaseException: liquibase.exception.MigrationFailedException: Migration failed for change set db/changelog/hsql/db.changelog-2.1.3-hsql.xml::2.1.3-12::johnny:
Feb 22 15:42:49 novus-unimus-eh bash[776]: Reason: liquibase.exception.DatabaseException: a FOREIGN KEY constraint already exists on the set of columns: FK_SYNC_RULE_ZONE_ID in statement [ALTER TABLE PUBLIC.sync_rule ADD CONSTRAINT fk_sync_rule_zone_id FOREIGN KEY (to_zone) REFERENCES PUBLIC.zone (id)] [Failed SQL: (-5528) ALTER TABLE PUBLIC.sync_rule ADD CONSTRAINT fk_sync_rule_zone_id FOREIGN KEY (to_zone) REFERENCES PUBLIC.zone (id)]'
Any ideas on what is wrong?