Bitbucket Server Does Not Start - Could not acquire change log lock
問題
Option#1: Bitbucket Server does not start and the following error can be seen in the atlassian-bitbucket.log
:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [bitbucket-context.xml]: Invocation of init method failed; nested exception is liquibase.exception.LockException: Could not acquire change log lock. Currently locked by fe80:0:0:0:a00:27ff:fe6a:c787%2 (fe80:0:0:0:a00:27ff:fe6a:c787%2) since 12/6/12 2:08 PM
Option#2: Bitbucket Data Center has the nodes hosted in Docker containers. During the full cluster restart with (docker stop) the startup hangs on the setting the lock for the filesystem:
[spring-startup] c.a.s.internal.home.HomeLockAcquirer Successfully acquired lock on home directory /var/atlassian/bitbucket-home/atlassian-bitbucket-5.16.0
原因
The DATABASECHANGELOGLOCK
table has not been updated with the release lock information.
The likely cause of this is that the Bitbucket Server instance was forced to quit while it was trying to migrate the database schema after an upgrade, with the consequence that the lock was not released. You should always wait for Bitbucket Server to start up sufficiently for it to provide error messages if there are schema migration problems – never assume that it has hung and kill the process.
Another possible cause of not releasing the lock is that Bitbucket Server was forced to quit while performing automatic application setup.
ソリューション
Bitbucket Server needs an exclusive lock on the DATABASECHANGELOGLOCK
table in order to start so take care to disconnect / close the tool used to update the database. If you do not do this you may experience Bitbucket Server hanging on start up with no errors in the logs and no response from the web server.