Jira server throws Unable to create directory for deployment error on startup

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: サーバーと Data Center のみ。この記事は、サーバーおよび Data Center プラットフォームのアトラシアン製品にのみ適用されます。

問題

JIRA may throw different errors due to this - the common cause is it is not operating as expected.

catalina.out に次のメッセージが表示される。

Aug 07, 2013 2:02:36 AM org.apache.catalina.startup.HostConfig start
SEVERE: Unable to create directory for deployment: /opt/atlassian/jira/conf/Catalina/localhost

原因

The Tomcat process is not able to access the scratchDir or deployment directory, most likely due to file permissions. The scratchDir is used by Tomcat when compiling JSPs which is the technology used to render the dynamically created web pages in JIRA applications. If Tomcat cannot access that directory it can result in failures to properly operate.

ソリューション

Option 1 (preferred):

ケースバイケースで権限を修正します。

  1. Stop the Jira application (not required if Jira runs in docker in Docker)

  2. Create the directory referenced in the error:

    LINUX: 		mkdir -p $JIRA_INSTALL/conf/Catalina/localhost
    
    WINDOWS: 	mkdir $JIRA_INSTALL\conf\Catalina\localhost
  3. Fix the permissions for the newly created directory:

    Expand for Linux instructions...

    These instructions refer to the default user, group & installation paths for JIRA applications, as if it were installed using the bundled installer. If you're unsure of what these permissions should be, please consult with your System Administrator and the user who installed JIRA applications.

    sudo chown -R jira:jira $JIRA_INSTALL/conf/Catalina/localhost
  4. Remove the following directory:

    $JIRA_INSTALL/work/*

    (info) This will be rebuilt when your JIRA application is restarted.

  5. Start the Jira application (or restart the docker container)
  6. Check the Jira's logs ($JIRA_INST/logs/catalina*, $JIRA_HOME/logs/atlassian-jira.log) for 'permission denied' errors - if there are any, repeat the above steps for the folders in questions only


オプション 2:

Disclaimer: The following steps suggest to fix the permissions on all Jira sub directories at once. While the below steps will be 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. Stop your JIRA application (not required if Jira runs in Docker)

  2. Fix the permissions for the below directories and all of their subdirectories:

    $JIRA_HOME/
    $JIRA_INSTALL/
    Expand for Linux instructions...

    These instructions refer to the default user, group & installation paths for JIRA applications, as if it were installed using the bundled installer. If you're unsure of what these permissions should be, please consult with your System Administrator and the user who installed JIRA applications.

    sudo chown -R jira:jira /var/atlassian/application-data/jira
    sudo chown -R jira:jira /opt/atlassian/jira/
  3. Remove the following directory:

    $JIRA_INSTALL/work

    (info) This will be rebuilt when your JIRA application is restarted.

  4. Start the application (or restart the Jira's docker container if Jira runs in Docker)


オプション 3:

If you are using mapped network drives for Jira's backup directory, attachments directory, index directory, or the %CATALINA_HOME%\‌* directory, you need to ensure that Jira can write to these drives. That is, these directories all need to be writeable by the user which the Jira service is running as. This may mean that you need to change the Windows user that the Jira server uses (see Changing the Windows user that the Jira service uses for more information).


(info) Note that you must also specify these network drives by UNC and not letter mappings, e.g. \\backupserver\jira not z:\jira

  1. To change the Windows user that the Jira service uses, navigate to the service in Windows, i.e. 'Control Panel' -> 'Administrative Tools' -> 'Services'. Locate the 'Atlassian Jira' service, right-click and view the 'Preferences'.

Windows のサービス。

2. Go to the 'Log On' tab and change the user as desired.

最終更新日: 2022 年 10 月 17 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.