-
Bug
-
Resolution: Fixed
-
Highest
-
6.2.0, 6.1.2, 6.4.0, 6.4.1, 6.6.7, 6.8.2, 6.10.1, 6.13.4
-
84
-
Severity 3 - Minor
-
72
-
Summary
When trying to delete a space which was imported from a Cloud version then the import completes and we see a foreign key violation on the table fk_notifications_content in the logs
Environment
Cloud version
Confluence 6.2.0
Steps to Reproduce
- Export a space from cloud version
- Import it to Confluence 6.2.0
- Delete the imported space
Expected Results
The space should be deleted
Actual Results
The below exception is thrown in the atlassian-confluence.log file and space does not get deleted the progress is stuck at some point:
2017-05-29 23:59:07,129 ERROR [Long running task: Space removal long running task] [engine.jdbc.spi.SqlExceptionHelper] logExceptions ERROR: update or delete on table "content" violates foreign key constraint "fk_notifications_content" on table "notifications" Detail: Key (contentid)=(1966804) is still referenced from table "notifications". -- space: 1998852 | url: /spaces/doremovespace.action | traceId: 608cac2fcc885b69 | userName: admin | referer: https://confluence.wiki.com/spaces/removespace.action?key=IT1 | action: doremovespace 2017-05-29 23:59:07,131 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@5aa6c096]] from the invoker [com.atlassian.confluence.event.ConfluenceListenerHandlersConfiguration$TimingListenerHandler$1$1@3fd3e159] -- space: 1998852 | url: /spaces/doremovespace.action | traceId: 608cac2fcc885b69 | userName: admin | referer: https://confluence.wiki.com/spaces/removespace.action?key=IT1 | action: doremovespace java.lang.RuntimeException: could not execute statement; SQL [n/a]; constraint [fk_notifications_content]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:41) at com.atlassian.confluence.event.ConfluenceListenerHandlersConfiguration$TimingListenerHandler$1$1.invoke(ConfluenceListenerHandlersConfiguration.java:69) ...
Workaround
Some users have resolved this issue by running the command below to delete invalid notifications tied to deleted pages in the space (Similar to solution from CONFSERVER-15964):
DELETE FROM NOTIFICATIONS WHERE CONTENTID IN ( SELECT CONTENTID FROM CONTENT WHERE (CONTENT_STATUS = 'deleted' AND SPACEID = <spaceid-here>) OR PREVVER IN ( SELECT CONTENTID FROM CONTENT WHERE CONTENT_STATUS = 'deleted' AND SPACEID = <spaceid-here>));
With direct database manipulation, be sure to test and validate these changes in a test environment and create all necessary backups prior to rolling any changes into a Production environment.
- derived from
-
CONFSERVER-31528 When Space XML Imports Fail, Partial Space Data is Left in the Database
- In Progress
- is caused by
-
CONFCLOUD-59856 Space exporter does not groom notifications properly
- Closed
- is related to
-
CONFSERVER-55576 Collaborative Editing cannot be enabled after importing a space from Confluence Cloud
- Closed