Liquibase issues. It was trying to delete a new field and erroring out

This thing is the bane of my existence.
IM STOPPED in development again. Considering going back to CUBA even if its the old one. NEVER had any database issues. whenever there was a versioning problem I just deleted the folder and the problem went away. I dont care about db versioning early on development and liquibase gets in the way big time.

Check some errors. online it says to do this… does not exist in JMIX.
./gradlew liquibaseClearChecksums

day of work… gone… application wont start… this is not helping me with fast deveopment. The changelog xml is there… I had problems with that deleted in the past.

Deleting my entire database and redoing the datastore let me continue working.

– nevermind… the admin user was not created… I cannot login…

Unexpected error running Liquibase: Validation Failed:
     1 change sets check sum
          com/app/aptitude/liquibase/changelog/2022/01/31-220-06094507.xml::1::apt was: 8:9fc427ddeb4f9a1b1759e7116952132c but is now: 8:9d798d952bd58ac682a2fe5e1f0adbbc

    For more information, please use the --logLevel flag
    [2022-01-31 10:24:39] SEVERE [liquibase.integration] Unexpected error running Liquibase: Validation Failed:
         1 change sets check sum
              com/app/aptitude/liquibase/changelog/2022/01/31-220-06094507.xml::1::apt was: 8:9fc427ddeb4f9a1b1759e7116952132c but is now: 8:9d798d952bd58ac682a2fe5e1f0adbbc

    liquibase.exception.ValidationFailedException: Validation Failed:
         1 change sets check sum
              com/app/aptitude/liquibase/changelog/2022/01/31-220-06094507.xml::1::apt was: 8:9fc427ddeb4f9a1b1759e7116952132c but is now: 8:9d798d952bd58ac682a2fe5e1f0adbbc

    	at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:299)
    	at liquibase.Liquibase.lambda$update$1(Liquibase.java:237)
    	at liquibase.Scope.lambda$child$0(Scope.java:160)
    	at liquibase.Scope.child(Scope.java:169)
    	at liquibase.Scope.child(Scope.java:159)
    	at liquibase.Scope.child(Scope.java:138)
    	at liquibase.Liquibase.runInScope(Liquibase.java:2369)
    	at liquibase.Liquibase.update(Liquibase.java:217)
    	at liquibase.Liquibase.update(Liquibase.java:203)
    	at liquibase.integration.commandline.Main.doMigration(Main.java:1802)
    	at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:367)
    	at liquibase.Scope.lambda$child$0(Scope.java:160)
    	at liquibase.Scope.child(Scope.java:169)
    	at liquibase.Scope.child(Scope.java:159)
    	at liquibase.Scope.child(Scope.java:138)
    	at liquibase.integration.commandline.Main$1.run(Main.java:366)
    	at liquibase.integration.commandline.Main$1.run(Main.java:196)
    	at liquibase.Scope.child(Scope.java:169)
    	at liquibase.Scope.child(Scope.java:145)
    	at liquibase.integration.commandline.Main.run(Main.java:196)
    	at liquibase.integration.commandline.Main.main(Main.java:158)

I created a new app… created new db… it created the admin user… i got back to my old app… connected to the db created before AND ONLY LIKE that i was able to log in…

I was able to work a few more hours… now im getting this error again… I hadnt touched any liquibase thing.

Skipping auto-registration

[2022-01-31 14:58:17] WARNING [liquibase.hub] Skipping auto-registration
[2022-01-31 14:58:17] INFO [liquibase.lockservice] Successfully released change log lock
Unexpected error running Liquibase: Migration failed for change set com/app/aptitude/liquibase/changelog/2022/01/31-060-06094507.xml::9::apt:
Reason: liquibase.exception.DatabaseException: (conn=378) Cannot drop index ‘IDX_BUSINESSPROCESSSTEP’: needed in a foreign key constraint [Failed SQL: (1553) DROP INDEX IDX_BUSINESSPROCESSSTEP ON aptitude.APT_BUSINESS_PROCESS_STEP]
For more information, please use the --logLevel flag
[2022-01-31 14:58:17] SEVERE [liquibase.integration] Unexpected error running Liquibase: Migration failed for change set com/app/aptitude/liquibase/changelog/2022/01/31-060-06094507.xml::9::apt:
Reason: liquibase.exception.DatabaseException: (conn=378) Cannot drop index ‘IDX_BUSINESSPROCESSSTEP’: needed in a foreign key constraint [Failed SQL: (1553) DROP INDEX IDX_BUSINESSPROCESSSTEP ON aptitude.APT_BUSINESS_PROCESS_STEP]
liquibase.exception.LiquibaseException: liquibase.exception.MigrationFailedException: Migration failed for change set com/app/aptitude/liquibase/changelog/2022/01/31-060-06094507.xml::9::apt:
Reason: liquibase.exception.DatabaseException: (conn=378) Cannot drop index ‘IDX_BUSINESSPROCESSSTEP’: needed in a foreign key constraint [Failed SQL: (1553) DROP INDEX IDX_BUSINESSPROCESSSTEP ON aptitude.APT_BUSINESS_PROCESS_STEP]
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:124)
at liquibase.Liquibase.lambda$null$0(Liquibase.java:272)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.Scope.child(Scope.java:222)
at liquibase.Liquibase.lambda$update$1(Liquibase.java:271)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.Liquibase.runInScope(Liquibase.java:2369)
at liquibase.Liquibase.update(Liquibase.java:217)
at liquibase.Liquibase.update(Liquibase.java:203)
at liquibase.integration.commandline.Main.doMigration(Main.java:1802)
at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:367)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.integration.commandline.Main$1.run(Main.java:366)
at liquibase.integration.commandline.Main$1.run(Main.java:196)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:145)
at liquibase.integration.commandline.Main.run(Main.java:196)
at liquibase.integration.commandline.Main.main(Main.java:158)
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set com/app/aptitude/liquibase/changelog/2022/01/31-060-06094507.xml::9::apt:
Reason: liquibase.exception.DatabaseException: (conn=378) Cannot drop index ‘IDX_BUSINESSPROCESSSTEP’: needed in a foreign key constraint [Failed SQL: (1553) DROP INDEX IDX_BUSINESSPROCESSSTEP ON aptitude.APT_BUSINESS_PROCESS_STEP]
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:672)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:49)
at liquibase.changelog.ChangeLogIterator$2.lambda$null$0(ChangeLogIterator.java:111)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.changelog.ChangeLogIterator$2.lambda$run$1(ChangeLogIterator.java:110)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.Scope.child(Scope.java:222)
at liquibase.changelog.ChangeLogIterator$2.run(ChangeLogIterator.java:94)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.Scope.child(Scope.java:222)
at liquibase.Scope.child(Scope.java:226)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:66)
… 26 more
Caused by: liquibase.exception.DatabaseException: (conn=378) Cannot drop index ‘IDX_BUSINESSPROCESSSTEP’: needed in a foreign key constraint [Failed SQL: (1553) DROP INDEX IDX_BUSINESSPROCESSSTEP ON aptitude.APT_BUSINESS_PROCESS_STEP]
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:393)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:82)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:150)
at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1278)
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1260)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:637)
… 46 more
Caused by: java.sql.SQLTransientConnectionException: (conn=378) Cannot drop index ‘IDX_BUSINESSPROCESSSTEP’: needed in a foreign key constraint
at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:79)
at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:158)
at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:266)
at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:366)
at org.mariadb.jdbc.MariaDbStatement.execute(MariaDbStatement.java:504)
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:389)
… 51 more
Caused by: org.mariadb.jdbc.internal.util.exceptions.MariaDbSqlException: Cannot drop index ‘IDX_BUSINESSPROCESSSTEP’: needed in a foreign key constraint
at org.mariadb.jdbc.internal.util.exceptions.MariaDbSqlException.of(MariaDbSqlException.java:34)
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.exceptionWithQuery(AbstractQueryProtocol.java:194)
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:262)
at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:360)
… 53 more
Caused by: java.sql.SQLException: Cannot drop index ‘IDX_BUSINESSPROCESSSTEP’: needed in a foreign key constraint
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.readErrorPacket(AbstractQueryProtocol.java:1694)
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.readPacket(AbstractQueryProtocol.java:1556)
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.getResult(AbstractQueryProtocol.java:1519)
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:256)
… 54 more

So i removed the index and the foreign keys with another program… because this thing keeps messing up indexes…

[2022-01-31 15:13:29] INFO [liquibase.lockservice] Successfully released change log lock
Unexpected error running Liquibase: Validation Failed:
1 change sets check sum
com/app/aptitude/liquibase/changelog/2022/01/31-060-06094507.xml::2::apt was: 8:cdcdd99c16d0bd9e063c6261ec9f585a but is now: 8:796db585993e14bd20c612e0238e3821

For more information, please use the --logLevel flag
[2022-01-31 15:13:29] SEVERE [liquibase.integration] Unexpected error running Liquibase: Validation Failed:
1 change sets check sum
com/app/aptitude/liquibase/changelog/2022/01/31-060-06094507.xml::2::apt was: 8:cdcdd99c16d0bd9e063c6261ec9f585a but is now: 8:796db585993e14bd20c612e0238e3821

liquibase.exception.ValidationFailedException: Validation Failed:
1 change sets check sum
com/app/aptitude/liquibase/changelog/2022/01/31-060-06094507.xml::2::apt was: 8:cdcdd99c16d0bd9e063c6261ec9f585a but is now: 8:796db585993e14bd20c612e0238e3821

at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:299)
at liquibase.Liquibase.lambda$update$1(Liquibase.java:237)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.Liquibase.runInScope(Liquibase.java:2369)
at liquibase.Liquibase.update(Liquibase.java:217)
at liquibase.Liquibase.update(Liquibase.java:203)
at liquibase.integration.commandline.Main.doMigration(Main.java:1802)
at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:367)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.integration.commandline.Main$1.run(Main.java:366)
at liquibase.integration.commandline.Main$1.run(Main.java:196)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:145)
at liquibase.integration.commandline.Main.run(Main.java:196)
at liquibase.integration.commandline.Main.main(Main.java:158)

Liquibase WONT let me work…

delete from DATABASECHANGELOG;
Will mess up things up.

Create new project…
new db
switch back… recreate db so there is an admin user…
only way I can keep working…

why do i have to do this

update DATABASECHANGELOG set MD5SUM='7:834d03b3da7773ee8b2d5c0b9dd3aa96' where id=21;

just noticed that jmix was creating a whole bunch of indexes with the same name and liquibase was trying to delete them even if they had same name and were used on a relation. db would not let it happen.

I deleted related fields and these indexes are left here… when I redo another join…
image

[2022-01-31 20:39:25] SEVERE [liquibase.integration] Unexpected error running Liquibase: Migration failed for change set com/app/aptitude/liquibase/changelog/2022/01/31-060-06094507.xml::10::apt:
Reason: liquibase.exception.DatabaseException: (conn=803) Cannot drop index ‘IDX_CONDITIONITEM’: needed in a foreign key constraint [Failed SQL: (1553) DROP INDEX IDX_CONDITIONITEM ON aptitude.APT_CONDITION_ITEM]
liquibase.exception.LiquibaseException: liquibase.exception.MigrationFailedException: Migration failed for change set com/app/aptitude/liquibase/changelog/2022/01/31-060-06094507.xml::10::apt:
Reason: liquibase.exception.DatabaseException: (conn=803) Cannot drop index ‘IDX_CONDITIONITEM’: needed in a foreign key constraint [Failed SQL: (1553) DROP INDEX IDX_CONDITIONITEM ON aptitude.APT_CONDITION_ITEM]

uzhasno :frowning:

after deleting those indexes with duplicate names

NOW I GET

/liquibase/changelog/2022/01/31-060-06094507.xml::3::apt was: 8:6dac5327b2a3768c8ebf1f0d9e7e2fe3 but is now: 8:752f00d33c221da969dc61dfd34384ce

Im wrting an update script to fix change this number in the changelog table in the db

Im so frustrated…
This liquibase has been such a problem… no transaction documentation and prices jacked up… sorry for so much posting…

couldnt get it to work… just added to ignore… so I can keep working… Im at the verge on going back to Cuba.

10 pm here… the problems keep coming… my db is empty im getting

(conn=932) Can’t create table aptitude.apt_business_process_step (errno: 121 “Duplicate key on write or update”) [Failed SQL: (1005) ALTER TABLE aptitude.APT_BUSINESS_PROCESS_STEP ADD CONSTRAINT FK_APTBUSINESS_ON_BUSINESSPRO FOREIGN KEY (BUSINESS_PROCESS_STEP_TYPE_ID) REFERENCES aptitude.APT_BP_STEP_TYPE (ID)]

why ?!?!?!!

more of this

[2022-01-31 21:50:42] INFO [liquibase.lockservice] Successfully released change log lock
Unexpected error running Liquibase: Validation Failed:
2 change sets check sum

aptitude/liquibase/changelog/2022/01/31-070-06094507.xml::3::apt was: 8:784bbb818a7c5f25cf180fec07073770 but is now: 8:5ec0591808c67ad65beafc2f109fdbc2

ITS endless

All i wanted to do is add 2 relations

[2022-01-31 21:59:30] WARNING [liquibase.hub] Skipping auto-registration

[2022-01-31 21:59:30] INFO [liquibase.changelog] Columns BUSINESS_PROCESS_STEP_TYPE_ID(UUID) added to APT_BUSINESS_PROCESS_STEP
[2022-01-31 21:59:30] INFO [liquibase.changelog] ChangeSet com/app/aptitude/liquibase/changelog/2022/01/31-090-06094507.xml::1::apt ran successfully in 12ms
[2022-01-31 21:59:30] INFO [liquibase.changelog] Foreign key constraint added to APT_BUSINESS_PROCESS_STEP (BUSINESS_PROCESS_STEP_TYPE_ID)
[2022-01-31 21:59:30] INFO [liquibase.changelog] Index IDX_BUSINESSPROCESSSTEP created
[2022-01-31 21:59:30] INFO [liquibase.changelog] ChangeSet com/app/aptitude/liquibase/changelog/2022/01/31-090-06094507.xml::3::apt ran successfully in 57ms
[2022-01-31 21:59:30] INFO [liquibase.changelog] Index FK_APTBUSINESS_ON_BUSINESSPRO_BUCXJ7 dropped from table apt_business_process_step
[2022-01-31 21:59:30] INFO [liquibase.changelog] ChangeSet com/app/aptitude/liquibase/changelog/2022/01/31-090-06094507.xml::4::apt ran successfully in 15ms
[2022-01-31 21:59:30] INFO [liquibase.lockservice] Successfully released change log lock
Unexpected error running Liquibase: Migration failed for change set com/app/aptitude/liquibase/changelog/2022/01/31-090-06094507.xml::6::apt:
Reason: liquibase.exception.DatabaseException: (conn=978) Can’t create table aptitude.apt_business_process_step (errno: 121 “Duplicate key on write or update”) [Failed SQL: (1005) ALTER TABLE aptitude.APT_BUSINESS_PROCESS_STEP ADD CONSTRAINT FK_APTBUSINESS_ON_BUSINESSPRO FOREIGN KEY (BUSINESS_PROCESS_DEFINITION_ID) REFERENCES aptitude.APT_BUSINESS_PROCESS_DEFINITIO (ID)]
For more information, please use the --logLevel flag
[2022-01-31 21:59:30] SEVERE [liquibase.integration] Unexpected error running Liquibase: Migration failed for change set com/app/aptitude/liquibase/changelog/2022/01/31-090-06094507.xml::6::apt:
Reason: liquibase.exception.DatabaseException: (conn=978) Can’t create table aptitude.apt_business_process_step (errno: 121 “Duplicate key on write or update”) [Failed SQL: (1005) ALTER TABLE aptitude.APT_BUSINESS_PROCESS_STEP ADD CONSTRAINT FK_APTBUSINESS_ON_BUSINESSPRO FOREIGN KEY (BUSINESS_PROCESS_DEFINITION_ID) REFERENCES aptitude.APT_BUSINESS_PROCESS_DEFINITIO (ID)]
liquibase.exception.LiquibaseException: liquibase.exception.MigrationFailedException: Migration failed for change set com/app/aptitude/liquibase/changelog/2022/01/31-090-06094507.xml::6::apt:
Reason: liquibase.exception.DatabaseException: (conn=978) Can’t create table aptitude.apt_business_process_step (errno: 121 “Duplicate key on write or update”) [Failed SQL: (1005) ALTER TABLE aptitude.APT_BUSINESS_PROCESS_STEP ADD CONSTRAINT FK_APTBUSINESS_ON_BUSINESSPRO FOREIGN KEY (BUSINESS_PROCESS_DEFINITION_ID) REFERENCES aptitude.APT_BUSINESS_PROCESS_DEFINITIO (ID)]
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:124)
at liquibase.Liquibase.lambda$null$0(Liquibase.java:272)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.Scope.child(Scope.java:222)
at liquibase.Liquibase.lambda$update$1(Liquibase.java:271)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.Liquibase.runInScope(Liquibase.java:2369)
at liquibase.Liquibase.update(Liquibase.java:217)
at liquibase.Liquibase.update(Liquibase.java:203)
at liquibase.integration.commandline.Main.doMigration(Main.java:1802)
at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:367)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.integration.commandline.Main$1.run(Main.java:366)
at liquibase.integration.commandline.Main$1.run(Main.java:196)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:145)
at liquibase.integration.commandline.Main.run(Main.java:196)
at liquibase.integration.commandline.Main.main(Main.java:158)
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set com/app/aptitude/liquibase/changelog/2022/01/31-090-06094507.xml::6::apt:
Reason: liquibase.exception.DatabaseException: (conn=978) Can’t create table aptitude.apt_business_process_step (errno: 121 “Duplicate key on write or update”) [Failed SQL: (1005) ALTER TABLE aptitude.APT_BUSINESS_PROCESS_STEP ADD CONSTRAINT FK_APTBUSINESS_ON_BUSINESSPRO FOREIGN KEY (BUSINESS_PROCESS_DEFINITION_ID) REFERENCES aptitude.APT_BUSINESS_PROCESS_DEFINITIO (ID)]
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:672)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:49)
at liquibase.changelog.ChangeLogIterator$2.lambda$null$0(ChangeLogIterator.java:111)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.changelog.ChangeLogIterator$2.lambda$run$1(ChangeLogIterator.java:110)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.Scope.child(Scope.java:222)
at liquibase.changelog.ChangeLogIterator$2.run(ChangeLogIterator.java:94)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.Scope.child(Scope.java:222)
at liquibase.Scope.child(Scope.java:226)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:66)
… 26 more
Caused by: liquibase.exception.DatabaseException: (conn=978) Can’t create table aptitude.apt_business_process_step (errno: 121 “Duplicate key on write or update”) [Failed SQL: (1005) ALTER TABLE aptitude.APT_BUSINESS_PROCESS_STEP ADD CONSTRAINT FK_APTBUSINESS_ON_BUSINESSPRO FOREIGN KEY (BUSINESS_PROCESS_DEFINITION_ID) REFERENCES aptitude.APT_BUSINESS_PROCESS_DEFINITIO (ID)]
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:393)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:82)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:150)
at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1278)
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1260)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:637)
… 46 more
Caused by: java.sql.SQLTransientConnectionException: (conn=978) Can’t create table aptitude.apt_business_process_step (errno: 121 “Duplicate key on write or update”)
at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.createException(ExceptionFactory.java:79)
at org.mariadb.jdbc.internal.util.exceptions.ExceptionFactory.create(ExceptionFactory.java:158)
at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:266)
at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:366)
at org.mariadb.jdbc.MariaDbStatement.execute(MariaDbStatement.java:504)
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:389)
… 51 more
Caused by: org.mariadb.jdbc.internal.util.exceptions.MariaDbSqlException: Can’t create table aptitude.apt_business_process_step (errno: 121 “Duplicate key on write or update”)
at org.mariadb.jdbc.internal.util.exceptions.MariaDbSqlException.of(MariaDbSqlException.java:34)
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.exceptionWithQuery(AbstractQueryProtocol.java:194)
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:262)
at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:360)
… 53 more
Caused by: java.sql.SQLException: Can’t create table aptitude.apt_business_process_step (errno: 121 “Duplicate key on write or update”)
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.readErrorPacket(AbstractQueryProtocol.java:1694)
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.readPacket(AbstractQueryProtocol.java:1556)
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.getResult(AbstractQueryProtocol.java:1519)
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(AbstractQueryProtocol.java:256)
… 54 more

image

removing the indexes here and manually changing the MD5 of the changelog made this work again.
WHY??

Let’s try to identify the problem. Please provide the following info:

  • Jmix Studio version
  • MySQL/MariaDB version
  • What attribute are you creating and removing? (the entity code with the class annotations and attribute definition)
  • What Liquibase changelog is generated after removing the attribute?

ill pay consulting hours for this. i Cannot work with liquibase uzhas.

iquibase.command.CommandExecutionException: java.lang.IllegalStateException: Entity PsiClass from SmartPsiElementPointer is null. The PsiClass reparse has completely invalidated the pointer (for example, the element referenced by the pointer has been deleted). This may be due to misuse of the cache.

Hi @eparamo !
I’m trying to reproduce the error, but but I can’t. Can you give us some test project where the error reproduces?

Thanx,
Yulia

most likely the refactoring when deleting entities was changing the liquibase xmls and causing this.

We have also found this issue: https://youtrack.jmix.io/issue/JST-2673
Will fix it soon.

ah yes…we saw that in the call…

im also getting a lot of these

Caused by: liquibase.exception.DatabaseException: Cannot drop index ‘IDX_TESTCASECONDITION’: needed in a foreign key constraint [Failed SQL: (1553) DROP INDEX IDX_TESTCASECONDITION ON aptitude.APT_TEST_CASE_CONDITION]

it wants to delete and recreate the same index… getting errors on that.

spasibo for the help