Performing an HTML space export fails with an error when pages contain <ri:url> image references pointing to internal wiki image paths

XMLWordPrintable

    • 1
    • Minor

      Issue Summary

      HTML export of a Confluence Cloud space fails when the space contains pages with <ac:image><ri:url> tags that reference internal wiki image paths (e.g., https://<tenant>.atlassian.net/wiki/Images/image.png). These image references are typically leftover from Server→Cloud migrations. The export aborts entirely on encountering such a page, preventing the full space export from completing.
      PDF export of the same space is not affected.

      Steps to Reproduce

       1.  Have a Confluence Cloud space containing a page with an <ac:image> tag using <ri:url> referencing an internal wiki path, e.g.:

      <ac:image ac:height="96" ac:width="288">
        <ri:url ri:value="https://<tenant>.atlassian.net/wiki/Images/unlocked.png" />
      </ac:image>
       2.  Go to Space Settings → Content Tools → Export
       3.  Select HTML export and start the export

      Expected Results

      The HTML export completes successfully, either exporting the image correctly or gracefully handling the unresolvable image reference (e.g., rendering a placeholder or broken image tag) and continuing the export.

      Actual Results

      The export process starts, gets stuck, and then fails with the generic message: "An error occurred during export."
      The below exception is thrown in the application log:

       

      logger: com.atlassian.confluence.importexport.impl.HtmlExporter
      message: Entity being exported was: page: <pageId> v.<version>
      logger: com.atlassian.confluence.importexport.actions.ExportSpaceRunner
      message: Error during export for XML UI
      Caused by: java.lang.StringIndexOutOfBoundsException: Range [-1, 25) out of bounds for length 25
      

      The HTML export image rendering pipeline encounters the ri:url reference, identifies it as a Confluence resource (because it starts with the tenant base URL), and probably attempts to resolve/convert it to a relative export path. 

      Workaround

      Perform a custom HTML export excluding the affected pages.

      Alternatively, the customer can edit the affected pages and remove or replace the broken <ri:url> image references with properly uploaded image attachments

              Assignee:
              Unassigned
              Reporter:
              Abhinay Nigam
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: