Could not lock user prefs Unix error code 2

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

The following appears in the atlassian-jira.log about every 30 seconds:

Dec 14, 2011 9:28:51 AM java.util.prefs.FileSystemPreferences syncWorld
WARNING: Couldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get file lock.
Dec 14, 2011 9:29:21 AM java.util.prefs.FileSystemPreferences checkLockFile0ErrorCode
WARNING: Could not lock User prefs. Unix error code 2.

Cause

This occurs when the user being used to run a JIRA application doesn't have a writeable home directory (for example:  /home/jira or ~jira didn't exist). It is possible for a plugin to use the prefs module, which defaults to write to ~/.jira/

(info) It is possible the home directory was not created as part of the installation as process, as tracked under  JRA-33595 - Getting issue details... STATUS .

Resolution

  1. Create the user home directory. This is not $JIRA_HOME, it is the Linux user directory, for example /home/jira.
  2. Make sure the user running JIRA application has the proper permissions to access this direct
  3. If changing the permissions didn't have any effect, add the following JVM parameter:
     -Djava.util.prefs.userRoot=/<some-writable-directory>

Last modified on Nov 1, 2018

Was this helpful?

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