Crowd Server Does Not Start - Could not acquire change log lock

お困りですか?

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

コミュニティに質問

問題

Crowd Server does not start and the following error can be seen in the atlassian-crowd.log:


2020-08-27 22:15:50,436 localhost-startStop-1 INFO [liquibase] Waiting for changelog lock....
...
2020-08-27 22:20:50,501 localhost-startStop-1 ERROR [crowd.console.listener.StartupListener] Failed to initialise Crowd container
java.lang.RuntimeException: liquibase.exception.LockException: Could not acquire change log lock.  Currently locked by my.test-crowd-server (192.168.48.3) since 8/27/20 4:03 AM
	at com.atlassian.crowd.util.persistence.hibernate.LiquibaseSchemaHelper.runLiquibaseUpdate(LiquibaseSchemaHelper.java:142)
	at com.atlassian.crowd.util.persistence.hibernate.LiquibaseSchemaHelper.lambda$updateSchemaIfNeeded$1(LiquibaseSchemaHelper.java:80)
	at com.atlassian.crowd.util.persistence.hibernate.LiquibaseSchemaHelper.withServiceRegistry(LiquibaseSchemaHelper.java:166)
	at com.atlassian.crowd.util.persistence.hibernate.LiquibaseSchemaHelper.withServiceRegistry(LiquibaseSchemaHelper.java:152)
	at com.atlassian.crowd.util.persistence.hibernate.LiquibaseSchemaHelper.updateSchemaIfNeeded(LiquibaseSchemaHelper.java:79)
	at com.atlassian.crowd.console.listener.StartupListener.migrateAndUpgradeCrowd(StartupListener.java:193)
	at com.atlassian.crowd.console.listener.StartupListener.contextInitialized(StartupListener.java:60)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4792)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1420)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: liquibase.exception.LockException: Could not acquire change log lock.  Currently locked by my.test-crowd-server (192.168.48.3) since 8/27/20 4:03 AM
	at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:190)
	at liquibase.Liquibase.update(Liquibase.java:196)
	at liquibase.Liquibase.update(Liquibase.java:192)
	at com.atlassian.crowd.util.persistence.hibernate.LiquibaseSchemaHelper.runLiquibaseUpdate(LiquibaseSchemaHelper.java:137)
	... 15 more


The following is also presented on the Crowd User Interface:

診断

Check for the above mentioned log errors in atlassian-crowd.log as well as checking the above screen presented on Crowd.

Alternatively, check the database to see if the is locked whilst Crowd has been shut down:


Lock table is held by something (Bad)
-- POSTGRES
> select * from cwd_databasechangeloglock;

-- MySQL, MSSQL and Oracle
> select * from CWD_DATABASECHANGELOGLOCK;

id locked lockgranted             lockedby 
-- ------ ----------------------- ---------------------------------------
1  true   2020-08-27 04:03:41.451 my.test-crowd-server.com (192.168.48.3)
Lock table is not held by anything (Good)
-- POSTGRES
> select * from cwd_databasechangeloglock;

-- MySQL, MSSQL and Oracle
> select * from CWD_DATABASECHANGELOGLOCK;

id locked lockgranted lockedby 
-- ------ ----------- -------- 
1  false  (null)      (null)   


原因

The cwd_databasechangeloglock table has not been updated with the release lock information.

The likely cause of this is that the Crowd Server instance was forced to quit while it was trying to startup, with the consequence that the lock was not released. You should always wait for Crowd Server to start up sufficiently for it to provide error messages – never assume that it has hung and kill the process.

ソリューション

Ensure that Crowd Server application is shutdown prior to running the below SQL queries to manually force unlock the cwd_databasechangeloglock table.


  1. Shutdown Crowd Server
  2. Run the following SQL query in respect to your database engine:

    Click here to expand for MySQL and SQL Server
    UPDATE CWD_DATABASECHANGELOGLOCK SET LOCKED=0, LOCKGRANTED=null, LOCKEDBY=null where ID=1;
    Click here to expand for Oracle
    UPDATE CWD_DATABASECHANGELOGLOCK SET LOCKED=0, LOCKGRANTED=null, LOCKEDBY=null where ID=1;
    commit;
    PostgreSQL 用は、ここをクリックして展開してください。
    update cwd_databasechangeloglock set locked='false', lockgranted=null, lockedby=null where id=1;
  3. Start Crowd Server and the "Could not acquire change lock" error should no longer appear


最終更新日 2020 年 8 月 31 日

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

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