Attempting to Download all Attachments Displays a Not Found 404

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

Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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

Using the Download All Attachments functionality displays a Not Found (404) with the error "Could not create zip file for issue", as in the below screen shot:

The following appears in the atlassian-jira.log:

2013-01-11 10:44:29,353 http-bio-60524-exec-12 ERROR admin 644x508x1 12ast9r 172.22.2.187 /secure/attachmentzip/11700.zip [jira.web.servlet.AttachmentZipServlet] Can not create temporary zip file : /11700.zip: /var/atlassian/application-data/jira/data/attachments/LLAMA/LLAMA-31/10502 (No such file or directory)
java.io.FileNotFoundException: /var/atlassian/application-data/jira/data/attachments/LLAMA/LLAMA-31/10502 (No such file or directory)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at com.atlassian.jira.issue.attachment.AttachmentZipFileCreator.toZipFile(AttachmentZipFileCreator.java:68)
	at com.atlassian.jira.web.servlet.AttachmentZipServlet.createAttachmentsZipFile(AttachmentZipServlet.java:274)

Cause

One or more of the attachments is missing from the file system. The missing attachment(s) can be identified from the stack trace in atlassian-jira.log. In the above example, this is /var/atlassian/application-data/jira/data/attachments/LLAMA/LLAMA-31/10502.

Resolution

This can be resolved by either adding the attachment back on to the filesystem or deleting the reference to it within the JIRA GUI. The problematic attachment can be identified with either of the following methods:

Identifying it with the URL
  1. Access the JIRA Issue.
  2. Mouse over the attachments. The URL of the attachment will contain the ID. For example:
  3. The server.xml URL is http://optimus-prime:60524/jira524/secure/attachment/10502/server.xml which matches the ID of the missing attachment (10502).
  4. Delete the attachment using the trashcan icon.
Querying the Database
  1. Execute the below query against the database, replacing the pkey with the Issue Key of the problematic issue.

    JIRA 6.0 and below
    select a.id, a.filename from fileattachment a join jiraissue i on i.id = a.issueid where pkey = 'LLAMA-31';
    JIRA 6.1 and above
    select a.id, a.filename from fileattachment a join jiraissue i on i.id = a.issueid where i.id = (select j.id from project p,jiraissue j where p.id=j.project and j.issuenum=<ISSUENUMBER> and p.pkey='<PROJECTKEY>'); 

    (info) Replace the <ISSUENUMBER> and <PROJECTKEY> with there respective values
    (warning) This SQL syntax may need to be modified depending upon the DBMS used.

  2. Identify the filename by matching it to the id. In this example, the problematic file is server.xml as it has the id 10502.

    10500;"jar_jar_elbow_justice.jpg"
    10501;"Unicorn-fantasy-30995379-1280-1024.jpg"
    10502;"server.xml"
  3. Delete the attachment using the trashcan icon on the View Issue screen.

Last modified on Mar 18, 2025

Was this helpful?

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