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

Re-trying a failed space page move does not merge missing attachments


      Issue Summary

      A failed page move between spaces can break attachments on a page when the files themselves are moved to the new space's location in the attachment hierarchy and the database transaction is rolled back for any reason. This results in the page still being in the same space it always was while the attachments are now broken due to them being in the wrong space's folder in the attachments directory.

      If the user re-tries the failed move operation, according to confluence-core/confluence/src/java/com/atlassian/confluence/pages/persistence/dao/filesystem/HierarchicalMultiStreamAttachmentDataFileSystem.java the directory will be appended with "moved_out_of_the_way" at the end of the attachment directory's name to avoid a conflict with the folder that is being moved from the old space to this new space. Unfortunately, this means that the contents are not merged and any files that were already moved in the first move will continue to be unavailable even though the subsequent page move succeeds.

      Steps to Reproduce

      1. Move a page with attachments between spaces and have it fail where the attachments are partially moved to the new space and some are left behind
        • these attachments that were moved already will appear broken on the page now
      2. Re-try the move operation, the 2nd time it succeeds but the broken attachments persist even though the page has completed its move to the new space on the 2nd try

      Expected Results

      The contents of the directories will be merged so any missing attachments will be restored now that the page's attachment directories have been re-combined. 

      Actual Results

      The folder that is first written to the new space's location will be appended with "moved_out_of_the_way" and any attachments in it will remain to be broken on the page even after the page is successfully moved to the new space.





      Will both be present side-by-side.


      The Missing Attachments Script can find the attachments even if they are in folder that has been appended with "moved_out_of_the_way", run this script on demand to search for and recover missing attachments if they can be located in another location within the attachments directory.


            jponting James Ponting
            asmith4@atlassian.com Andrew S
            10 Vote for this issue
            13 Start watching this issue