jira installed on linux cannot create jira.home directory

parisordi May 17, 2017

I have installed jira on my remote vps running ubuntu server, and when I visit the jira url, i get the following:

Could not create jira.home directory '/var/atlassian/application-data/jira'. Please see Setting your JIRA Home Directory for more information on how to set up your JIRA home directory.

i have installed it as root.

root@myvpsip:/var/atlassian/application-data# ls -lh
total 4.0K
drwxr-xr-x 2 root root 4.0K May 17 22:29 jira


could somebody help me solve this?

3 answers

3 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 18, 2020

Hi everyone,

Just wanted to provide an updated answer here.  First we never recommend running Jira as the root user.  It tends to be bad security practice to do so.  Instead throughout our documentation we suggest that you create a dedicated user account (usually called jira) as use that account to start the application itself.

Once you have done that, there are steps you can follow in How to fix directory permissions in Linux for Jira Server.  Those steps will make sure that this jira user is the owner of all the necessary files needed to start up correctly.

Cheers,

Andy

Yevgen Lasman
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.
June 25, 2020

@Andy Heinzer one of our customer faced the same problem running your official docker image — application starts but immediately fails with the error that it can't write to its home folder. This is not true, because in docker image there is nothing in the home folder while after starting the image it is being populated with standard sub-folders: caches, logs, plugins etc.

However, the only folder which Jira cannot create is the $JIRA_HOME/logs folder. That's the one it cannot create and that's the one failing the startup process. So far we didn't find the way around this problem but it is certainly present in 7.13.11

Dave Chevell
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 25, 2020

Hi @Yevgen Lasman ! 

How are you starting the image, and how are you mounting an external location for $JIRA_HOME ? The container runs under the user jira with UID/GID 2001:2001. Your external storage needs to have the appropriate permissions so that this user account can read, write and execute files in this location.

I've performed some quick tests with atlassian/jira-software:7.13.11 and I can't reproduce the issue you're describing, which tells me there's something specific to your environment that is resulting in the permissions for the external location of $JIRA_HOME being incorrect.

One option is to leverage Docker's user namespace remapping to remap the container's UID/GID to a different UID/GID on the host system, which would correspond to the existing permissions of the storage location. You can find a note about this on our Docker Hub repo, under the "Shared directory and user IDs" section: https://hub.docker.com/r/atlassian/jira-software 

Depending on your setup you may be able to chown or chmod the location of $JIRA_HOME using the UID/GID directly, both of these commands accept UID/GID's in place of names. 

Take a look at the above and let me know how you go!

Cheers,

Dave

Yevgen Lasman
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.
June 25, 2020

@Dave Chevell this isn't my environment, just helping one of our customers to troubleshoot thus I don't have a full control over the process. After all they tried to run the same image on the local machine and it worked, thus problem lies in their docker/ECS settings. I'm pretty sure (cuz they're exporting volumes for some $JIRA_HOME folders) it is about volume export settings and/or docker limitation about which paths are allowed to be accessed by docker.

1 vote
AnnWorley
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 17, 2017

This customer opened up the permissions with chmod 777 - please try that, you can always lock the directory down later:

Could not create jira.home directory

Disk space is also mentioned as a possible issue, so you will want to rule that out.

1 vote
edwin
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.
May 17, 2017

It's because jira is running as "jira" user so they don't have permission to create a directory because it's owned by root. You'll have to change the user that is running jira or change ownership of the home directory to be owned by jira.

Suggest an answer

Log in or Sign up to answer