Unable to create lock file for jira.home directory 'c:\jira_home\home'.

Athira K P September 18, 2011

Hi ,

I was unable to startup the tomcat server. The error i got was "Unable to create lock file for jira.home directory 'c:\jira_home\home'". When i tried to delete the lock file before start up it gave an error message like 'you dont have permissions to delete this file'. Now i have succeded in deleting the log file but unable to create lock file on startup.

-Athira

5 answers

1 accepted

1 vote
Answer accepted
Jim Birch
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 19, 2011

The lock file is created to block a second Jira process from starting and messing things up. It is created when Jira starts and deleted when it terminates. The Jira process must be able to create and delete this file for Jira to work. If Jira crashes, the lock file is left behind and Jira won't start. In this case, the administrator must cconfirm that Jira really isn't running then delete the lockfile.

The Jira process needs the the rights to create and delete the file for Jira to work. The admin needs to be able to delete the file if there's a crash (uncompleted termination). Check rights.

agouaux March 11, 2012

Ran into this. File system over SAN failed. It's back now, no data lost, but when try to start up JIRA, I get this error. So I shutdown JIRA, remove this file, and try again. However, once again it fails to start because cannot lock the home directory, and that file is back again. So is there anything also set in the database to lock the home directory, or is it only this file?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 11, 2012

It is only that file. There's nothing in the database to do locking, and if there were, you'd get a different error.

You must make sure the user account Jira is running under has full read/write/execute/delete on that whole directory and it's sub-directories.

I'd also go through a full cyclic check - stop Jira, make sure the file is not there, start it and see exactly when it appears (and disappears on shutdown too) in the cycle.

agouaux March 12, 2012

(In our case it turned out to be problems with NFS file locking within the jire.home directory. That NFS server, which points at SAN devices, had problems, and when it came back up, it would seem that file locking was somehow horked. This prevented JIRA from starting up. When we created the jira.home as a local file system, then our problems disappeared. Something to be mindful of when using NFS....)

2 votes
Michael Thompson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2018

I ran into this before and have come up with a solution that always works. Copying from my notes....

SUMMARY

 When attempting to restart JIRA, although the process starts users are unable to access the web UI. In reviewing the catalina.out file, you find the following error soon after the start is issued: 

2016-12-19 10:19:02,326 localhost-startStop-1 ERROR      [jira.web.dispatcher.JiraWebworkActionDispatcher]
 ******************************************

JIRA startup failed, JIRA has been locked.

******************************************

 

CAUSE

 

There are several possibilities, but the following two are most likely.

  1. There is a lock file created from the previous session.
  2. JIRA had previously been started as the root user instead of the jira user, and now there are temporary files in the felix subdirectory that cannot be modified or deleted.

 

RESOLUTION

 

Attempt to fix both of the possible causes.

 

  1. As the jira user, delete the lock file (if it exists)

    sudo rm $JIRA_HOME/.jira-home.lock
     
  2. As the jira user, delete the felix directory

    sudo rm -rf $JIRA_HOME/plugins/.osgi-plugins/felix
     
  3. Start JIRA as the jira user

    $JIRA_INSTALL_DIR/bin/start-jira.sh
0 votes
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 25, 2011

Try running JIRA as an Administrator. Right click cmd to run as admin.

0 votes
Athira K P September 25, 2011

Hi,

I have deleted the lock file from jira_home directory. now when I give the startup command in cmd, it is displaying as

Unable to create lock file for jira.home directory 'C;\jira_home\home'

and Startup check failed. JIRA will be locked.

I am having write access to C: now

0 votes
Radu Dumitriu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 18, 2011

When running jira as a certain user, most probably you have to grant that user some rights. I suppose you are on Windows, so ask your administrator to grant to the user you are running jira with some full permissions on the c:/jira_home/home directory^H^H^H^H^H^H^H^H folder.

Suggest an answer

Log in or Sign up to answer