Exporting pages to PDF with a backslash in the page name causes a HTTP Status 400 error

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Low
    • 7.0.3
    • Affects Version/s: 6.12.1
    • Component/s: Page - Export / Import
    • None
    • 1
    • Severity 3 - Minor

      Issue Summary

      • Backslash ( \ ) characters in page names cause the PDF page exports to fail with 'HTTP Status 400 - Bad Request', due to the PDF file naming conventions
      • Problem only affects Data Center installations
      • The PDF is actually created in <confluence_home>/temp/ but is not presented to the user ('HTTP Status 400' occurs)

      Environment

      Confluence 6.12.x Data Center and onwards

      Server versions are unaffected.

      Steps to Reproduce

      1. Install & login to Confluence Data Center (Any version from 6.12 onwards)
      2. Create a page with a backslash character in the page name
      3. Click the ellipsis (...) and choose 'Export to PDF'

      Expected Results

      The page should be converted to PDF and the PDF download presented to the user.

      Actual Results

      The PDF is generated in <confluence_home>/temp/ but the browser will display HTTP Status 400.  

       

      HTTP Status 400 – Bad Request
      Type          Status Report
      Message       Invalid URI
      Description   The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).Apache Tomcat/9.0.22
      

       

      Notes

      • In Confluence Server, the filename format is
        <spacekey>-<pagename_minus_spaces>-ddmmyy-hhmm-*.pdf
        

        However, if special characters exist in the page name (such as %, \, /, $, &, %, :, ?) the PDF filename format changes to:

        <spacekey>-<pageid>-ddmmyy-hhmm-*.pdf
      • In Confluence Data Center, this also appears to be true, but the expected naming for special page name characters changes from Confluence Data Center 6.12 onwards due to a change in Confluence 6.12 DC where PDF exports now get handled by the external process pool (sandbox).  6.12 Release Notes have further details.

      Workaround

      There are currently 2 ways to workaround this problem:

      Workaround #1:

      1. Change the backslash () in the page name to another character (eg. / )

      or

      Workaround #2:

      1. Disable the PDF export sandbox with the following CATALINA_OPTS in setenv.sh on each node in the cluster: 
         CATALINA_OPTS="-Dpdf.export.sandbox.disable=true ${CATALINA_OPTS}"
      2. Perform a rolling restart of each node for the change to take effect.  

      Note: This has the potential to cause extra heap usage within the JVM, as it brings PDF export operations back into the main heap space rather than running it externally. 

       

        1. DC-6-15-8-status400.png
          81 kB
          Malcolm Ninnes

            Assignee:
            Ales Huzik (Inactive)
            Reporter:
            Malcolm Ninnes
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: