Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-24389

Export to PDF on Windows returns a stack trace if the name of the page has a ':' symbol

      Summary of Bug

      If the name of a page has a ':' symbol in between two words (for example, "Exercise 1 : Bugs"), or, in front of a word (for example, ": Bugs") the PDF export will fail and return a stack trace.

      Steps to Reproduce

      1. Create a page and ensure that the name has a ':' symbol in between two words (or with the ':' symbol in front of words)
      2. Save the page
      3. Try to export it to PDF

      Findings

      Stack trace
      The stack trace is as follows :

      java.io.IOException: The filename, directory name, or volume label syntax is incorrect
      	at java.io.WinNTFileSystem.canonicalize0(Native Method)
      	at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:396)
      	at java.io.File.getCanonicalPath(File.java:559)
      	at com.atlassian.confluence.extra.flyingpdf.ExportPageAsPdfAction.prepareDownloadPath(ExportPageAsPdfAction.java:65)
      	at com.atlassian.confluence.extra.flyingpdf.ExportPageAsPdfAction.execute(ExportPageAsPdfAction.java:35)
      	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:168)
      	at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
      	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
      	at com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor.intercept(DefaultWorkflowInterceptor.java:55)
      	at com.atlassian.confluence.core.ConfluenceWorkflowInterceptor.intercept(ConfluenceWorkflowInterceptor.java:37)
      	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
      	at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
      	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
      	at com.atlassian.xwork.interceptors.XsrfTokenInterceptor.intercept(XsrfTokenInterceptor.java:100)
      	at com.atlassian.confluence.xwork.ConfluenceXsrfTokenInterceptor.intercept(ConfluenceXsrfTokenInterceptor.java:25)
      	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
      	at com.atlassian.confluence.security.interceptors.CaptchaInterceptor.intercept(CaptchaInterceptor.java:49)
      	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
      	at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
      	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
      	at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
      	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
      	at com.atlassian.confluence.util.LoggingContextInterceptor.intercept(LoggingContextInterceptor.java:49)
      	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
      	at com.atlassian.confluence.core.CancellingInterceptor.intercept(CancellingInterceptor.java:23)
      	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
      	at com.atlassian.confluence.security.websudo.WebSudoInterceptor.intercept(WebSudoInterceptor.java:61)
      	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
      	at com.atlassian.confluence.security.actions.PermissionCheckInterceptor.intercept(PermissionCheckInterceptor.java:57)
      	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
      	at com.atlassian.confluence.setup.webwork.BootstrapAwareInterceptor.intercept(BootstrapAwareInterceptor.java:26)
      

      Conditions for reproducing the bug
      It seems that if there is nothing after the ':' symbol, the bug will not appear. For example, if the name of the page is "Exercise 1 :", then the page can be exported to PDF format smoothly.

          Form Name

            [CONFSERVER-24389] Export to PDF on Windows returns a stack trace if the name of the page has a ':' symbol

            Hi Rozita, let's talk about the solution at the support case CSP-106949, this bug is in the works by the team.

            Guilherme Nedel (Inactive) added a comment - Hi Rozita, let's talk about the solution at the support case CSP-106949 , this bug is in the works by the team.

            Rozita added a comment -

            Hi,
            I am experiencing the same issue, could you please let me know what is the solution?

            Cause

            com.atlassian.confluence.importexport.ImportExportException: Failed to create a location and file for the PDF export.
            at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:53)

            caused by: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
            at java.io.WinNTFileSystem.canonicalize0(Native Method)
            Stack Trace:[hide]

            com.atlassian.confluence.importexport.ImportExportException: Failed to create a location and file for the PDF export.
            at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:53)
            at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:39)
            at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerPdfExporterService.createPdfForPage(FlyingSaucerPdfExporterService.java:78)
            at com.atlassian.confluence.extra.flyingpdf.ExportPageAsPdfAction.execute(ExportPageAsPdfAction.java:28)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:168)
            at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
            at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)

            thx

            Rozita added a comment - Hi, I am experiencing the same issue, could you please let me know what is the solution? Cause com.atlassian.confluence.importexport.ImportExportException: Failed to create a location and file for the PDF export. at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:53) caused by: java.io.IOException: The filename, directory name, or volume label syntax is incorrect at java.io.WinNTFileSystem.canonicalize0(Native Method) Stack Trace: [hide] com.atlassian.confluence.importexport.ImportExportException: Failed to create a location and file for the PDF export. at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:53) at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerXmlToPdfConverter.convertXhtmlToPdf(FlyingSaucerXmlToPdfConverter.java:39) at com.atlassian.confluence.extra.flyingpdf.FlyingSaucerPdfExporterService.createPdfForPage(FlyingSaucerPdfExporterService.java:78) at com.atlassian.confluence.extra.flyingpdf.ExportPageAsPdfAction.execute(ExportPageAsPdfAction.java:28) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:168) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165) thx

            Evelin added a comment -

            Hi, we also hit this bug (in 5.1.1) - a colon in the title crashes the PDF export. But in our installations it's no general problem but only happens with (so far) one page. If I remove the colon, everything is ok. There are plenty of pages with a colon in the title that do not produce the bug.

            Evelin added a comment - Hi, we also hit this bug (in 5.1.1) - a colon in the title crashes the PDF export. But in our installations it's no general problem but only happens with (so far) one page. If I remove the colon, everything is ok. There are plenty of pages with a colon in the title that do not produce the bug.

            I added some support to isSafeTitleForFilesystem so it handles correctly windows naming conventions
            Issued pull request for TR:

            https://stash.atlassian.com/projects/CONF/repos/confluence/pull-requests/903/overview

            Ivan Loire (Inactive) added a comment - I added some support to isSafeTitleForFilesystem so it handles correctly windows naming conventions Issued pull request for TR: https://stash.atlassian.com/projects/CONF/repos/confluence/pull-requests/903/overview

            Does also appy to pages havin * in the title.

            Thomas Krause added a comment - Does also appy to pages havin * in the title.

            BillA added a comment -

            updating Summary since seems to be a Windows issue.

            BillA added a comment - updating Summary since seems to be a Windows issue.

            Same problem with Confluence 4.1

            Sören Sauerland added a comment - Same problem with Confluence 4.1

            Yep, I've just hit this problem in Confluence 4.2, exporting to PDF a page that has a colon in its title. If I replace the colon with a hyphen, the problem goes away. Since you allow users to create page titles that contain colons, I think that you should fix this problem. Or, I guess, change your mind about allowing colons in page titles .

            Graham Hannington added a comment - Yep, I've just hit this problem in Confluence 4.2, exporting to PDF a page that has a colon in its title. If I replace the colon with a hyphen, the problem goes away. Since you allow users to create page titles that contain colons, I think that you should fix this problem. Or, I guess, change your mind about allowing colons in page titles .

              iloire Ivan Loire (Inactive)
              jtye Joe Wai Tye (Inactive)
              Affected customers:
              13 This affects my team
              Watchers:
              25 Start watching this issue

                Created:
                Updated:
                Resolved: