Exporting a page to PDF fails with "Failure while rendering the /templates/extra/pdfexport/completeexport.vm"
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
When exporting a Confluence page to PDF, the export process fails with the error "Failure while rendering the /templates/extra/pdfexport/completeexport.vm".
Environment
Applies to all Confluence versions.
Diagnosis
The following error will show up on the UI after trying to export a Confluence page to PDF:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
System Error
A system error has occurred - our apologies!
For immediate troubleshooting, consult our knowledge base for a solution.
If you would like to receive support from Atlassian's support team, ask your Confluence administrator to create a support issue on Atlassian's support system with the following information:
a description of your problem and what you were doing at the time it occurred
a copy of the error and system information found below
a copy of the application logs (if possible).
Your Confluence administrator can use the support request form to create a support ticket which will include this information.
We will respond as promptly as possible.
Thank you!
Return to site homepage…
Cause
com.atlassian.confluence.importexport.ImportExportException: Failure while rendering the /templates/extra/pdfexport/completeexport.vm
Failure while rendering the /templates/extra/pdfexport/completeexport.vm
Invocation of method 'getResources' in class com.atlassian.confluence.extra.flyingpdf.impl.PdfResourceManager threw exception java.util.ConcurrentModificationException at /templates/extra/pdfexport/completeexport.vm[line 7, column 30]
Referer URL
https://<baseURL>/pages/viewpage.action?pageId=<pageid>
Cause
Corrupted plugin cache.
Solution
We need to clear Confluence’s plugin cache to eliminate any corrupted data that may exist there. To do that, first follow the steps below, which can be also found on article How to clear Confluence plugins cache :
Shutdown Confluence
Ensure the user running Confluence has full read/write privileges to the confluence-home directory.
Remove the following directories
⚠️ This will remove the plugin cache files only and will not permanently remove any plugins. These directories will be recreated during the next Confluence startup. However, some third-party plugins may store metadata in these directories, so we recommend creating a temporary backup of the directories.
/data/confluence-home/bundled-plugins
/data/confluence-home/plugins-cache
/data/confluence-home/plugins-osgi-cache
/data/confluence-home/plugins-temp
Restart Confluence
After that, try to perform another export with DEBUG level enabled for the classes below. To make sure we have more granular data collected in case the issue happens again
Navigate to the
> General Configuration > Logging and Profiling in the 'Administration' section of the left-hand panel.
Set the below class to DEBUG:
1 2
com.atlassian.confluence.extra.flyingpdf com.atlassian.confluence.impl.util.sandbox
Attempt the PDF export again for the page.
If the export is successful, remove the classes added in step 1 above on DEBUG level. This is to avoid verbose messages unnecessarily filling Confluence logs.
If you observe the same issue again, generate a support zip, save the storage format of the page, and contact Atlassian support.
Was this helpful?