Exporting a Confluence page or space as PDF errors out with "We couldn't complete your export. There are too many concurrent exports running on this node"
Platform Notice: Data Center Only - This article only applies to Atlassian products on the data center platform.
PDF export errors out with the following error message "We couldn't complete your export. There are too many concurrent exports running on this node":
PDF export is a heavy task that may impact the application performance and even lead it to an outage. To prevent this, we limited the threads for this task to the number of CPU cores available in the server hosting Confluence. If you see this error message, this means that you hit this limit, waiting for the previous exports to complete will release the threads to be used by new export requests.
In this KB, we mention a problem that may happen where the threads are not being released after finishing the PDF export and only a restart will help. This problem may affect only one node and restarting it will release the threads.
This problem was identified in Confluence Data Center version 7.3.5. It could also affect other versions of Confluence.
Aside from the error in the UI, you may find the following error in the
2021-02-23 13:32:12,575 ERROR [http-nio-8090-exec-62] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action -- url: /spaces/flyingpdf/pdfpageexport.action | traceId: 23ab1ca609f89aee | userName: test | referer: https://confluence.pdftest/display/pdftest/PDF+TEST java.lang.RuntimeException: We couldn't complete your export. There are too many concurrent exports running on this node
If you generate thread dumps, you may identify the following PDF export thread:
"http-nio-8090-exec-28" #3231 daemon prio=5 os_prio=0 tid=0x00007fd32c2ce800 nid=0x2c05 runnable [0x00007fd27ebe1000] java.lang.Thread.State: RUNNABLE ... at com.atlassian.confluence.extra.flyingpdf.impl.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:107) at com.atlassian.confluence.extra.flyingpdf.impl.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:75) at com.atlassian.confluence.extra.flyingpdf.impl.InternalPdfExporterService.doCreatePdfForPage(InternalPdfExporterService.java:132) at com.atlassian.confluence.extra.flyingpdf.impl.InternalPdfExporterService.createPdfForPage(InternalPdfExporterService.java:100) at com.atlassian.confluence.extra.flyingpdf.impl.DelegatingPdfExporterService.createPdfForPage(DelegatingPdfExporterService.java:54) at com.atlassian.confluence.extra.flyingpdf.impl.DiagnosticPdfExporterService.createPdfForPage(DiagnosticPdfExporterService.java:88) at com.atlassian.confluence.extra.flyingpdf.impl.ExportPageAsPdfAction.doExecute(ExportPageAsPdfAction.java:36) at com.atlassian.confluence.extra.flyingpdf.impl.ExportPageAsPdfAction$$Lambda$2405/1155088221.run(Unknown Source) at com.atlassian.confluence.extra.flyingpdf.impl.PdfExportSemaphore.run(PdfExportSemaphore.java:28) at com.atlassian.confluence.extra.flyingpdf.impl.ExportPageAsPdfAction.execute(ExportPageAsPdfAction.java:29)
If you hit the error in the node and no further PDF export attempts can be made (after waiting for minutes/hours), check the thread dumps and look if you have the same number of threads running as per CPU cores. If it's the same and restarting the node helps but the issue eventually happens again, then this KB should be considered.
The root cause is unknown at the moment, the threads are running indefinitely after we reach the maximum allowed threads for this task.
If a root cause is identified, it will be added to this article.
Java handles these threads and we recommend keeping Java updated. Check our Supported Platforms page to verify which Java version is supported.
You may download either AdoptOpenJDK or Oracle Java with the links below:
If you installed Confluence using the installer option, you may either upgrade Confluence or install Java on the server and change the one used by Confluence (bundled) to the system java.