Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

the jira.home directory is locked by another running instance of jira

Kalyan Kumar Das
Contributor
December 8, 2020

Hi ,

I am getting these error at the time of stating jira. 

May you please recommend that how to check whether another running instance of jira is running or not on ubuntu server. I am stucked on this. 

Please suggest on same. I am using jira 8.2.3 that is on ubuntu os. 

jira_1.jpg

2 answers

0 votes
Patrice E_ January 11, 2021

After hours of search.. i've just found  a .jira-home.lock file owned by root in the jira home folder.. Probably there because of a failed test (normally our jira instance is launched by a dedicated jira user)

 

After removing the file.. works perfectly like a charm again

Kalyan Kumar Das
Contributor
January 12, 2021

@Patrice E_ : Thank you for sharring the answer. But in my case all port and service is blocked by server team. That's the reason jira is not running on localhost also.  

0 votes
Nic Brough -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.
December 8, 2020

Not the "best" way to do it, but a simple "show me what (processes) you got" will do.

Try 

ps -ef

which will give you a moderate amount of information on everything that is running on the machine.  To narrow it down to Jira so you don't have to plough through all processes, try

ps -ef | grep -i jira

It will list all the instances currently running, and tell you where they are being run from.

Kalyan Kumar Das
Contributor
December 9, 2020

hi @Nic Brough -Adaptavist- :,

i getting these output while executing the ps -ef | grep -i jira command:

 avahi 1116 1 0 15:33 ? 00:00:00 avahi-daemon: running [jiratests rv.local]
jiratest 2997 1 0 15:34 ? 00:00:00 /lib/systemd/systemd --user
jiratest 3000 2997 0 15:34 ? 00:00:00 (sd-pam)
root 3079 1 0 15:34 ? 00:00:00 /sbin/runuser -m jira -c ./catal ina.sh run
jira 3080 3079 69 15:34 ? 00:03:23 /opt/atlassian/jira/jre//bin/java -Djava.util.logging.config.file=/opt/atlassian/jira/conf/logging.properties -D java.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xms384m -Xmx2048m -XX:InitialCodeCacheSize=32m -XX:ReservedCodeCacheSize=512m -Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Dorg.dom4j.factory=com.atlassian.core.xml.InterningDocumentFactory -XX:-OmitStackTraceInFastThrow -Djava.locale.providers=COMPAT -Datlassian.plugins.startup.options=-fg -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -D org.apache.catalina.security.SecurityListener.UMASK=0027 -Xloggc:/opt/atlassianjira/logs/atlassian-jira-gc-%t.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=20M -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintGCCause -Dignore.endorsed.dirs= -classpath /opt/atlassian/jira/bin/bootstrap.jar:/opt/atlassian/jira/bin/tomcat-juli.jar -Dcatalina.base=/opt/atlassian/jira -Dcatalina.home=/opt/atlassian/jira -Djava.io.tmpdir=/opt/atlassian/jira/temp org.apache.catalina.startup.Bootstrap start
root 3500 2108 0 15:38 ? 00:00:00 sshd: jiratest [priv]
jiratest 3518 3500 0 15:38 ? 00:00:00 sshd: jiratest@pts/1
jiratest 3531 3518 0 15:38 pts/1 00:00:00 -bash
jiratest 3553 3531 0 15:39 pts/1 00:00:00 ps -ef
jiratest 3554 3531 0 15:39 pts/1 00:00:00 grep --color=auto -i jira

 

As i m so not familiar with server side. That's why need your suggestion. 

I had also performed the operation like delete .lockfile inside jira home directory and also deleted the osgi-plugins and bundled-plugins but not yet started the jira. 

 

Please suggest on same.

Nic Brough -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.
December 9, 2020

Right, so you are running one already. 

You should not be trying to start another one as well, just use the running one.

For a completely clean start, shut the running one down, check it has stopped with ps again, and then start it.

Kalyan Kumar Das
Contributor
December 9, 2020

@Nic Brough -Adaptavist- request you to explain these point in a better way:

For a completely clean start, shut the running one down, check it has stopped with ps again, and then start it. 

Nic Brough -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.
December 9, 2020

I am not sure how I can be more clear.

  • Stop the currently running service
  • Check it has stopped by using ps again
  • Start the server
Kalyan Kumar Das
Contributor
December 9, 2020

@Nic Brough -Adaptavist- : After stopped the service and checked ps command, it is showing that jira is still running  

jiratest@jiratestsrv:/opt/atlassian/jira/bin$ sudo ./stop-jira.sh -fg
[sudo] password for jiratest:
executing using dedicated user

`sMMMMMMMMMMMMMM+
MMMMMMMMMMMMMM
:sdMMMMMMMMMMM
MMMMMM
`sMMMMMMMMMMMMMM+ MMMMMM
MMMMMMMMMMMMMM +MMMMM
:sMMMMMMMMMMM MMMMM
MMMMMM `UOJ
`sMMMMMMMMMMMMM+ MMMMMM
MMMMMMMMMMMMMM +MMMMM
:sdMMMMMMMMMM MMMMM
MMMMMM `UOJ
MMMMMM
+MMMMM
MMMMM
`UOJ

Atlassian Jira
Version : 8.2.3


If you encounter issues starting or stopping JIRA, please see the Troubleshooting guide at https://docs.atlassian.com/jira/jadm-docs-082/Troubleshooting+installation


Server startup logs are located in /opt/atlassian/jira/logs/catalina.out
Using CATALINA_BASE: /opt/atlassian/jira
Using CATALINA_HOME: /opt/atlassian/jira
Using CATALINA_TMPDIR: /opt/atlassian/jira/temp
Using JRE_HOME: /opt/atlassian/jira/jre/
Using CLASSPATH: /opt/atlassian/jira/bin/bootstrap.jar:/opt/atlassian/jira/bin/tomcat-juli.jar
Using CATALINA_PID: /opt/atlassian/jira/work/catalina.pid
$CATALINA_PID was set but the specified file does not exist. Is Tomcat running? Stop aborted.
jiratest@jiratestsrv:/opt/atlassian/jira/bin$ ps -ef | grep -i jira
avahi 1258 1 0 Dec09 ? 00:00:00 avahi-daemon: running [jiratestsrv.local]
jiratest 17333 1 0 09:01 ? 00:00:00 /lib/systemd/systemd --user
jiratest 17341 17333 0 09:01 ? 00:00:00 (sd-pam)
root 17592 1 0 09:17 ? 00:00:00 /sbin/runuser -m jira -c ./catalina.sh run
jira 17593 17592 5 09:17 ? 00:04:19 /opt/atlassian/jira/jre//bin/java -Djava.util.logging.config.file=/opt/atlassian/jira/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xms384m -Xmx2048m -XX:InitialCodeCacheSize=32m -XX:ReservedCodeCacheSize=512m -Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Dorg.dom4j.factory=com.atlassian.core.xml.InterningDocumentFactory -XX:-OmitStackTraceInFastThrow -Djava.locale.providers=COMPAT -Datlassian.plugins.startup.options=-fg -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Xloggc:/opt/atlassian jira/logs/atlassian-jira-gc-%t.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=20M -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintGCCause -Dignore.endorsed.dirs= -classpath /opt/atlassian/jira/bin/bootstrap.jar:/opt/atlassian/jira/bin/tomcat-juli.jar -Dcatalina.base=/opt/atlassian/jira -Dcatalina.home=/opt/atlassian/jira -Djava.io.tmpdir=/opt/atlassian/jira/temp org.apache.catalina.startup.Bootstrap start
root 18295 1981 0 09:34 ? 00:00:00 sshd: jiratest [priv]
jiratest 18297 18295 0 09:34 ? 00:00:00 sshd: jiratest@pts/1
jiratest 18309 18297 0 09:34 pts/1 00:00:00 -bash
jiratest 19142 18309 0 10:43 pts/1 00:00:00 ps -ef
jiratest 19143 18309 0 10:43 pts/1 00:00:00 grep --color=auto -i jira
jiratest@jiratestsrv:/opt/atlassian/jira/bin$ ps -ef | grep -i jira
avahi 1258 1 0 Dec09 ? 00:00:00 avahi-daemon: running [jiratestsrv.local]
jiratest 17333 1 0 09:01 ? 00:00:00 /lib/systemd/systemd --user
jiratest 17341 17333 0 09:01 ? 00:00:00 (sd-pam)
root 17592 1 0 09:17 ? 00:00:00 /sbin/runuser -m jira -c ./catalina.sh run
jira 17593 17592 4 09:17 ? 00:04:20 /opt/atlassian/jira/jre//bin/java -Djava.util.logging.config.file=/opt/atlassian/jira/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xms384m -Xmx2048m -XX:InitialCodeCacheSize=32m -XX:ReservedCodeCacheSize=512m -Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Dorg.dom4j.factory=com.atlassian.core.xml.InterningDocumentFactory -XX:-OmitStackTraceInFastThrow -Djava.locale.providers=COMPAT -Datlassian.plugins.startup.options=-fg -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Xloggc:/opt/atlassian jira/logs/atlassian-jira-gc-%t.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=20M -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintGCCause -Dignore.endorsed.dirs= -classpath /opt/atlassian/jira/bin/bootstrap.jar:/opt/atlassian/jira/bin/tomcat-juli.jar -Dcatalina.base=/opt/atlassian/jira -Dcatalina.home=/opt/atlassian/jira -Djava.io.tmpdir=/opt/atlassian/jira/temp org.apache.catalina.startup.Bootstrap start
root 18295 1981 0 09:34 ? 00:00:00 sshd: jiratest [priv]
jiratest 18297 18295 0 09:34 ? 00:00:00 sshd: jiratest@pts/1
jiratest 18309 18297 0 09:34 pts/1 00:00:00 -bash
jiratest 19195 18309 0 10:45 pts/1 00:00:00 ps -ef

 

please suggest how to stop these process. 

Nic Brough -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.
December 10, 2020

Ok, it's not responding to the proper way to shut it down, so we'll have to be more assertive.

Your operating system can request or force any process to stop.  With unix-like systems, we have a simple "kill" command which can be used with varying levels of agression.

When Jira does this "ignore my stop commands" thing to me, I take a stepped approach.  Run the "ps" command again to find the process id - in your first use that you showed us earlier, you had a line starting

jira 3080 3079 69 15:34 ? 00:03:23 /opt/atlassian/jira/jre//bin/java -Djava.util.logging.config.file=/opt/atlassian/jira/c....

The 3080 is the id you are looking for and the 3079 is the id of the process that kicked off 3080

So, my attempts would be

  • kill 3080
  • kill -9 3080
  • kill 3079
  • kill -9 3079

After each one of those, take a breath or a sip of tea and then run the ps command again to see if Jira has stopped - there's a 99.99% chance that the first "kill -9" will do the job as it's a "I don't care what you are doing, you stop now" message, but it is worth trying the less aggressive "kill 3080" first as that says "we need you to stop when you've finished doing anything you're in the middle of"

Kalyan Kumar Das
Contributor
December 13, 2020

@Nic Brough -Adaptavist- : Killed that id but still not opening. Every-time system generate a new processID for the same means everything will be same except ProcessID .

Please suggest.

Nic Brough -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.
December 14, 2020

What is the new error you are getting after you stopped, checked and cleaned out all running instances, removed the lock file and restarted Jira?

If you've done that and Jira is not running, you have another problem.  If you have the same problem, then we need to look at why you are starting more than one Jira.

Kalyan Kumar Das
Contributor
December 14, 2020

@Nic Brough -Adaptavist- :

The steps which i had followed that is mentioned below:

1. First i had stopped the service and the port 3080 was still running after stopped the service. Then i had killed that iD i.e. 3080 and 3079 by using kill command. Again i had deleted the catalina.pid,jira home lock,osgi plugins and bundled plugins. After deleted the file, i had restarted the server.

2. I had restarted the service. After sometime, i had got the same output that is home directory is locked by another running instance of jira.

3. when i checked with ps command, this is the output which i provided below:

avahi 1116 1 0 15:33 ? 00:00:00 avahi-daemon: running [jiratests rv.local]
jiratest 4997 1 0 15:34 ? 00:00:00 /lib/systemd/systemd --user
jiratest 4000 2997 0 15:34 ? 00:00:00 (sd-pam)
root 4079 1 0 15:34 ? 00:00:00 /sbin/runuser -m jira -c ./catal ina.sh run
jira 4080 4079 69 15:34 ? 00:03:23 /opt/atlassian/jira/jre//bin/java -Djava.util.logging.config.file=/opt/atlassian/jira/conf/logging.properties -D java.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xms384m -Xmx2048m -XX:InitialCodeCacheSize=32m -XX:ReservedCodeCacheSize=512m -Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Dorg.dom4j.factory=com.atlassian.core.xml.InterningDocumentFactory -XX:-OmitStackTraceInFastThrow -Djava.locale.providers=COMPAT -Datlassian.plugins.startup.options=-fg -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -D org.apache.catalina.security.SecurityListener.UMASK=0027 -Xloggc:/opt/atlassianjira/logs/atlassian-jira-gc-%t.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=20M -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintGCCause -Dignore.endorsed.dirs= -classpath /opt/atlassian/jira/bin/bootstrap.jar:/opt/atlassian/jira/bin/tomcat-juli.jar -Dcatalina.base=/opt/atlassian/jira -Dcatalina.home=/opt/atlassian/jira -Djava.io.tmpdir=/opt/atlassian/jira/temp org.apache.catalina.startup.Bootstrap start
root 4500 4108 0 15:38 ? 00:00:00 sshd: jiratest [priv]

Same process i had followed again but not fixed.

Note: Only one instance is running on these server.

Please suggest.

Nic Brough -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.
December 14, 2020

If you're getting the "home directory locked" message, then something is putting a lock fiile there.

The only thing that puts a lock file there is a Jira starting up, and a clean shut-down will remove it.

You're doing too many things in one go to be able to debug this properly.  I would like to see what happens if you only do the absolute basics:

  • Stop Jira
  • Check with ps if there are any Jira processes running
  • Kill all of them, leaving a minute before checking ps again for any that may have refused
  • Go to Jira home and look for the lock file.  If it is there, remove it.
  • Do not run off and clear out other things you're guessing at, or mess with plugins or databases or anything else.  Just remove that one lock file.
  • Issue a single "start jira" and let it run for several minutes without doing anything else.  Do not even try to log into it, just ignore everything.  Go make tea, play with the cat, or something.
  • After 7-10 minutes, visit it with a browser

What is the error message here?  If any?

Kalyan Kumar Das
Contributor
January 12, 2021

@Nic Brough -Adaptavist- : In my case all port and service is blocked by server team. That's the reason jira is not running on localhost also.  

Suggest an answer

Log in or Sign up to answer