'Couldn't lock file 'lock' in directory' error on Confluence startup

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

When starting Confluence, the startup is not successful and an error message is exhibited on the browser:

(Auto-migrated image: description temporarily unavailable)

It's possible to spot the same error in the logs:

1 2 2020-05-15 09:28:10,464 ERROR [Catalina-utility-1] [atlassian.confluence.setup.BootstrapApplicationStartupListener] checkConfigurationOnStartup Couldn't lock file 'lock' in directory /var/atlassian/application-data/confluence Make sure the directory is not being used by another Confluence instance.

On the example listed here, the lock file resides on /var/atlassian/application-data/confluence/

Diagnosis

  1. Check if there are any other java processes running by running the following command on the OS terminal:

    1 $ ps aux | grep java
  2. Check for any other Confluence running at the moment and using the same home directory

Cause

This could be caused by an existing Confluence process running or the previous process not being killed properly. As the previous lock is still in place, Confluence is not able to start properly.

Solution

If there's a Confluence process running, stop it, follow the error message path to find the lock file, delete it and restart Confluence.

Updated on February 28, 2025

Still need help?

The Atlassian Community is here for you.