Page cannot be moved between spaces due to existing duplicate in trash
Symptoms
When you try to move a page to another space it renders an error in logs but nothing appears in the UI and the process doesn't finish as expected.
The following appears in the atlassian-confluence.log
:
[atlassian.event.internal.AsynchronousAbleEventDispatcher] run There was an exception thrown trying to dispatch event [com.atlassian.confluence.event.events.content.page.PageMoveCompletedEvent[source=page: XXXXX (ID)]] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.atlassian.confluence.links.RelatedContentRefactoringListener.handleEvent(com.atlassian.confluence.event.events.content.page.PageMoveCompletedEvent),listener=com.a
tlassian.confluence.links.RelatedContentRefactoringListener@2eefd899}]
– url: /pages/movepage.action | userName: username | referer: PAGE_URL | action: movepage
java.lang.RuntimeException: A page already exists with the title PAGE_TITLE in the space with key SPACEKEY
Cause
This error is caused due to a bug in the application tracked here: - CONF-34649Getting issue details... STATUS
It happens when you move a page to another space that contains a page in trash with the same page name.
Resolution
Option 1:
- Change title of the page that will be moved before moving it.
i.e. "Release Notes" to "Release Notes v1.0" - Move page to desired location
The new title can be changed back to the original after completion.
Option 2:
- Check the error in the logs to find the space which contains the deleted page (this may not be the same space as the page you are moving).
- Purge the trash in that space (documentation).
When the trash is purged, all attachments on purged pages are permanently removed as well.