Deleting a space imported from Confluence Cloud fails if import contained Archived pages

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • None
    • Affects Version/s: 8.5.4, 8.7.1, 8.5.10, 8.5.17, 9.2.4
    • None
    • 22
    • Severity 3 - Minor
    • 11

      Issue Summary

      Unable to delete spaces imported from Confluence Cloud if that space contained Archived pages

      This is reproducible on Data Center: (yes)

      Steps to Reproduce

      1. On Confluence Cloud, create a Space with a few pages
      2. Archived one of those pages
      3. Export this space as full space XML export
      4. Import this space into Confluence Data Center
      5. Attempt to delete this Space from Confluence Data Center

      Expected Results

      Space gets deleted

      Actual Results

      Space deletion fails in WebUI
      The following exception in atlassian-confluence.log
      SpaceID we are trying to delete in this example is 1736706

      ERROR [Long running task: Space removal long running task] [atlassian.confluence.spaces.DefaultSpaceManager] removeSpace Cannot remove space: ISTS
       -- referer: https://confluence.com/spaces/removespace.action?key=ISTS | traceId: 9b98bf1138acbbbf | userName: admin | action: doremovespace | url: /spaces/doremovespace.action | space: 1736706
      org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [fklmweu06nft59g7mw1i1myorys]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "spaces" violates foreign key constraint "fklmweu06nft59g7mw1i1myorys" on table "content"
        Detail: Key (spaceid)=(1736706) is still referenced from table "content".
      

      Looking for any content related to the spaceid you are attempting to delete will return archived pages and other related content to them (drafts, attachments, plugin data)

      select contentid, contenttype, prevver, content_status, spaceid
      from content
      where spaceid=1736706;
      

      Workaround

      Space leftover data needs to be manually deleted from the database following How to Manually Delete a Space KB

      To prevent this issue:

      • Unarchive all pages in Space you intend to import into Confluence DC
      • Delete any archived pages on the space and purge the trash before generating export on cloud

            Assignee:
            Unassigned
            Reporter:
            Igor M. (Inactive)
            Votes:
            6 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: