Hi all,
For the past 4-5 months ive been using Liquibase at my company with minimal issue. Over night something changed and it seems liquibase is now constantly trying to drop the DATABASECHANGELOGLOCK table.
So when I use the diffChangeLog between two empty schemas I correctly get an empty change set (json), but when I try to run updateSQL it gives me the following.
[2021-05-04 16:01:50] FINE [liquibase.lockservice] Created database lock table with name: “SCHEMA_NAME”.DATABASECHANGELOGLOCK
[2021-05-04 16:01:50] FINE [liquibase.executor] Executing with the ‘jdbc’ executor
[2021-05-04 16:01:50] FINE [liquibase.executor] Executing with the ‘jdbc’ executor
[2021-05-04 16:01:50] FINE [liquibase.executor] Executing with the ‘jdbc’ executor
[2021-05-04 16:01:50] FINE [liquibase.executor] Executing with the ‘jdbc’ executor
Unexpected error running Liquibase: Error executing SQL SELECT MIN(locked) AS test FROM “SCHEMA_NAME”.DATABASECHANGELOGLOCK FETCH FIRST ROW ONLY: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=SCHEMA_NAME.DATABASECHANGELOGLOCK, DRIVER=4.27.25
For more information, please use the --logLevel flag
[2021-05-04 16:01:50] SEVERE [liquibase.integration] Unexpected error running Liquibase: Error executing SQL SELECT MIN(locked) AS test FROM “SCHEMA_NAME”.DATABASECHANGELOGLOCK FETCH FIRST ROW ONLY: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=SCHEMA_NAME.DATABASECHANGELOGLOCK, DRIVER=4.27.25
liquibase.exception.LockException: liquibase.exception.DatabaseException: Error executing SQL SELECT MIN(locked) AS test FROM “SCHEMA_NAME”.DATABASECHANGELOGLOCK FETCH FIRST ROW ONLY: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=SCHEMA_NAME.DATABASECHANGELOGLOCK, DRIVER=4.27.25
I am using DB2 Warehouse on Cloud (using DB2 JDBC4 driver) and fairly positive that prior to this updateSQL would just give the Create table statements for the DATABASECHANGELOGLOCK and DATABASECHANGELOG.
Also despite the above “Created database lock table” I can confirm it certainly isn’t creating anything.
I don’t think this is a liquibase issue but I am curious how exactly does liquibase determine if the DATABASECHANGELOGLOCK exists because I suspect someone has added some odd permission on something that is prevent liquibase from seeing this and then thinks it needs to delete it.
Any help would be greatly appreciated,
Daniel C