Uploading PDF file causes 'Stop reading corrupt stream.' messages in the logs
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
Problem
Confluence may crash eventually due to running out of memory.
The following appears multiple times in the
atlassian-confluence.log
:
1
ERROR [scheduler_Worker-2] [apache.pdfbox.filter.FlateFilter] decode Stop reading corrupt stream.
Cause
Most probably this PDFBox bug is causing the issue: https://issues.apache.org/jira/browse/PDFBOX-847. The result is in most cases having the Confluence instance running out of memory.
Workaround
Shut down Confluence
Remove pdfbox-x.x.x.jar from <CONFLUENCE-INSTALLATION-DIRECTORY>/confluence/WEB-INF/lib
Download version 1.7.1 from Apache's site: http://pdfbox.apache.org/download.html
Place the downloaded .jar file to <CONFLUENCE-INSTALLATION-DIRECTORY>/confluence/WEB-INF/lib
Start Confluence
Resolution
Upgrade to Confluence 4.3.7 or later which is now shipped with PDFBox version 1.7.1. Related bug report can be found here: CONFSERVER-27115 - Upgrade PDFBox to 1.7.1
Was this helpful?