PDF export hangs in Confluence when external image URL destination is not accessible
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
Summary
When exporting a page to PDF, the export process may hang up to 16 minutes before completing the export.
Environment
Confluence 7.13.2, 7.13.5
Diagnosis
It's possible to replicate the problem by following the steps below:
- Create a page in Confluence
- Add image URL links to the page, and ensure the URLs are not reachable from Confluence
- From the ellipsis menu, choose "Export to PDF"
Cause
This occurs because of a stuck thread in the export process that hangs due to an inaccessible image link. If multiple exports are triggered at the same time, it can lead to significant performance degradation. This problem was filled as a bug in Confluence and can be followed at CONFSERVER-60591 - Getting issue details... STATUS
The following error will appear in the atlassian-confluence.log file:
ERROR [http-nio-8090-exec-1] [extra.flyingpdf.impl.ConfluenceExportUserAgent] log Can't get image resource for urihttps://<confluence_hostname>/download/attachments/123456789/image_title.png?&api=v2, error: Unknown image format
Solution
Remove the bad image link URLs and retry the PDF export