Error Occurs while Creating Attachment

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

Symptoms

The following error show in the logs when attaching a file to an issue:

1 2 3 2009-11-23 10:15:37,371 TP-Processor94 ERROR [jira.issue.fields.AttachmentSystemField] Error occurred while creating attachment. com.atlassian.jira.web.util.AttachmentException: Cannot write to attachment directory. Check that the application server and JIRA have permissions to write to: /usr/local/jira/attachments/NOV/NOV-83753 at com.atlassian.jira.util.AttachmentUtils.checkValidAttachmentDirectory(AttachmentUtils.java:109)

Cause

Linux's ext3 file-system has a limitation of 32000 maximum sub-folders per folder. JIRA creates a sub-folder for each issue that has a file attachment. When running JIRA with this file-system, the system hits the maximum number of sub-folders and the above error is thrown.

Workaround

  1. Create a sym link for some of the attachments

  2. Delete attachments

Resolution

The current solution is to change the file-system to ext4.

Updated on April 15, 2025

Still need help?

The Atlassian Community is here for you.