Unable to delete a Confluence space due to "deleted object would be re-saved by cascade" error

Still need help?

The Atlassian Community is here for you.

Ask the community

This article only applies to Atlassian's server products. Learn more about the differences between cloud and server.

This Knowledge Base article was written specifically for Atlassian Data Center applications. The contents of this article do not apply to Server installations or the Atlassian Cloud platform.

Problem

It is not possible to delete a Confluence space. The process hangs in the UI and the following appears in the atlassian-confluence.log

2019-08-26 12:00:17,288 ERROR [Long running task: Space removal long running task] [atlassian.confluence.event.ConfluenceEventDispatcher] run There was an exception thrown trying to dispatch event [com.atlassian.confluence.event.events.space.SpaceWillRemoveEvent[source=com.atlassian.confluence.spaces.DefaultSpaceManager@650ee893]] from the invoker [com.atlassian.confluence.event.ConfluenceListenerHandlersConfiguration$TimingListenerHandler$1$1@2da97d25]
 -- space: 11111111 | url: /spaces/doremovespace.action | traceId: e0eb56d25a6493e4 | userName: admin | referer: http://localhost:8090/spaces/removespace.action?key=KEY | action: doremovespace
java.lang.RuntimeException: deleted object would be re-saved by cascade (remove deleted object from associations): [com.atlassian.confluence.pages.Page#1111111]. Listener: com.atlassian.confluence.core.listeners.BundledContentSpaceRemovalListener event: com.atlassian.confluence.event.events.space.SpaceWillRemoveEvent
    at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:55)

Cause

Notice you may see several errors like the one above in the logs, mentioning different objects. To confirm you are facing this issue before running the workaround, check if in one of the messages the associated item is the one below:

com.atlassian.confluence.pages.Page#<PAGEID>

If you see one or more messages with this object mentioned, the associations causing the problem are pages in the trash.

Workaround

To avoid this problem, purge the space trash before deleting the space as follows:

  1. Go to the space you want to delete and choose Space tools > Content Tools from the bottom of the sidebar
  2. Choose Trash
  3. Choose Purge all to completely empty the trash
  4. Try to delete the space again

Note

It is not yet clear how to replicate this issue. Ideally, the space deletion tool would remove all objects associated with it automatically. However, there is a special condition not identified yet that can cause this situation.


Description Unable to delete a Confluence space due to "deleted object would be re-saved by cascade" error
Product Confluence
Last modified on Aug 27, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.