How to fix directory permissions in Linux for Jira Server

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.

Problem 

On many occasions, JIRA is not able to run properly due to file or directory permission error

Errors in the logs will vary, for example an error like this may show in the logs:

JIRA couldn't create the jira.home directory


Solution

There are two options to fix the issue.

Option 1: (Preferred)

Fix the permissions on a case by case basis

  1. You will first need to find out the user who installed JIRA. There are 3 methods to do this :

    1. From The System Info page on your JIRA instance :


    2. From the Support Zip ( application.xml file ) search for <JIRA_USER>

    3. From the $JIRA_HOME/log/atlassian-jira.log, search for 'user.name'

  2. You will also need to know the group the user belongs to run JIRA and most of the time the group name is the same as the username that runs JIRA.  

    If you're unsure of what these permissions should be, please consult with your System Administrator and the user who installed JIRA.

    If you are the user who installed Jira, you can see these details by running these commands:

    	whoami (this will tell your exact username)
    	id -g -n (this will tell your group name)
  3. Next, depending on the actual path in the error, execute the 2 lines below to fix the permission of the JIRA Home & Installation directory

    sudo chown -R jirauser:jiragroup /path/referenced/in/the/error
    sudo chmod -R u=rwx,g=rx,o=rx /path/referenced/in/the/error

    You may also want to create particular directories manually instead of granting the access on the upper directories, i.e.:

    mkdir -p /path/referenced/in/the/error

    Substitute Jira with the correct user that installed JIRA and the path with the correct path to the respective directory 

  4. Restart JIRA and check the logs ($JIRA_INST/logs/catalina.out), $JIRA_HOME/logs/atlassian-jira.log) for any other permission denied errors and repeat steps 3 and 4 above until Jira is fully operational

Option 2: 

Disclaimer: The following steps suggest to fix the permissions on all Jira sub directories at once. While this approach is the quickest to fix the issue, modifying the permissions on all Jira directories is not recommended as it can potentially make the Jira server vulnerable to remote code execution attacks (see https://confluence.atlassian.com/jira/security-addendum-2010-04-16-preventing-security-attacks-216433277.html for details)


  1. Follow Steps 1 to 2 to identify the user running Jira
  2. Next, execute the following commands to fix the permissions on all Jira folders:

    sudo chown -R jirauser:jiragroup /path/to/jirahome
    sudo chown -R jirauser:jiragroup /path/to/jirainstall
    
    chmod -R u=rwx,g=rx,o=rx /path/to/jirahome
    chmod -R u=rwx,g=rx,o=rx /path/to/jirainstall




Caveat 

Jira might still fail to start even if the permissions are correct after running the commands to fix the permission of the JIRA Home & Installation directory.

The following error will be present:

Setup: JIRA couldn't create the jira.home directory
Ensure JIRA has permission to create and write to the jira.home directory /jira-home.
Review our documentation for more information on setting your JIRA home.

Solution

This can be caused by a symbolic link hidden in the JIRA Home directory.

Follow the Resolution in Symbolic Link in JIRA Home during upgrading using Installer will throw 'java.lang.OutOfMemoryError: GC overhead limit exceeded'.

DescriptionOn many occasions, JIRA is not able to run properly due to file or directory permission error
ProductJira
PlatformServer
Last modified on Dec 14, 2020

Was this helpful?

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