Unable to attach files to issues in Jira

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

When attempting to attach a file to an issue in Jira, the message "Failed to attach files" is displayed in the screen and "Unable to create target directory" is displayed in the logs.

This may happen for all projects or just a few projects in Jira.

Environment

All versions of Jira Core 8.x.

Diagnosis

  • Any user (admins and nom-admins) is unable to attach files to issues in some projects.

  • The projects and users are correctly configured and allowed to create attachments as described in Configuring file attachments.

  • In atlassian-jira.log a message of "Unable to create target directory" is displayed:

    1 2021-12-14 10:01:26,513 http-nio-8091-exec-16 url: /rest/jddap/1.0/attachment; user: redacted-username WARN redacted-username redacted-request-id redacted-session-id redacted-ip,0:0:0:0:0:0:0:1 /rest/jddap/1.0/attachment [c.a.j.issue.managers.DefaultAttachmentManager] Got exception while saving attachment in attachment store. Exception: Unable to create target directory /opt/novapps/atl/app_data/jira/data/attachments/PROJECTKEY/40000/PROJECTKEY-99999

    In which PROJECTKEY-99999 is the issue that attachments were tried to be added to.

Cause

The cause for this problem is a missing permission on the filesystem to the Jira application user. It's unable to create folders in the attachments directory under Jira's home.

This is likely a result of some manual intervention in the filesystem (copying folders, creating folders with another username, etc) or something else that limited the application user access to the folders.

Solution

We should make sure the Jira application user has full Read & Write access to all directory structure in Jira Home and Jira Install Directories — recursively.

In Linux machines, we may re-run the commands shared in Installing Jira Applications:

1 2 $ chown -R jira <jira-home-directory> $ chmod -R u=rwx,go-rwx <jira-home-directory>

The example is for username "jira". Change it to the respective username executing the Jira process.

Try attaching files to the same issues after fixing the directories ownership and permissions.

Updated on April 24, 2025

Still need help?

The Atlassian Community is here for you.