Problems to preview attachments in Confluence, Error rendering macro 'view-file'
Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.
Attachments aren't displayed on the page and preview isn't working. Using the View File macro may error out with
Error rendering macro 'view-file':
This problem was identified in Confluence server and datacenter version 7.11.0 but, due to the nature of the problem, it can affect most versions of Confluence.
Attachments can't be previewed and aren't displayed on pages. It's possible to find more about the problem by analyzing the file
atlassian-confluence.log and looking for the following errors:
com.atlassian.confluence.pages.AttachmentDataNotFoundException: Problem while getting attachment stream
ERROR [http-nio-8090-exec-16] [[Standalone].[localhost].[/].[noop]] log Servlet.service() for servlet [noop] in context with path  threw exception java.io.FileNotFoundException: /data/confluence/sharedhome/dcl-thumbnail/11/11/44536111/118956102_8 (Permission denied)
WARN [http-nio-8090-exec-4] [atlassian.confluence.pages.DefaultAttachmentManager] getAttachmentData Could not find data for attachment: Attachment: filename test - java.io.FileNotFoundException: /data/confluence/sharedhome/attachments/ver003/111/111/45383611/11/11/44536111/118956111/1 (Permission denied)
The root cause reported in this KB is related to Permission denied to the folder where the attachments reside as seen in the aforementioned errors. By not having the correct permissions, Confluence won't be able to retrieve the attachment from the file system to be displayed in its UI.
It's also possible that the attachments are actually missing from the file system. In this case, refer to How to resolve missing attachments in Confluence.
File system permissions depend on the operational system, we recommend following How to set file system permissions for Confluence to resolve this problem.