Could not lock user prefs Unix error code 2
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/
It is possible the home directory was not created as part of the installation as process, as tracked under JRASERVER-33595 - jira installer does not create the jira home directory when it creates the user.
Resolution
- Create the user home directory. This is not
$JIRA_HOME
, it is the Linux user directory, for example/home/jira
. - Make sure the user running JIRA application has the proper permissions to access this direct
- If changing the permissions didn't have any effect, add the following JVM parameter:
-Djava.util.prefs.userRoot=/<some-writable-directory>