Stash Data Center fails to start with a 'Lock file .../shared/.lock cannot be created in home directory' error

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

Stash Data Center fails to start. The following appears in the atlassian-stash.log:

Lock file .../shared/.lock cannot be created in home directory...

You will also see the following message in the terminal:

***Appropriate error message goes here***

 

Cause

A common reason for this error is that your NFS lock service is disabled or misconfigured. This can happen because the portmap and dbus services (at least, in Ubuntu Linux) are not always enabled by default.

Stash creates .lock files in both ${STASH_HOME} and ${STASH_HOME}/shared.

Stash Server acquires an exclusive lock on both directories, preventing any other instances of Stash (Server or Data Center) from using them.

Stash Data Center acquires an exclusive lock on ${STASH_HOME} (preventing any other Stash instances from using it) and a shared lock on${STASH_HOME}/shared (allowing it to be shared with other Stash Data Center cluster nodes but not Stash Server instances).

These checks might seem strict, but they are in place to make sure that data loss through accidentally misconfiguring Stash instances to use the same home directory can never happen. 

Resolution

Make sure the lockdportmap, and dbus services are all running on your NFS server, and restart Stash. See Installing Stash Data Center for more information.

If you still have one or more leftover .lock files after shutting down all your instances of Stash, it's safe to delete them and start over.

Last modified on Mar 30, 2016

Was this helpful?

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