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

Pasting a dataUrl base64 encoded image in the editor fails and results in the server exception

XMLWordPrintable

      The fix for this bug has been released to our Long Term Support release.

      The fix for this bug is now available in the latest release of Confluence 7.13 and 7.19

      Issue Summary

      Copy and paste of an image results in the exception: com.atlassian.confluence.content.render.xhtml.XhtmlException and the image is lost. This usually happens when base64 images are being copied.

      Steps to Reproduce

      1. Copy an image from any website like this where the embedded image is base64 encoded
      2. Paste it in the editor of the page
      3. Save the page

      Expected Results

      The image displayed correctly as pasted.

      Actual Results

      A broken image placeholder is displayed.

      The following error is thrown in the editor and the image is lost.

      com.atlassian.confluence.content.render.xhtml.XhtmlException: Missing required attribute: {http://atlassian.com/resource/identifier}value
      

      The logs shows the following error.

      2021-05-28 10:19:17,330 ERROR [http-nio-27111-exec-2] [render.xhtml.links.XhtmlOutgoingLinksExtractor] extract Error unmarshalling resource identifier fragment.
       -- referer: http://localhost:27111/c7111/pages/resumedraft.action?draftId=1409026&draftShareId=f875b326-a2af-4348-8f91-820ba69f196b& | url: /c7111/rest/tinymce/1/drafts | traceId: b9c0c913d6ceba4d | userName: admin
      com.atlassian.confluence.content.render.xhtml.XhtmlException: com.atlassian.confluence.content.render.xhtml.XhtmlException: Missing required attribute: {http://atlassian.com/resource/identifier}value
      	at com.atlassian.confluence.content.render.xhtml.storage.resource.identifiers.StorageResourceIdentifierUnmarshaller.unmarshal(StorageResourceIdentifierUnmarshaller.java:67)
      	at com.atlassian.confluence.content.render.xhtml.storage.resource.identifiers.StorageResourceIdentifierUnmarshaller.unmarshal(StorageResourceIdentifierUnmarshaller.java:47)
      	at com.atlassian.confluence.content.render.xhtml.links.XhtmlOutgoingLinksExtractor.extract(XhtmlOutgoingLinksExtractor.java:112)
      	at com.atlassian.confluence.links.DefaultLinkManager.updateOutgoingLinks(DefaultLinkManager.java:111)
      .
      Caused by: com.atlassian.confluence.content.render.xhtml.XhtmlException: Missing required attribute: {http://atlassian.com/resource/identifier}value
      	at com.atlassian.confluence.content.render.xhtml.storage.resource.identifiers.StorageResourceIdentifierUnmarshaller.getAttributeValue(StorageResourceIdentifierUnmarshaller.java:155)
      	at com.atlassian.confluence.content.render.xhtml.storage.resource.identifiers.StorageResourceIdentifierUnmarshaller.innerUnmarshal(StorageResourceIdentifierUnmarshaller.java:105)
      	at com.atlassian.confluence.content.render.xhtml.storage.resource.identifiers.StorageResourceIdentifierUnmarshaller.unmarshal(StorageResourceIdentifierUnmarshaller.java:65)
      

      Notes

      The storage format of the page shows an empty URL in place of the image.

      <ac:image><ri:url /></ac:image>
      

      Older versions of Confluence will show a broken image.

      <img src="/wiki/plugins/servlet/confluence/placeholder/error?i18nKey=editor.placeholder.broken.image&amp;locale=en_GB&amp;version=2" title="com.atlassian.confluence.content.render.xhtml.XhtmlException: Missing required attribute: {http://atlassian.com/resource/identifier}value" class="transform-error" data-encoded-xml="%3Cac%3Aimage+ac%3Aalt%3D%22Image+result+for+devtools+crash%22%3E%3Cri%3Aurl+%2F%3E%3C%2Fac%3Aimage%3E">
      

      Workaround

      There are a few workaround available for this bug.

      • Save the image locally on the workstation and then copy into Confluence
      • Copy from another source where the image format is png or jpeg

            zxu2@atlassian.com Zac Xu
            ablekhman@atlassian.com Alex Blekhman
            Votes:
            102 Vote for this issue
            Watchers:
            154 Start watching this issue

              Created:
              Updated:
              Resolved: