JIRA Locked Error. Won't startup

Hi, I've got JIRA version 7.0.10 and somehow it has been locked and keeps giving following errors.

********************************************************************************************************************
    JIRA has no permission to either create or write to subdirectory 'caches' of jira.home '/var/application-data/jira'.
    ********************************************************************************************************************
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: atlassian-jira.log (Permission denied)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(FileOutputStream.java:270)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:133)
        at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
        at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:207)
        at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
        at com.atlassian.jira.logging.JiraHomeAppender.configureAppender(JiraHomeAppender.java:277)
        at com.atlassian.jira.logging.JiraHomeAppender.doAppendSync(JiraHomeAppender.java:222)
        at com.atlassian.jira.logging.JiraHomeAppender.doAppend(JiraHomeAppender.java:208)
        at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
        at org.apache.log4j.Category.callAppenders(Category.java:206)
        at org.apache.log4j.Category.forcedLog(Category.java:391)
        at org.apache.log4j.Category.log(Category.java:838)
        at com.atlassian.jira.startup.FormattedLogMsg.printMessageImpl(FormattedLogMsg.java:192)
        at com.atlassian.jira.startup.FormattedLogMsg.printMessage(FormattedLogMsg.java:186)
        at com.atlassian.jira.startup.JiraStartupLogger.printMessage(JiraStartupLogger.java:55)
        at com.atlassian.jira.startup.StartupStateTemplate$CreateStartupChecksResult.call(StartupStateTemplate.java:105)
        at com.atlassian.jira.startup.StartupStateTemplate$CreateStartupChecksResult.call(StartupStateTemplate.java:100)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at com.atlassian.jira.startup.StartupStateTemplate.isStartupChecksPassed(StartupStateTemplate.java:43)
        at com.atlassian.jira.startup.JiraStartupChecklist.startupOK(JiraStartupChecklist.java:47)
        at com.atlassian.jira.startup.BootstrapContainerLauncher.bootstrapJIRA(BootstrapContainerLauncher.java:43)
        at com.atlassian.jira.startup.BootstrapContainerLauncher.start(BootstrapContainerLauncher.java:28)
        at com.atlassian.jira.startup.DefaultJiraLauncher.preDbLaunch(DefaultJiraLauncher.java:100)
        at com.atlassian.jira.startup.DefaultJiraLauncher.lambda$start$516(DefaultJiraLauncher.java:89)
        at com.atlassian.jira.startup.DefaultJiraLauncher$$Lambda$1/1586194569.run(Unknown Source)
        at com.atlassian.jira.util.devspeed.JiraDevSpeedTimer.run(JiraDevSpeedTimer.java:31)
        at com.atlassian.jira.startup.DefaultJiraLauncher.start(DefaultJiraLauncher.java:88)
        at com.atlassian.jira.startup.LauncherContextListener.contextInitialized(LauncherContextListener.java:79)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4710)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5135)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
2016-08-11 02:05:23,423 localhost-startStop-1 INFO      [c.a.jira.startup.JiraStartupLogger] Running JIRA startup checks.
2016-08-11 02:05:23,423 localhost-startStop-1 FATAL      [c.a.jira.startup.JiraStartupLogger] Startup check failed. JIRA will be locked.
2016-08-11 02:05:23,599 localhost-startStop-1 INFO      [c.a.j.config.database.SystemDatabaseConfigurationLoader] Reading database configuration from /var/application-data/jira/dbconfig.xml
2016-08-11 02:05:23,695 localhost-startStop-1 INFO      [c.a.jira.startup.LauncherContextListener] Memory Usage:
    ---------------------------------------------------------------------------------
      Heap memory     :  Used:   70 MiB.  Committed:  469 MiB.  Max:  997 MiB
      Non-heap memory :  Used:   33 MiB.  Committed:   33 MiB.  Max: 1264 MiB
    ---------------------------------------------------------------------------------
      TOTAL           :  Used:  102 MiB.  Committed:  502 MiB.  Max: 2261 MiB
    ---------------------------------------------------------------------------------
2016-08-11 02:05:23,969 localhost-startStop-1 WARN      [c.a.j.config.properties.ApplicationPropertiesStore] Exception getting property 'jira.trustedapps.user.name.transformation.policy.class' from database. Using default
2016-08-11 02:05:24,060 localhost-startStop-1 ERROR      [c.a.j.web.dispatcher.JiraWebworkActionDispatcher]
    ******************************************
    JIRA startup failed, JIRA has been locked.
    ******************************************
11-Aug-2016 02:05:24.075 SEVERE [Catalina-startStop-1] org.apache.catalina.startup.HostConfig.start Unable to create directory for deployment: /opt/jira/conf/Catalina/localhost
11-Aug-2016 02:05:24.088 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
11-Aug-2016 02:05:24.092 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 4060 ms
2016-08-11 02:05:34,779 http-nio-8080-exec-1 ERROR anonymous 125x1x1 - 10.17.4.31 /JiraLockedError [c.a.j.template.velocity.VelocityEngineFactory$Default] Exception initialising Velocity: java.lang.RuntimeException: org.apache.velocity.util.ClassConstructionException: Cannot instantiate class for introspector.cache.classes
java.lang.RuntimeException: org.apache.velocity.util.ClassConstructionException: Cannot instantiate class for introspector.cache.classes
        at com.atlassian.velocity.htmlsafe.introspection.AnnotationBoxingUberspect.init(AnnotationBoxingUberspect.java:59)
        at org.apache.velocity.runtime.RuntimeInstance.initializeIntrospection(RuntimeInstance.java:366)
        at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:255)
        at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:588)
        at org.apache.velocity.app.VelocityEngine.init(VelocityEngine.java:135)
        at com.atlassian.jira.template.velocity.VelocityEngineFactory$Default.initialise(VelocityEngineFactory.java:60)
        at com.atlassian.jira.template.velocity.VelocityEngineFactory$Default.access$000(VelocityEngineFactory.java:22)
        at com.atlassian.jira.template.velocity.VelocityEngineFactory$Default$1.create(VelocityEngineFactory.java:30)
        at com.atlassian.jira.template.velocity.VelocityEngineFactory$Default$1.create(VelocityEngineFactory.java:26)
        at com.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:325)
        at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:143)
        at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112)
        at com.atlassian.jira.template.velocity.VelocityEngineFactory$Default.getEngine(VelocityEngineFactory.java:42)
        ... 28 filtered
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.velocity.util.ClassConstructionException: Cannot instantiate class for introspector.cache.classes
        at org.apache.velocity.util.introspection.IntrospectorBase.<init>(IntrospectorBase.java:81)
        at org.apache.velocity.util.introspection.Introspector.<init>(Introspector.java:65)
        at org.apache.velocity.util.introspection.UberspectImpl.init(UberspectImpl.java:66)
        at com.atlassian.velocity.htmlsafe.introspection.AnnotationBoxingUberspect.init(AnnotationBoxingUberspect.java:55)
        ... 44 more
        at org.apache.velocity.util.ClassUtils.getNewInstance(ClassUtils.java:180)
        at org.apache.velocity.util.introspection.IntrospectorBase.<init>(IntrospectorBase.java:77)
        ... 47 more
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
        at org.apache.velocity.util.ClassUtils.getNewInstance(ClassUtils.java:168)
Caused by: java.lang.NullPointerException
        at com.atlassian.velocity.JiraIntrospectorCache.<init>(JiraIntrospectorCache.java:34)
        ... 53 more
2016-08-11 02:05:34,822 http-nio-8080-exec-1 ERROR      [o.a.c.c.C.[.[localhost].[/].[noopservlet]] Servlet.service() for servlet [noopservlet] in context with path [] threw exception [Exception occurred while rendering template 'templates/jira/appconsistency/jiralocked.vm'.] with root cause
java.lang.NullPointerException
        at org.apache.velocity.util.introspection.UberspectImpl.getMethod(UberspectImpl.java:183)
        at com.atlassian.velocity.htmlsafe.introspection.AnnotationBoxingUberspect.getMethod(AnnotationBoxingUberspect.java:108)
        at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:192)
        at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262)
        at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:342)
        at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
        at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
        at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
        at org.apache.velocity.Template.merge(Template.java:328)
        at org.apache.velocity.Template.merge(Template.java:235)
        at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:381)
        ... 27 filtered
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
2016-08-11 02:05:34,880 http-nio-8080-exec-1 WARN   -   [500ErrorPage.c0e5008d-2695-4c11-9996-c09773971856] Cannot initialize ExtendedSystemInfoUtilsImpl
com.atlassian.jira.util.dbc.Assertions$NullArgumentException: jiraLicenseService should not be null!
        at com.atlassian.jira.util.dbc.Assertions.notNull(Assertions.java:25)
        at com.atlassian.jira.util.system.ExtendedSystemInfoUtilsImpl.<init>(ExtendedSystemInfoUtilsImpl.java:184)
        at com.atlassian.jira.util.system.ExtendedSystemInfoUtilsImpl.<init>(ExtendedSystemInfoUtilsImpl.java:190)
        at com.atlassian.jira.web.servlet.InternalServerErrorHelper.initializeInternalServerErrorDS(InternalServerErrorHelper.java:188)
        at com.atlassian.jira.web.servlet.InternalServerErrorHelper.render500ResponsePage(InternalServerErrorHelper.java:53)
        at com.atlassian.jira.web.servlet.InternalServerErrorServlet.doRequest(InternalServerErrorServlet.java:19)
        at com.atlassian.jira.web.servlet.InternalServerErrorServlet.doGet(InternalServerErrorServlet.java:25)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
        ... 57 filtered
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
2016-08-11 02:05:34,901 http-nio-8080-exec-1 ERROR   -   [o.a.c.c.C.[.[localhost].[/].[internal-error-servlet]] Servlet.service() for servlet internal-error-servlet threw exception
java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key javax.servlet.forward.request_uri
        at java.util.ResourceBundle.getObject(ResourceBundle.java:450)
        at java.util.ResourceBundle.getString(ResourceBundle.java:407)
        at com.atlassian.jira.i18n.BootstrapTranslationStore.get(BootstrapTranslationStore.java:27)
        at com.atlassian.jira.i18n.BackingI18n.getTranslation(BackingI18n.java:254)
        at com.atlassian.jira.i18n.BackingI18n.formatI18nMsg(BackingI18n.java:234)
        at com.atlassian.jira.i18n.BackingI18n.getText(BackingI18n.java:147)
        at com.atlassian.jira.web.util.InternalServerErrorDataSource.translateKeys(InternalServerErrorDataSource.java:267)
        at com.atlassian.jira.web.util.InternalServerErrorDataSource.appendFullMessageData(InternalServerErrorDataSource.java:65)
        at com.atlassian.jira.web.servlet.InternalServerErrorHelper.render500ResponsePage(InternalServerErrorHelper.java:69)
        at com.atlassian.jira.web.servlet.InternalServerErrorServlet.doRequest(InternalServerErrorServlet.java:19)
        at com.atlassian.jira.web.servlet.InternalServerErrorServlet.doGet(InternalServerErrorServlet.java:25)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
        ... 57 filtered
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
2016-08-11 02:05:52,159 http-nio-8080-exec-3 ERROR      [o.a.c.c.C.[.[localhost].[/].[noopservlet]] Servlet.service() for servlet [noopservlet] in context with path [] threw exception [Exception occurred while rendering template 'templates/jira/appconsistency/jiralocked.vm'.] with root cause
java.lang.NullPointerException
        at org.apache.velocity.util.introspection.UberspectImpl.getMethod(UberspectImpl.java:183)
        at com.atlassian.velocity.htmlsafe.introspection.AnnotationBoxingUberspect.getMethod(AnnotationBoxingUberspect.java:108)
        at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:192)
        at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262)
        at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:342)
        at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
        at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
        at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
        at org.apache.velocity.Template.merge(Template.java:328)
        at org.apache.velocity.Template.merge(Template.java:235)
        at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:381)
        ... 27 filtered
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
2016-08-11 02:05:52,165 http-nio-8080-exec-3 WARN   -   [500ErrorPage.646d9bd0-fd29-4f59-a0ca-f3e09d825d23] Cannot initialize ExtendedSystemInfoUtilsImpl
com.atlassian.jira.util.dbc.Assertions$NullArgumentException: jiraLicenseService should not be null!
        at com.atlassian.jira.util.dbc.Assertions.notNull(Assertions.java:25)
        at com.atlassian.jira.util.system.ExtendedSystemInfoUtilsImpl.<init>(ExtendedSystemInfoUtilsImpl.java:184)
        at com.atlassian.jira.util.system.ExtendedSystemInfoUtilsImpl.<init>(ExtendedSystemInfoUtilsImpl.java:190)
        at com.atlassian.jira.web.servlet.InternalServerErrorHelper.initializeInternalServerErrorDS(InternalServerErrorHelper.java:188)
        at com.atlassian.jira.web.servlet.InternalServerErrorHelper.render500ResponsePage(InternalServerErrorHelper.java:53)
        at com.atlassian.jira.web.servlet.InternalServerErrorServlet.doRequest(InternalServerErrorServlet.java:19)
        at com.atlassian.jira.web.servlet.InternalServerErrorServlet.doGet(InternalServerErrorServlet.java:25)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
        ... 57 filtered
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
2016-08-11 02:05:52,172 http-nio-8080-exec-3 ERROR   -   [o.a.c.c.C.[.[localhost].[/].[internal-error-servlet]] Servlet.service() for servlet internal-error-servlet threw exception
java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key javax.servlet.forward.request_uri
        at java.util.ResourceBundle.getObject(ResourceBundle.java:450)
        at java.util.ResourceBundle.getString(ResourceBundle.java:407)
        at com.atlassian.jira.i18n.BootstrapTranslationStore.get(BootstrapTranslationStore.java:27)
        at com.atlassian.jira.i18n.BackingI18n.getTranslation(BackingI18n.java:254)
        at com.atlassian.jira.i18n.BackingI18n.formatI18nMsg(BackingI18n.java:234)
        at com.atlassian.jira.i18n.BackingI18n.getText(BackingI18n.java:147)
        at com.atlassian.jira.web.util.InternalServerErrorDataSource.translateKeys(InternalServerErrorDataSource.java:267)
        at com.atlassian.jira.web.util.InternalServerErrorDataSource.appendFullMessageData(InternalServerErrorDataSource.java:65)
        at com.atlassian.jira.web.servlet.InternalServerErrorHelper.render500ResponsePage(InternalServerErrorHelper.java:69)
        at com.atlassian.jira.web.servlet.InternalServerErrorServlet.doRequest(InternalServerErrorServlet.java:19)
        at com.atlassian.jira.web.servlet.InternalServerErrorServlet.doGet(InternalServerErrorServlet.java:25)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
        ... 57 filtered
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
2016-08-11 02:06:20,542 http-nio-8080-exec-4 ERROR      [o.a.c.c.C.[.[localhost].[/].[noopservlet]] Servlet.service() for servlet [noopservlet] in context with path [] threw exception [Exception occurred while rendering template 'templates/jira/appconsistency/jiralocked.vm'.] with root cause
java.lang.NullPointerException
        at org.apache.velocity.util.introspection.UberspectImpl.getMethod(UberspectImpl.java:183)
        at com.atlassian.velocity.htmlsafe.introspection.AnnotationBoxingUberspect.getMethod(AnnotationBoxingUberspect.java:108)
        at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:192)
        at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262)
        at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:342)
        at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
        at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
        at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
        at org.apache.velocity.Template.merge(Template.java:328)
        at org.apache.velocity.Template.merge(Template.java:235)
        at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:381)
        ... 27 filtered
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)

Please help. How do I resolve the issue and get JIRA working again? 

Many thanks,
Tayyab 

2 answers

1 accepted

5 votes
Accepted answer

Seems you lost permissions for the user you run JIRA as on the filesystem. "java.io.FileNotFoundException: atlassian-jira.log (Permission denied)"

Figure our what user runs Jira

On linux, be root and do:

root@yourjiraserver:~# ps axuwww | grep jira
jira      6475 17.0  4.2 25032332 2813796 ?    Sl   Jul04 9172:38 /usr/java/jdk1.7.0_71/jre//bin/java -Djava.util.logging.config.file=/opt/atlassian/jira.current/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -XX:MaxPermSize=512m -Xms1024m -Xmx6144m -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 -Djavax.net.ssl.keyStore=/opt/atlassian/application-data/jira-prod/cacerts -Djavax.net.ssl.keyStorePassword=changeit -Djavax.net.ssl.trustStore=/opt/atlassian/application-data/jira-prod/cacerts -Djavax.net.ssl.trustStorePassword=changeit -Duser.timezone=Europe/Amsterdam -XX:+PrintGCDateStamps -XX:-OmitStackTraceInFastThrow -Datlassian.plugins.enable.wait=300 -Djava.endorsed.dirs=/opt/atlassian/jira.current/endorsed -classpath /opt/atlassian/jira.current/bin/bootstrap.jar:/opt/atlassian/jira.current/bin/tomcat-juli.jar -Dcatalina.base=/opt/atlassian/jira.current -Dcatalina.home=/opt/atlassian/jira.current -Djava.io.tmpdir=/opt/atlassian/jira.current/temp org.apache.catalina.startup.Bootstrap start

In this line you are looking for 2 key pieces of information. What user runs it, and where is it run:

In the lines above the first word of the response line tells you what user it runs as. In the example case above its user "jira". You also need to know where it runs. In my demo example you see "/opt/atlassian/jira.current" and "/opt/atlassian/application-data/jira-prod". Both of these must be owned by user jira. Make sure they are by doing:

root@yourjiraserver:~# chown -R jira:jira /opt/atlassian/jira.current
root@yourjiraserver:~# chown -R jira:jira /opt/atlassian/application-data/jira-prod

Now restart the application server by:

root@yourjiraserver:~# su - jira
jira@yourjiraserver:~# cd /opt/atlassian/jira.current/bin
jira@yourjiraserver:/opt/atlassian/jira.current/bin/# ./startup.sh && tail -f ../logs/catalina.out

If you don't find the process mentioned, you can always try to locate files that belong to jira, like the dbconfig.xml needed to connect to the database:

root@yourjiraserver:~# locate dbconfig.xml
/home/jira/dbconfig.xml
/opt/atlassian/application-data/jira-prod/dbconfig.xml

The first file is just a backup, expect the production files to be found in /var/ or /opt/.

By the sound of it you must have attempted to start it as the wrong user anyhow.

When I run: ps axuwww | grep jira, it gives me the following:

root@pk-lhr-vm-006:/# ps axuwww | grep jira
jira1    10057  1.2 11.5 2701536 468792 ?      Sl   04:50   0:12 /opt/jira/jre//bin/java -Djava.util.logging.config.file=/opt/jira/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xms256m -Xmx1024m -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:+PrintGCDateStamps -XX:+PrintGCTimeStamps -verbose:gc -Xloggc:/var/application-data/jira/log/atlassian-jira-gc-2016-08-11_0450.log -XX:+PrintGCDateStamps -XX:-OmitStackTraceInFastThrow -Djava.endorsed.dirs=/opt/jira/endorsed -classpath /opt/jira/bin/bootstrap.jar:/opt/jira/bin/tomcat-juli.jar -Dcatalina.base=/opt/jira -Dcatalina.home=/opt/jira -Djava.io.tmpdir=/opt/jira/temp org.apache.catalina.startup.Bootstrap start
root     10138  0.0  0.0   7840   880 pts/4    S+   05:07   0:00 grep jira

Like your demo example, my first would be /opt/jira right? 
But I can't match with the second path? What would be the second?

And also you mentioned that the jira1 user should have the permission for both these locations. 
So in the example you mentioned, 

root@yourjiraserver:~# chown -R jira:jira /opt/atlassian/jira.current
what is the second parameter in "jira:jira", is it the password?

could you also tell how to check about the current ownership? Like who is the current owner of each dirs? 

When I try to run 'service JIRA start' it also mentions this at the end

touch: cannot touch `/opt/jira/logs/catalina.out': Permission denied
./catalina.sh: 404: ./catalina.sh: cannot create /opt/jira/logs/catalina.out: Permission denied

In addition to the solution provided above. 
I also deleted the /opt/jira/logs/.jira-home.lock file 
See this: https://confluence.atlassian.com/pages/viewpage.action?pageId=223220062

 

Indeed. the first line is the one you are looking for.

Your users is: jira1

Path1: /opt/jira/

Path2: /var/application-data/jira/

No the second "jira" is the group membership, so most likely the JIRA group will be jira1 too.

You can verify this by doing a:

cat /etc/group | grep -i "jira1"

If you see a result, thats the group.

To verify who owns the files right now, do a:

ls -alh /opt/jira/

Results will look like this:

root@yourservername:~# ls -alh /opt/atlassian/jira.current/
total 236K
drwxr-xr-x 13 jira atlassian 4.0K Feb 27  2015 .
drwxr-xr-x 13 root root      4.0K Jul 26 09:14 ..
drwxr-xr-x 17 jira atlassian 4.0K Mar 24  2014 atlassian-jira
drwxr-xr-x  4 jira atlassian 4.0K Apr 13 14:45 bin
drwxr-xr-x  3 jira atlassian 4.0K Oct 28  2014 conf
drwxr-xr-x  2 jira atlassian   39 Mar 24  2014 external-source
drwxr-xr-x  2 jira atlassian 4.0K Mar 24  2014 lib
..
and so forth

Dont mind the directory ".." as this is the parent directory, but for the rest of them you see "jira"(user) and "atlassian" (the group i use on this test server)

so to change ownership in your case you would do:

chown -R jira1:jira1 /opt/jira
chown -R jira1:jira1 /var/application-data/jira

Before you do anything that can be seen as destructive i suggest you do a:

#does a recursive ls with full rights and pipes the results to a file.
ls -alhR /opt/jira/ > ~/original.file.owners.txt
#same thing for second dir, but >> will make it append instead of overwriting the file.
ls -alhR /var/application-data/jira >> ~/original.file.owners.txt

 

 

 

 

Deleting the file above should be done by automatic if startup.sh detects it, but don't see a running PID, so no need to do this manually as long as the files are owned by the right user.

Hope this helps, let me know if you are missing something.

Getting any closer on this? Can i do something else?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted 14 hours ago in Jira Service Desk

Looking for anyone who has switched from Zendesk to Jira Service Desk

Hi Community! The Jira Service Desk marketing team is looking for customers who have successfully switched from Zendesk to Jira Service Desk!   We’d love to hear your thoughts on the pros and ...

18 views 0 1
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you