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

Attachment File Not Found - in children pages when a page is moved to another space

      Updated description:

      This issue is corrected in version 3.0.1. If you're not ready to upgrade, there are patch instructions below.

      I have attached UpdateAttachmentsOnFilesystemOnPageMoveListener.class that does not produce the exception you have mentioned and moves the page even if it cannot find attachments. You can install it by putting this file under <CONFLUENCE>/WEB-INF/classes/com/atlassian/confluence/pages/persistence/dao directory (you will need to create those directories if they don't exist) and restarting confluence. After that you would be able to move pages that have the 'attachment' problem.

      Please test the patch on you development instance before applying it in production. You might also want to rollback the patch once you fixed all 'broken' attachments.

      Additionally, there's a JSP file that recovers missing attachments if they're stored on the file system.
      The class file attached to the ticket fixes the problem from reoccurring, but does not recover the moved files. Attached is a JSP file that can recover attachments that have been affected by this bug.

      To use it:

      1. Download the JSP file from the attachments.
      2. Place it in <confluence-installation>/confluence/admin
      3. Browse to <base-URL>/admin/find_and_recover_attachments-3.x.jsp

      The recovery is self-explanatory from there. You may wish to do this on a test system first.

      This only works on configurations where files are stored in the file system, not the database. Please respond to this bug report if you need that configuration to be included or if you find any problems with the JSP.

      Original description:
      Not able to move attachments in a pagetree in Confluence 3.0.0_01.

      Customer submitted description:

      To reproduce:

      • create 2 spaces 'test1' + 'test2'
      • create 2 pages 'page1' + 'page2' in space 'test1'. 'page2' is a child of 'page1'.
      • create a simple text attachment on each page
      • go to 'page1' and move it to 'space2'
      • open page2 (now also in space2) ... you will see a correct attachment list, but when you try to open an attachment, you will get a message "Attachment File Not Found".

      Some notes:

      • page1 keeps its attachment correctly
      • If page1 is moved back to space1, attachment content reappears on page2

      The attachments folders remain in the original folder in the file system but not re-archived following their new page and space hierarchy.

      This will be a big pain for customers with big pagetree structure as they will have to move the page one by one in order to keep their attachments intact.

            [CONFSERVER-16348] Attachment File Not Found - in children pages when a page is moved to another space

            still exists in 7.2.0.......11 years and not solved.....unbelievable

            Petr Michna added a comment - still exists in 7.2.0.......11 years and not solved.....unbelievable

            It still exists in 6.11

            Stella Chang added a comment - It still exists in 6.11

            This bug is also present in Confluence 6.8.2

            Ralph Navarro added a comment - This bug is also present in Confluence 6.8.2

            I confirm that this bug is present in Confluence 6.0.1

            Tamer Marzouk added a comment - I confirm that this bug is present in Confluence 6.0.1

            Venkat Prasad added a comment - - edited

            We are facing this issue on Confluence 6.6 while moving page trees to another space.
            We will approach to atlassian support.

            Venkat Prasad added a comment - - edited We are facing this issue on Confluence 6.6 while moving page trees to another space. We will approach to atlassian support.

            happened on 6.4.3. However I would like to rise Atlassian attention that workaround is not "resolved"!!!!

            Stanimir Koev added a comment - happened on 6.4.3. However I would like to rise Atlassian attention that workaround is not "resolved"!!!!

            Piyush added a comment -

            Why is this issue solved??????
            Affected 6.0.5 - Still.

            Tried with above jsp page and that got failed. Can we do recovery only for a single space? error confluence.txt

            Piyush added a comment - Why is this issue solved?????? Affected 6.0.5 - Still. Tried with above jsp page and that got failed. Can we do recovery only for a single space? error confluence.txt

            I ran into this problem last week on server version 6.1.0 last week and did not have direct access to the db and file-system to run the patch that Altassian recommend. On a whim I tried moving the page tree back to the original space and all the attachments reappeared so I can confim Son's workaround (I had not seen this at the time).

            Steps to resolve:

            1) Move the pages back to the original space (does not have to be the same location, I moved them to an admin only Archive page so that users did not get confused).

            2) Copy the page to the new location (changes the owner and dates but all the attachments come across).

            Goodness knows why this issue is marked as resolved, there is clearly still a bug here.

            Andy Hurley added a comment - I ran into this problem last week on server version 6.1.0 last week and did not have direct access to the db and file-system to run the patch that Altassian recommend. On a whim I tried moving the page tree back to the original space and all the attachments reappeared so I can confim Son's workaround (I had not seen this at the time). Steps to resolve: 1) Move the pages back to the original space (does not have to be the same location, I moved them to an admin only Archive page so that users did not get confused). 2) Copy the page to the new location (changes the owner and dates but all the attachments come across). Goodness knows why this issue is marked as resolved, there is clearly still a bug here.

            We have this problem also for version Confluence 5.8.17,

            Krzysztof Wrobel added a comment - We have this problem also for version Confluence 5.8.17,

            admin added a comment - - edited

            We have also this problem in our 5.9.1 Server I will check the workaround from Son Dang

            admin added a comment - - edited We have also this problem in our 5.9.1 Server I will check the workaround from Son Dang

              akazatchkov Anatoli
              rhartono Roy Hartono [Atlassian]
              Affected customers:
              0 This affects my team
              Watchers:
              62 Start watching this issue

                Created:
                Updated:
                Resolved: