Confluence Upgrade Failed with liquibase.exception.LockException: Could not acquire change log lock Error

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server と Data Center のみ - この記事は、サーバーおよびデータセンター プラットフォームのアトラシアン製品にのみ適用されます。

問題

Upgrading to Confluence 6.14 and above fails with the the following error appears in the atlassian-confluence.log

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\)

原因

This issue occurred as the MIG_DB_CHANGELOG_LOCK table has not been updated with the release lock information and this is likely to be caused by force termination of Confluence while it was trying to migrate the Database schema after an upgrade. 

(info) 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.

回避策

You may choose one of the workarounds below to resolve this issue:

  • To release the lock manually by executing the SQL query below in the Confluence Database. 

    Click here to expand for PostgreSQL
    PostgreSQL
    UPDATE MIG_DB_CHANGELOG_LOCK SET LOCKED=false, LOCKGRANTED=null, LOCKEDBY=null where ID=1;
    Click here to expand for MySQL, SQL Server and Oracle
    MySQL, SQL Server and Oracle
    UPDATE MIG_DB_CHANGELOG_LOCK SET LOCKED=0, LOCKGRANTED=null, LOCKEDBY=null where ID=1;
  • Besides that, you may also disable the Cloud Migration Assistant for Confluence in the Confluence instance to workaround this.


説明
製品Confluence

最終更新日 2019 年 7 月 23 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.