MySQL – Waiting for changelog lock

I have a VPS that I use for vehicle tracking/fleet management and had a few issues with it a while back whereby the front end wouldn’t startup due to a lock in the database. This happened because the node the VPS was on and had to be rebooted by the VPS provider. It was unfortunate that it just happened to be writing something at the time when it was abruptly stopped and left in a locked state.

The error in the MySQL/Application logs looked like the below.

Waiting for changelog lock....
Waiting for changelog lock....
Waiting for changelog lock....
Waiting for changelog lock....
Liquibase Update Failed: Could not acquire change log lock.  Currently locked by ###### (172.16.0.10) since 2018-03-26 10:18
SEVERE 2018-03-26 14:31:liquibase: Could not acquire change log lock.  Currently locked by ###### (172.16.0.10) since 2018-03-26 10:18
liquibase.exception.LockException: Could not acquire change log lock.  Currently locked by ###### (172.16.0.10) since 2018-03-26 10:18
at liquibase.lockservice.LockService.waitForLock(LockService.java:81)
at liquibase.Liquibase.tag(Liquibase.java:507)
at liquibase.integration.commandline.Main.doMigration(Main.java:643)
at liquibase.integration.commandline.Main.main(Main.java:116)

To resolve this you will need to know your MySQL/Oracle root or database user, username and password to access the database.

Once you have access to the database run the following line, this will drop the DATABASECHANGELOGLOCK table and it will be recreated.

UPDATE DATABASECHANGELOGLOCK SET LOCKED=FALSE, LOCKGRANTED=null, LOCKEDBY=null where ID=1;

Be the first to comment on "MySQL – Waiting for changelog lock"

Leave a comment

Your email address will not be published.


*