Confluence Upgrade Failed with liquibase.exception.LockException: Could not acquire change log lock Error
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Confluence Data Center Upgrade Failed with 'liquibase.exception.LockException: Could not acquire change log lock Error'.
Error log detail
Upgrading to Confluence 6.14 and above fails with the following error appearing in the atlassian-confluence.log
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
2019-04-01 12:45:19,509 ERROR \[Caesium-1-2] \[migration.agent.queue.QueueBroker] error An error occurred when getting the next batch for consumer type: CONFLUENCE_IMPORT. Message: javax.persistence.PersistenceException: Failed to update database schema
com.atlassian.util.concurrent.LazyReference$InitializationException: javax.persistence.PersistenceException: Failed to update database schema
at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149\)
at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112\)
at com.atlassian.migration.agent.store.jpa.impl.DefaultSessionFactorySupplier.get(DefaultSessionFactorySupplier.java:57\)
at com.atlassian.migration.agent.store.jpa.impl.DefaultSessionFactorySupplier.get(DefaultSessionFactorySupplier.java:36\)
at com.atlassian.migration.agent.store.jpa.impl.DefaultPluginTransactionTemplate.on(DefaultPluginTransactionTemplate.java:33\)
at com.atlassian.migration.agent.store.tx.PluginTransactionTemplate.write(PluginTransactionTemplate.java:26\)
at com.atlassian.migration.agent.queue.QueueBroker.getNextBatch(QueueBroker.java:119\)
...
at java.util.ArrayList.forEach(ArrayList.java:1257\)
at com.atlassian.migration.agent.queue.QueueBroker.runJob(QueueBroker.java:100\)
at com.atlassian.confluence.impl.schedule.caesium.JobRunnerWrapper.doRunJob(JobRunnerWrapper.java:117\)
...
Caused by: javax.persistence.PersistenceException: Failed to update database schema
at com.atlassian.migration.agent.store.jpa.impl.LiquibaseSchemaUpgrader.upgrade(LiquibaseSchemaUpgrader.java:35\)
at com.atlassian.migration.agent.store.jpa.impl.DefaultSessionFactorySupplier.buildSessionFactory(DefaultSessionFactorySupplier.java:62\)
...
at com.atlassian.migration.agent.store.jpa.impl.DefaultSessionFactorySupplier.get(DefaultSessionFactorySupplier.java:57\)
at com.atlassian.migration.agent.store.jpa.impl.DefaultSessionFactorySupplier.get(DefaultSessionFactorySupplier.java:36\)
at com.atlassian.migration.agent.store.jpa.impl.DefaultPluginTransactionTemplate.on(DefaultPluginTransactionTemplate.java:33\)
at com.atlassian.migration.agent.store.tx.PluginTransactionTemplate.read(PluginTransactionTemplate.java:18\)
at com.atlassian.migration.agent.service.impl.DefaultStatisticsService.calculateServerStats(DefaultStatisticsService.java:132\)
at com.atlassian.migration.agent.service.impl.SingleJobExecutor.lambda$execute$0(SingleJobExecutor.java:28\)
...
Caused by: liquibase.exception.LockException: Could not acquire change log lock. Currently locked by <DatabaseServer> \(<DatabaseServerIP>\) since 04.02.19 20:03
at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:230\)
at liquibase.Liquibase.update(Liquibase.java:184\)
at liquibase.Liquibase.update(Liquibase.java:179\)
at com.atlassian.migration.agent.store.jpa.impl.LiquibaseSchemaUpgrader.upgrade(LiquibaseSchemaUpgrader.java:30\)
Release the lock or disable the Cloud Migration Assistant
Choose one of these workarounds to resolve this issue:
To release the lock manually, execute the SQL query below in the Confluence Database.
PostgreSQL
1
UPDATE MIG_DB_CHANGELOG_LOCK SET LOCKED=false, LOCKGRANTED=null, LOCKEDBY=null where ID=1;
MySQL, SQL Server and Oracle
1
UPDATE MIG_DB_CHANGELOG_LOCK SET LOCKED=0, LOCKGRANTED=null, LOCKEDBY=null where ID=1;
Alternately, you may disable the Cloud Migration Assistant for Confluence in the Confluence instance.
Cause
This issue occurred because the MIG_DB_CHANGELOG_LOCK
table has not been updated with the release lock information. This most likely was caused by forced termination of Confluence while it was trying to migrate the Database schema after an upgrade.
The MIG_DB_CHANGELOG_LOCK
table is related to the Cloud Migration Assistant for Confluence plugin which is bundled by default since Confluence 6.14.
Was this helpful?