This ticket tracks a class of bugs wherein Confluence misplaces attachments as part of a page move. The attachments remain on disk, but due to being in the wrong part of the file tree, appear to be missing.
This issue occurs during page or pagetree moves that are unexpectedly interrupted.
Note this is not related to CONFSERVER-55928: Attachments become 'Unknown Attachment' in the page editor with Collaborative Editing turned on or its related bugs
There are currently multiple causes with differing reproduction steps.
The fundamental cause is halting a pagetree copy whilst attachments are being moved.
The files should be moved successfully. In the case of a failed move, the file copies should be rolled back successfully.
The files are not moved correctly, or alternately, the files are not rolled back to their original location in the case of a failed page move.
We currently have a script that searches for attachments that have been misplaced and moves them back to the correct location. The script can be found at https://confluence.atlassian.com/confkb/how-to-resolve-missing-attachments-in-confluence-201761.html