Attachment Preview is not Working
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
Problem
When any user access any page with a file (.doc, .xlsx, .pdf, etc.) attached to it and click on the file, nothing happens, however, if the user tries to download the file, the operation happens succesfully. Confluence was supposed to render a preview of the attached document instead, like can be seen in the image below:

Diagnosis
It is important to ensure that the problem is happening to all files attached to the application, regardless of the page/space they are attached to. In order to confirm this, create a test space with a test page and attach a test file to it. In case the file renders properly, this may not be the right knowledge base for you and it is recommended to take a look on the Attachments Troubleshooting to continue the investigation.
In case you have been able to reproduce the problem once again, then you came to the right place.
Cause
This problem happens because one or more application modules accountable for rendering file previews has been disabled. The modules are related to below plugins:
Confluence File Notifications
Confluence Files
As Confluence restful calls used to render the files does not work without some modules made available through above plugins, the files are not rendered. To confirm that this is indeed the problem, you can grep the application logs for entries similar to the ones below:
1
2
3
2018-03-12 15:00:14,723 INFO [http-nio-443-exec-2] [atlassian.plugin.manager.DefaultPluginManager] broadcastPluginDisabling Disabling com.atlassian.confluence.plugins.confluence-file-notifications
2018-03-12 15:00:14,773 INFO [http-nio-443-exec-2] [atlassian.plugin.manager.DefaultPluginManager] broadcastPluginDisabling Disabling com.atlassian.confluence.plugins.confluence-files
And in parallel to that, you may want to capture a .HAR File and observe the response given by the application to restful calls - It should be a 404 since the plugins are disabled:

Solution
Workaround
Login to Confluence as an administrator.
Click on the Cog Icon in your right upper corner and then select add-ons.
Select all add-ons and search by confluence file and confluence-files This should bring both add-ons to the screen.
Ensure that both are enabled by clicking on the Enable button accordingly.
Shutdown Confluence.
How to clear the apps (plugins) cache in Confluence Data Center.
Restart the application.
Try to preview files again, it should work fine this time.
Resolution
As the root cause of why the plugins have been disabled is not clear at this point, there's not a definitive resolution yet, but workarounds only.
One possibility is this bug: CONFSERVER-58313
Was this helpful?