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

Images, attachments, user mentions are broken after changing the BaseURL

    XMLWordPrintable

Details

    Description

      Atlassian Update - March 2018

      The fix for this issue released in 6.8.0 will prevent links to images (and view attachment macros) from being corrupted after a change in the Confluence baseURL.

      However, if there are any existing link corruptions that occurred prior to upgrading to 6.8.0, those corruptions will remain, and the only way to fix is to either revert to a published version of a page without such corruptions, or discard the draft (if the corruption is only in the draft).

      I have created an issue to track a fix on the already corrupted links: CONFSERVER-55249

      Steps to Reproduce 

      1. Set up an instance with no context path, eg http://localhost:8090/
      2. Create a page and add some images, attachments and user mentions to it
        • Confirm it displays ok
      3. Shut down Confluence and set a context path, eg http://localhost:8090/confluence
      4. Restart and update the base URL in Confluence Admin > General Configurations
      5. view the page
        • Observe that the images are still ok
      6. Edit the page
        • Observe that the images are broken in edit mode
      7. Type some text and save
        • Observe that the images are still broken

      This is likely happening because Synchrony "saved" the links with the old BaseURL, and then when the BaseURL changed, those changes aren't propagated into Synchrony (because it's saving the editor format).

      Workaround

      Turn Collaborative Editing Off and back On (recommended)

      It has been confirmed that turning Synchrony Off and On again resolves the related issue with links in -CONFSERVER-52455-. It is unclear if this applies to the image issue as well.

        All existing shared drafts are lost when you switch collaborative editing off, so make sure your users have published any work they want to keep before you make the change.

      1. Go to > General Configuration > Collaborative editing
      2. Click Change mode
      3. Select Off
      4. Click Change
      5. Then turn Synchrony back on
      6. Then rebuild the index via the UI
      7. The issue will stop occurring but you will need to go back and manually restore any pages that were affected
        1. You can restore the page to an older version
        2. Or you can manually adjust the links
      Note about this workaround

      When Collaborative Editing is enabled, and a page is being edited, all those small changes are stored in Synchrony in-memory cache/events table on the database. That includes the base URL.
      When the base URL got changed in Confluence, Synchrony won't be aware of this change. When turning off Collaborative Editing, you discard all the data that Synchrony had and when enabling again, you are forcing to fetch a new copy of the base URL from Confluence. That's how turning it off and on again helps workaround this issue

      Turn Collaborative Editing Off Entirely (not recommended)

        All existing shared drafts are lost when you switch collaborative editing off, so make sure your users have published any work they want to keep before you make the change.

      1. Go to > General Configuration > Collaborative editing
      2. Click Change mode
      3. Select Off
      4. Click Change
      5. Then rebuild the index via the UI
      6. The issue will stop occurring but you will need to go back and manually restore any pages that were affected
        1. You can restore the page to an older version
        2. Or you can manually adjust the links

      More information can be found in Administering Collaborative editing.

      If turning off Collaborative Editing is not an option or the affected area is not too big for the instance, there is a workaround that can be applied to a page to fix it on a page to page
      basis:

      1. Edit the affected page that has either User Mention or Attachment Link in it
      2. Save the page without making any changes (this would break the page due to this bug)
      3. Revert the page back to the history of 1 version before the current broken version (the version that has all the user mentions and attachment links still intact)

      Now that the page has been affected once, any edits after this will not cause the user mentions or attachment links to change again.

      Attachments

        Issue Links

          Activity

            People

              jxie Chii
              dunterwurzacher Denise Unterwurzacher [Atlassian] (Inactive)
              Votes:
              27 Vote for this issue
              Watchers:
              53 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: