Immediatly after uploading an attachment to a Confluence page, the file cannot be found
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
After uploading an attachment to a page in Confluence, an Attachment file not found message is displayed.

Environment
Confluence Server
Antivirus Software installed in the same server
Diagnosis
During the upload action, the attachment is stored in a temporary directory, in <confluence_home>/temp.
When this error occur, the following log message is displayed in the application logs:
atlassian-confluence.log
1
2
3
2020-05-11 14:16:42,553 ERROR [http-nio-8090-exec-4] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action
-- url: /pages/plugins/attachments/doattachfile.action | traceId: e795e942b0941f99 | userName: <username> | referer: https://confluence.domain.com/display/DRA/Page+Example
java.lang.RuntimeException: Error opening input stream from resource: UploadedResource[filename: 'PDF_File.pdf', file: '/opt/atlassian/confluence/data/temp/upload_ece72ceb_bed5_4a76_b6ca_aec233b9e6fa_00000001.tmp']
Soon after that, Confluence tries to move the attachment from the temporary folder to the attachments folder. However, a FileNotFoundExeption appears in the logs:
atlassian-confluence.log
1
2
2020-05-11 14:17:01,253 WARN [http-nio-8090-exec-4] [atlassian.confluence.pages.DefaultAttachmentManager] getAttachmentData Could not find data for attachment: Attachment: PDF_File.pdf v.1 (104890369) <username> - java.io.FileNotFoundException: /opt/atlassian/confluence/data/attachments/ver003/170/212/1212420/151/129/102629401/104890369/1 (Operation not permitted)
-- referer: https://confluence.domain.com/display/DRA/Page+Example | url: /download/attachments/102629401/PDF_File.pdf | traceId: 74b7f6bd028228b5 | userName: <username>
Cause
The Antivirus software is set up to scan <confluence_home> folder. That ends up interfering with the file upload to the server.
Solution
The Antivirus software must be configured to ignore the Confluence home directory, its index directory, and any database-related directories, as recommended in the following KB article: Using Antivirus software with Confluence on Windows. Note that this instruction applies to all operating systems, not only Windows.
Was this helpful?