How to fix broken PDF preview thumbnail?

Emmanouil Lazarides March 21, 2021

Here's the situation:

When a PDF file is uploaded to Confluence Server using using the 'Insert files and images' tool in edit mode, the normal outcome is a thumbnail preview of the PDF on the page.

However, this may fail using Confluence Server out of the box because of insufficient memory allocated to Java. Failure results in a placeholder being shown where normally one would see the PDF preview.

This post presumes that the memory allocation problem has already been solved. Now uploaded PDFs preview normally. However, a PDF that has previously failed to be processed for the preview will continue to be shown with the placeholder icon, even when it is removed from the page and reattached.

In testing, we've even gone so far as to restart the server after removing the file, changing the file name, and then attaching it to a different page. Still it appears with the placeholder icon first allocated to it when its thumbnail processing failed.

So, how does Confluence Server recognise the file is one that it has seen before, and how can thumbnail processing be forced? For example, is there a specific hook in the database that needs to be removed?

1 answer

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 31, 2021

I am not sure of how Confluence actually handles the previews, but I do know it litters your installation with thumbnail previews, and I think (but I am not sure) that the thumbnails are done by page, not by file.  So I suspect your page is creating a thumbnail, then when you change things, it's just falling back on the one it has cached!

I don't have an active server (with attachments) to hand, so I can't confirm where I see these, but I suspect you might be able to fix this by moving the files (or, better, only the offending ones that need regeneration) from <confluence home>/thumbnails

Note that this is not a directory that we include in backups when we're trying to take faster ones - Confluence does not strictly need the files in there to work, but it will be a bit slower if it has to regenerate them when pages need them.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.10.2
TAGS
AUG Leaders

Atlassian Community Events