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

Still need help?

The Atlassian Community is here for you.

Ask the community

Problem

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:

Diagnosis

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)   


Cause

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.

Resolution

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;
    Click here to expand for 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


Last modified on Aug 31, 2020

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.