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

"Invalid white space character" error thrown when adding an image to a page which contains white space character in the title

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Low
    • None
    • 5.9.5, 1000.100.0, 6.4.2, 7.11.1, 7.12.0, 7.19.4, 7.19.6
    • Content - Page

    Description

      NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      Summary

      "Invalid white space character" error thrown when adding an image to a page which contains white space character in the title.

      Steps to Reproduce

      1. Create a page
      2. Add a white space into the page title.
      3. Save the page.
      4. Edit the page. Add an image to this page.

      Expected Results

      1. Image is uploaded successfully, or
      2. Confluence to handle more gracefully, such as provide a better explanation of this error message, or
      3. Have a better mechanism to prevent pages (or spaces) to be saved while there is an invalid character in the title

      Actual Results

      Image failed to be uploaded:

      The below exception is thrown in the atlassian-confluence.log file:

      2016-06-13 21:32:59,327 ERROR [http-nio-8595-exec-10] [confluence.plugins.dragdrop.UploadAction] execute Failed to save file.
       -- referer: http://bjorn:8595/confluence/pages/editpage.action?pageId=1769481 | url: /confluence/plugins/drag-and-drop/upload.action | userName: admin | action: upload
      java.lang.RuntimeException: Unexpected exception writing to stringwriter. java.io.IOException: Error while processing callback: com.ctc.wstx.exc.WstxIOException: Invalid white space character (0xb) in text to output
      	at com.atlassian.confluence.content.render.xhtml.Streamables.writeToString(Streamables.java:192)
      	at com.atlassian.confluence.content.render.xhtml.DefaultEditorFormatService.convertEmbeddedImageToEdit(DefaultEditorFormatService.java:103)
      	at com.atlassian.confluence.plugins.dragdrop.UploadAction.getHtmlToEmbedFileIntoEditorContent(UploadAction.java:220)
      	at com.atlassian.confluence.plugins.dragdrop.UploadAction.execute(UploadAction.java:144)
      	at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:168)
      ...
      Caused by: java.io.IOException: Error while processing callback: com.ctc.wstx.exc.WstxIOException: Invalid white space character (0xb) in text to output
      	at com.atlassian.confluence.content.render.xhtml.Streamables$XmlStreamWriterTemplateStreamable.writeTo(Streamables.java:104)
      	at com.atlassian.confluence.content.render.xhtml.Streamables.writeToString(Streamables.java:188)
      	... 329 more
      Caused by: com.ctc.wstx.exc.WstxIOException: Invalid white space character (0xb) in text to output
      	at com.ctc.wstx.sw.BaseNsStreamWriter.doWriteAttr(BaseNsStreamWriter.java:494)
      	at com.ctc.wstx.sw.BaseNsStreamWriter.writeAttribute(BaseNsStreamWriter.java:230)
      	at com.atlassian.confluence.content.render.xhtml.editor.embed.EditorEmbeddedImageTitleWriter.writeEmbeddedImageTag(EditorEmbeddedImageTitleWriter.java:58)
      	at com.atlassian.confluence.content.render.xhtml.view.embed.DefaultAttachedImageResourceMarshaller.lambda$marshal$397(DefaultAttachedImageResourceMarshaller.java:126)
      	at com.atlassian.confluence.content.render.xhtml.DefaultXmlStreamWriterTemplate.execute(DefaultXmlStreamWriterTemplate.java:36)
      	at com.atlassian.confluence.content.render.xhtml.Streamables$XmlStreamWriterTemplateStreamable.writeTo(Streamables.java:102)
      	... 330 more
      Caused by: java.io.IOException: Invalid white space character (0xb) in text to output
      	at com.ctc.wstx.sw.XmlWriter.throwInvalidChar(XmlWriter.java:545)
      	at com.ctc.wstx.sw.BufferingXmlWriter.writeAttrValue(BufferingXmlWriter.java:1058)
      	at com.ctc.wstx.sw.BufferingXmlWriter.writeAttribute(BufferingXmlWriter.java:891)
      	at com.ctc.wstx.sw.BaseNsStreamWriter.doWriteAttr(BaseNsStreamWriter.java:483)
      	... 335 more
      

      Notes

      Other scenarios on which this issue happens:

      1. This error message could appear while editing a page.
      2. When the Space Title of the space of the problematic page contains white space:

      Workaround

      Rename the page/space title

      Attachments

        1. image-2016-06-13-21-57-54-453.png
          image-2016-06-13-21-57-54-453.png
          18 kB
        2. screenshot-1.png
          screenshot-1.png
          9 kB
        3. screenshot-2.png
          screenshot-2.png
          2 kB
        4. whitespace.txt
          0.0 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mkhairuliana Monique Khairuliana (Inactive)
              Votes:
              16 Vote for this issue
              Watchers:
              21 Start watching this issue

              Dates

                Created:
                Updated: