We have upgraded Bitbucket 6.8.0 to 6.10.0 as per the recommendation regarding the remote code execution CVE. After a successful upgrade 6.10.0 will not start with the following error message:
ERROR [spring-startup] c.a.s.internal.home.HomeLockAcquirer Lock file E:\Atlassian\ApplicationData\Bitbucket\.lock cannot be obtained in home directory E:\Atlassian\ApplicationData\Bitbucket. Does lloch have write permission on that directory? Is file locking enabled for the filesystem?
java.io.FileNotFoundException: Failed to create lock file E:\Atlassian\ApplicationData\Bitbucket\.lock
at com.atlassian.stash.internal.home.HomeLock.lock(HomeLock.java:101)
at com.atlassian.stash.internal.home.HomeLockAcquirer.lock(HomeLockAcquirer.java:58)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:154)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)
at javax.servlet.GenericServlet.init(GenericServlet.java:158)
at java.lang.Thread.run(Thread.java:748)
... 29 frames trimmed
The Windows services for Bitbucket run under the 'atlbitbucket' user context. According to the NTFS file system security the user account atlbitbucket has full control of the <BITBUCKET_HOME> directory, and all child directories.
When we stop the two Windows services related to Bitbucket, we can delete both the <BITBUCKET_HOME>\.lock and <BITBUCKET_HOME>\shared\.lock files. We then start Bitbucket with the 'start-bitbucket.bat /no-search' command to not run Elastic Search, and process creates the two .lock files.
We don't know why the application server claims that it cannot obtain the lock file when the app-server creates the lock files.