Copy space fails if an attachment size doesn't match in filesystem and DB

XMLWordPrintable

    • 1
    • Severity 3 - Minor

      Issue Summary

      Copy Space fails when an attachment's size are different in the DB and filesystem. The space copy does copy all content but it reports failure.

      This is reproducible on Data Center: (yes) / (no)

      Steps to Reproduce

      1. Import the attached Space
      2. Copy the space

      Expected Results

      When copying a large space, the copy space doesn't stop when it hits the error but instead, it will proceed with copying the remaining contents and fails towards the end.

      Actual Results

      Copy space reports failure after copying all content.

      2024-08-21 08:15:24,555 ERROR [Long running task: Copy space long running task] [dao.bulk.copy.DefaultBulkPageCopy] safeAction An exception occurred while trying to do a bulk page copy operation
       -- url: /confluence/rest/copy/1.0/copy | userName: admin | referer: https://linux-78726.prod.atl-cd.net/confluence/spaces/copyspaceoptions.action?key=PM | traceId: 57f7bbf097061518
      com.atlassian.confluence.pages.attachments.AttachmentDataStreamSizeMismatchException: Attachment data stream contains a different number of bytes to the declared size of the attachment. Expected: 0, actual: 53081
      ...
      2024-08-21 08:15:24,643 ERROR [Long running task: Copy space long running task] [atlassian.event.internal.AsynchronousAbleEventDispatcher] lambda$null$0 There was an exception thrown trying to dispatch event [com.atlassian.confluence.event.events.content.page.PageCopyEvent@29d4e135[destination=page: Puven 1 v.1 (1179659),initiator=ConfluenceUserImpl{name='admin', key=2cb280859173e530019173e7cdfa0000},origin=page: Puven 1 v.1 (131146),pageCopyOptions=com.atlassian.confluence.pages.persistence.dao.bulk.copy.PageCopyOptions@350cfcba,page=page: Puven 1 v.1 (1179659),suppressNotifications=true,timestamp=1724228124562]] from the invoker [com.atlassian.event.internal.ComparableListenerInvoker@3521820f]
       -- url: /confluence/rest/copy/1.0/copy | userName: admin | referer: https://linux-78726.prod.atl-cd.net/confluence/spaces/copyspaceoptions.action?key=PM | traceId: 57f7bbf097061518
      java.lang.RuntimeException: InputStream must not be null. Listener: com.atlassian.confluence.plugin.copyspace.watcher.CopyPageEventWatcher event: com.atlassian.confluence.event.events.content.page.PageCopyEvent
      ...
      2024-08-21 08:15:24,778 ERROR [Long running task: Copy space long running task] [core.task.longrunning.AbstractLongRunningTask] runInternal Error: 
       -- url: /confluence/rest/copy/1.0/copy | userName: admin | referer: https://linux-78726.prod.atl-cd.net/confluence/spaces/copyspaceoptions.action?key=PM | traceId: 57f7bbf097061518
      org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only
      

      Workaround

      Follow the steps in Unable to copy the page due to attachment size mismatch

        1. Confluence-space-export-PM-2024-08-21-08-15-02-818.xml.zip
          435 kB
          Puventhira Mannen Pragasam Selladurai

              Assignee:
              Saquia Naz
              Reporter:
              Puventhira Mannen Pragasam Selladurai
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: