java.lang.RuntimeException: deleted object would be re-saved by cascade (remove deleted object from associations): 17596426, of class: com.atlassian.confluence.spaces.Space; nested exception is net.sf.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): 17596426, of class: com.atlassian.confluence.spaces.Space

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Possibly there is an underlying bug in the upgrade task to 5.3.x when the database in use is MS SQL Server. In 5.3.x, PAGEID column should be replaced with CONTENTID instead in NOTIFICATIONS table but for this case somehow both columns exist and the value in CONTENTID column is all NULL. Somehow the migration task did not migrate PAGEID data in NOTIFICATIONS table to CONTENTID column. This has caused three different issues so far: # Unable to purge a trash or any trash at all. The issue occurred after an upgrade to 5.3.x and the following appears in the atlassian-confluence.log: {code} 2013-10-22 13:33:13,681 ERROR [http-8090-2] [sf.hibernate.util.JDBCExceptionReporter] logExceptions The DELETE statement conflicted with the REFERENCE constraint "FK594ACC88C38FBEA". The conflict occurred in database "confluence", table "dbo.NOTIFICATIONS", column 'PAGEID'. -- url: /pages/dopurgetrashitem.action | userName: admin | referer: http://confluence:8090/pages/purgetrashitem.action?key=PLAY&contentId=30114153 | action: dopurgetrashitem {code} # Space deletion seems successful however all users still able to access the deleted space (rebuilding the index didn't make any difference) and the following appears in the atlassian-confluence.log: {code} 2013-11-27 22:05:32,216 ERROR [Long running task: Space removal long running task] [atlassian.event.internal.AsynchronousAbleEventDispatcher] run There was an exception thrown trying to dispatch event 'com.atlassian.confluence.event.events.space.SpaceRemoveEvent[source=com.atlassian.confluence.spaces.DefaultSpaceManager@4e636bd6]' from the invoker 'SingleParameterMethodListenerInvoker{method=public void com.atlassian.confluence.plugins.createcontent.listeners.RemoveSpaceListener.onSpaceRemoveEvent(com.atlassian.confluence.event.events.space.SpaceRemoveEvent), listener=com.atlassian.confluence.plugins.createcontent.listeners.RemoveSpaceListener@779a9a3f}'. -- space: 17596426 | url: /conf/spaces/doremovespace.action | userName: admin | referer: http://localhost:8531/conf/spaces/removespace.action?key=AMP7 | action: doremovespace java.lang.RuntimeException: deleted object would be re-saved by cascade (remove deleted object from associations): 17596426, of class: com.atlassian.confluence.spaces.Space; nested exception is net.sf.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): 17596426, of class: com.atlassian.confluence.spaces.Space at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54) Caused by: net.sf.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): 17596426, of class: com.atlassian.confluence.spaces.Space at net.sf.hibernate.impl.SessionImpl.forceFlush(SessionImpl.java:778) at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:756) at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1401) at net.sf.hibernate.engine.Cascades$4.cascade(Cascades.java:114) {code} # After an upgrade to 5.3.x, you can no longer see the list of page watchers although there were users watching the page before the upgrade. When you look into the NOTIFICATIONS table, the watch notifications were listed there and they were tied to the correct usernames. However they were referencing to PAGEID instead of CONTENTID. CONTENTID is all NULL instead. h5. Resolution: All of the above can be fixed by implementing the steps below: # Stop Confluence # Backup Confluence database and Home Directory. # Run the following SQL query to copy the PAGEID values into the CONTENTID column {code} UPDATE NOTIFICATIONS SET CONTENTID = PAGEID WHERE PAGEID IS NOT NULL; {code} # Run the following query to drop the PAGEID Foreign Key constraint (double check the actual key name in the NOTIFICATIONS table) {code} ALTER TABLE NOTIFICATIONS DROP FK594ACC88C38FBEA; {code} # Run query to drop the index on the PAGEID column {code} drop index NOTIFICATIONS.n_pageid_idx; {code} # Run this query to drop the actual PAGEID column {code} ALTER TABLE NOTIFICATIONS DROP COLUMN PAGEID; {code} # Start Confluence # You should now be able to purge the trash, able to successfully delete any space and the page watchers are listed in Watch > Manage Watchers h5. Important note: The original bug in the upgrade task has been fixed. This means customers upgrading from Confluence versions lower then 5.3 to 5.4.4+ should no longer be effected by this. However if you have previously upgraded from an older version of Confluence and are effected by this problem upgrading again to Confluence 5.4.4+ will NOT rerun the upgrade task. Therefore for customers in this situation it is still necessary to run the workaround, upgrading alone is not sufficient to fix this problem.
    via by Hanis Suhailah,
  • Possibly there is an underlying bug in the upgrade task to 5.3.x when the database in use is MS SQL Server. In 5.3.x, PAGEID column should be replaced with CONTENTID instead in NOTIFICATIONS table but for this case somehow both columns exist and the value in CONTENTID column is all NULL. Somehow the migration task did not migrate PAGEID data in NOTIFICATIONS table to CONTENTID column. This has caused three different issues so far: # Unable to purge a trash or any trash at all. The issue occurred after an upgrade to 5.3.x and the following appears in the atlassian-confluence.log: {code} 2013-10-22 13:33:13,681 ERROR [http-8090-2] [sf.hibernate.util.JDBCExceptionReporter] logExceptions The DELETE statement conflicted with the REFERENCE constraint "FK594ACC88C38FBEA". The conflict occurred in database "confluence", table "dbo.NOTIFICATIONS", column 'PAGEID'. -- url: /pages/dopurgetrashitem.action | userName: admin | referer: http://confluence:8090/pages/purgetrashitem.action?key=PLAY&contentId=30114153 | action: dopurgetrashitem {code} # Space deletion seems successful however all users still able to access the deleted space (rebuilding the index didn't make any difference) and the following appears in the atlassian-confluence.log: {code} 2013-11-27 22:05:32,216 ERROR [Long running task: Space removal long running task] [atlassian.event.internal.AsynchronousAbleEventDispatcher] run There was an exception thrown trying to dispatch event 'com.atlassian.confluence.event.events.space.SpaceRemoveEvent[source=com.atlassian.confluence.spaces.DefaultSpaceManager@4e636bd6]' from the invoker 'SingleParameterMethodListenerInvoker{method=public void com.atlassian.confluence.plugins.createcontent.listeners.RemoveSpaceListener.onSpaceRemoveEvent(com.atlassian.confluence.event.events.space.SpaceRemoveEvent), listener=com.atlassian.confluence.plugins.createcontent.listeners.RemoveSpaceListener@779a9a3f}'. -- space: 17596426 | url: /conf/spaces/doremovespace.action | userName: admin | referer: http://localhost:8531/conf/spaces/removespace.action?key=AMP7 | action: doremovespace java.lang.RuntimeException: deleted object would be re-saved by cascade (remove deleted object from associations): 17596426, of class: com.atlassian.confluence.spaces.Space; nested exception is net.sf.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): 17596426, of class: com.atlassian.confluence.spaces.Space at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54) Caused by: net.sf.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): 17596426, of class: com.atlassian.confluence.spaces.Space at net.sf.hibernate.impl.SessionImpl.forceFlush(SessionImpl.java:778) at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:756) at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1401) at net.sf.hibernate.engine.Cascades$4.cascade(Cascades.java:114) {code} # After an upgrade to 5.3.x, you can no longer see the list of page watchers although there were users watching the page before the upgrade. When you look into the NOTIFICATIONS table, the watch notifications were listed there and they were tied to the correct usernames. However they were referencing to PAGEID instead of CONTENTID. CONTENTID is all NULL instead. h5. Resolution: All of the above can be fixed by implementing the steps below: # Stop Confluence # Backup Confluence database and Home Directory. # Run the following SQL query to copy the PAGEID values into the CONTENTID column {code} UPDATE NOTIFICATIONS SET CONTENTID = PAGEID WHERE PAGEID IS NOT NULL; {code} # Run the following query to drop the PAGEID Foreign Key constraint (double check the actual key name in the NOTIFICATIONS table) {code} ALTER TABLE NOTIFICATIONS DROP FK594ACC88C38FBEA; {code} # Run query to drop the index on the PAGEID column {code} drop index NOTIFICATIONS.n_pageid_idx; {code} # Run this query to drop the actual PAGEID column {code} ALTER TABLE NOTIFICATIONS DROP COLUMN PAGEID; {code} # Start Confluence # You should now be able to purge the trash, able to successfully delete any space and the page watchers are listed in Watch > Manage Watchers h5. Important note: The original bug in the upgrade task has been fixed. This means customers upgrading from Confluence versions lower then 5.3 to 5.4.4+ should no longer be effected by this. However if you have previously upgraded from an older version of Confluence and are effected by this problem upgrading again to Confluence 5.4.4+ will NOT rerun the upgrade task. Therefore for customers in this situation it is still necessary to run the workaround, upgrading alone is not sufficient to fix this problem.
    via by Hanis Suhailah,
  • Possibly there is an underlying bug in the upgrade task to 5.3.x when the database in use is MS SQL Server. In 5.3.x, PAGEID column should be replaced with CONTENTID instead in NOTIFICATIONS table, but for this case somehow both columns exist and the value in CONTENTID column is all NULL. Somehow the migration task did not migrate PAGEID data in NOTIFICATIONS table to CONTENTID column and drop the PAGEID column. This causes three different issues so far: # Unable to purge a trash or any trash at all. The issue occurred after an upgrade to 5.3.x and the following appears in the atlassian-confluence.log: {code} 2013-10-22 13:33:13,681 ERROR [http-8090-2] [sf.hibernate.util.JDBCExceptionReporter] logExceptions The DELETE statement conflicted with the REFERENCE constraint "FK594ACC88C38FBEA". The conflict occurred in database "confluence", table "dbo.NOTIFICATIONS", column 'PAGEID'. -- url: /pages/dopurgetrashitem.action | userName: admin | referer: http://confluence:8090/pages/purgetrashitem.action?key=PLAY&contentId=30114153 | action: dopurgetrashitem {code} # Space deletion seems successful however all users still able to access the deleted space (rebuilding the index didn't make any difference) and the following appears in the atlassian-confluence.log: {code} 2013-11-27 22:05:32,216 ERROR [Long running task: Space removal long running task] [atlassian.event.internal.AsynchronousAbleEventDispatcher] run There was an exception thrown trying to dispatch event 'com.atlassian.confluence.event.events.space.SpaceRemoveEvent[source=com.atlassian.confluence.spaces.DefaultSpaceManager@4e636bd6]' from the invoker 'SingleParameterMethodListenerInvoker{method=public void com.atlassian.confluence.plugins.createcontent.listeners.RemoveSpaceListener.onSpaceRemoveEvent(com.atlassian.confluence.event.events.space.SpaceRemoveEvent), listener=com.atlassian.confluence.plugins.createcontent.listeners.RemoveSpaceListener@779a9a3f}'. -- space: 17596426 | url: /conf/spaces/doremovespace.action | userName: admin | referer: http://localhost:8531/conf/spaces/removespace.action?key=AMP7 | action: doremovespace java.lang.RuntimeException: deleted object would be re-saved by cascade (remove deleted object from associations): 17596426, of class: com.atlassian.confluence.spaces.Space; nested exception is net.sf.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): 17596426, of class: com.atlassian.confluence.spaces.Space at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54) Caused by: net.sf.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): 17596426, of class: com.atlassian.confluence.spaces.Space at net.sf.hibernate.impl.SessionImpl.forceFlush(SessionImpl.java:778) at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:756) at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1401) at net.sf.hibernate.engine.Cascades$4.cascade(Cascades.java:114) {code} # After an upgrade to 5.3.x, you can no longer see the list of page watchers although there were users watching the page before the upgrade. When you look into the NOTIFICATIONS table, the watch notifications were listed there and they were tied to the correct usernames. However they were referencing to PAGEID instead of CONTENTID. CONTENTID is all NULL instead. h5. Resolution All of the above can be fixed by implementing the steps below: # Stop Confluence # Backup Confluence database and Home Directory. # Run the following SQL query to copy the PAGEID values into the CONTENTID column {code} UPDATE NOTIFICATIONS SET CONTENTID = PAGEID WHERE PAGEID IS NOT NULL; {code} # Run the following query to drop the PAGEID Foreign Key constraint (double check the actual key name in the NOTIFICATIONS table) {code} ALTER TABLE NOTIFICATIONS DROP FK594ACC88C38FBEA; {code} # Run query to drop the index on the PAGEID column {code} drop index NOTIFICATIONS.n_pageid_idx; {code} # Run this query to drop the actual PAGEID column {code} ALTER TABLE NOTIFICATIONS DROP COLUMN PAGEID; {code} # Start Confluence # You should now be able to purge the trash, delete any space, and see a list of page watchers in Watch > Manage Watchers. h5. Important note The original bug in the upgrade task has been fixed. This means customers upgrading from Confluence versions lower than 5.3 to 5.4.4+ should no longer be affected by this. However if you have previously upgraded from an older version of Confluence and are affected by this problem upgrading again to Confluence 5.4.4+ will NOT rerun the upgrade task. Therefore for customers in this situation it is still necessary to run the workaround, since upgrading alone is not sufficient to fix this problem.
    via by Hanis Suhailah,
  • Possibly there is an underlying bug in the upgrade task to 5.3.x when the database in use is MS SQL Server. In 5.3.x, PAGEID column should be replaced with CONTENTID instead in NOTIFICATIONS table but for this case somehow both columns exist and the value in CONTENTID column is all NULL. Somehow the migration task did not migrate PAGEID data in NOTIFICATIONS table to CONTENTID column. This has caused three different issues so far: # Unable to purge a trash or any trash at all. The issue occurred after an upgrade to 5.3.x and the following appears in the atlassian-confluence.log: {code} 2013-10-22 13:33:13,681 ERROR [http-8090-2] [sf.hibernate.util.JDBCExceptionReporter] logExceptions The DELETE statement conflicted with the REFERENCE constraint "FK594ACC88C38FBEA". The conflict occurred in database "confluence", table "dbo.NOTIFICATIONS", column 'PAGEID'. -- url: /pages/dopurgetrashitem.action | userName: admin | referer: http://confluence:8090/pages/purgetrashitem.action?key=PLAY&contentId=30114153 | action: dopurgetrashitem {code} # Space deletion seems successful however all users still able to access the deleted space (rebuilding the index didn't make any difference) and the following appears in the atlassian-confluence.log: {code} 2013-11-27 22:05:32,216 ERROR [Long running task: Space removal long running task] [atlassian.event.internal.AsynchronousAbleEventDispatcher] run There was an exception thrown trying to dispatch event 'com.atlassian.confluence.event.events.space.SpaceRemoveEvent[source=com.atlassian.confluence.spaces.DefaultSpaceManager@4e636bd6]' from the invoker 'SingleParameterMethodListenerInvoker{method=public void com.atlassian.confluence.plugins.createcontent.listeners.RemoveSpaceListener.onSpaceRemoveEvent(com.atlassian.confluence.event.events.space.SpaceRemoveEvent), listener=com.atlassian.confluence.plugins.createcontent.listeners.RemoveSpaceListener@779a9a3f}'. -- space: 17596426 | url: /conf/spaces/doremovespace.action | userName: admin | referer: http://localhost:8531/conf/spaces/removespace.action?key=AMP7 | action: doremovespace java.lang.RuntimeException: deleted object would be re-saved by cascade (remove deleted object from associations): 17596426, of class: com.atlassian.confluence.spaces.Space; nested exception is net.sf.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): 17596426, of class: com.atlassian.confluence.spaces.Space at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54) Caused by: net.sf.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): 17596426, of class: com.atlassian.confluence.spaces.Space at net.sf.hibernate.impl.SessionImpl.forceFlush(SessionImpl.java:778) at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:756) at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1401) at net.sf.hibernate.engine.Cascades$4.cascade(Cascades.java:114) {code} # After an upgrade to 5.3.x, you can no longer see the list of page watchers although there were users watching the page before the upgrade. When you look into the NOTIFICATIONS table, the watch notifications were listed there and they were tied to the correct usernames. However they were referencing to PAGEID instead of CONTENTID. CONTENTID is all NULL instead. h5. Resolution: All of the above can be fixed by implementing the steps below: # Stop Confluence # Backup Confluence database and Home Directory. # Run the following SQL query to copy the PAGEID values into the CONTENTID column {code} UPDATE NOTIFICATIONS SET CONTENTID = PAGEID WHERE PAGEID IS NOT NULL; {code} # Run the following query to drop the PAGEID Foreign Key constraint (double check the actual key name in the NOTIFICATIONS table) {code} ALTER TABLE NOTIFICATIONS DROP FK594ACC88C38FBEA; {code} # Run query to drop the index on the PAGEID column {code} drop index NOTIFICATIONS.n_pageid_idx; {code} # Run this query to drop the actual PAGEID column {code} ALTER TABLE NOTIFICATIONS DROP COLUMN PAGEID; {code} # Start Confluence # You should now be able to purge the trash, able to successfully delete any space and the page watchers are listed in Watch > Manage Watchers h5. Important note: The original bug in the upgrade task has been fixed. This means customers upgrading from Confluence versions lower then 5.3 to 5.4.4+ should no longer be effected by this. However if you have previously upgraded from an older version of Confluence and are effected by this problem upgrading again to Confluence 5.4.4+ will NOT rerun the upgrade task. Therefore for customers in this situation it is still necessary to run the workaround, upgrading alone is not sufficient to fix this problem.
    via by Hanis Suhailah,
  • GitHub comment 49#33458355
    via GitHub by tgruenert
    ,
  • The offending code is in {{BranchVersion.compareTo}}. We should probably just throw a more meaningful exception, as without numeric components trying to compare the branches is not a great idea. {noformat} c.a.s.i.e.AsyncBatchingInvokersTransformer There was an exception thrown trying to dispatch event 'com.atlassian.stash.event.pull.PullRequestMergedEvent[source=com.atlassian.stash.internal.pull.PullRequestServiceImpl@2bfc34d3]' for the invoker 'SingleParameterMethodListenerInvoker{method=public void com.atlassian.stash.internal.branch.automerge.AutoMergePullRequestProcessor.onPullRequestMerged(com.atlassian.stash.event.pull.PullRequestMergedEvent), listener=com.atlassian.stash.internal.branch.automerge.AutoMergePullRequestProcessor@3d1fc30e}'. java.lang.RuntimeException: index (-1) must not be negative at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54) ~[atlassian-event-2.3.5.jar:na] at com.atlassian.stash.internal.event.AsyncBatchingInvokersTransformer$AsyncInvokerBatch.invoke(AsyncBatchingInvokersTransformer.java:100) ~[stash-platform-3.2.0.jar:na] at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:48) [atlassian-event-2.3.5.jar:na] at com.atlassian.sal.core.executor.ThreadLocalDelegateRunnable.run(ThreadLocalDelegateRunnable.java:38) [sal-core-2.12.1.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_60] at java.lang.Thread.run(Thread.java:745) [na:1.7.0_60] ... 1 frame trimmed Caused by: java.lang.IndexOutOfBoundsException: index (-1) must not be negative at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:301) ~[guava-11.0.2-atlassian-01.jar:na] at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:280) ~[guava-11.0.2-atlassian-01.jar:na] at com.google.common.collect.SingletonImmutableList.get(SingletonImmutableList.java:46) ~[guava-11.0.2-atlassian-01.jar:na] at com.atlassian.stash.internal.branch.model.version.BranchVersion.componentAt(BranchVersion.java:155) ~[na:na] at com.atlassian.stash.internal.branch.model.version.BranchVersion.compareTo(BranchVersion.java:67) ~[na:na] at com.atlassian.stash.internal.branch.model.version.VersionedBranch.compareTo(VersionedBranch.java:84) ~[na:na] at com.atlassian.stash.internal.branch.model.version.VersionedBranch$4.apply(VersionedBranch.java:77) ~[na:na] at com.atlassian.stash.internal.branch.model.version.VersionedBranch$4.apply(VersionedBranch.java:74) ~[na:na] at com.google.common.base.Predicates$AndPredicate.apply(Predicates.java:338) ~[guava-11.0.2-atlassian-01.jar:na] at com.google.common.collect.Iterators$7.computeNext(Iterators.java:649) ~[guava-11.0.2-atlassian-01.jar:na] at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143) ~[guava-11.0.2-atlassian-01.jar:na] at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) ~[guava-11.0.2-atlassian-01.jar:na] at com.google.common.collect.Lists.newArrayList(Lists.java:138) ~[guava-11.0.2-atlassian-01.jar:na] at com.google.common.collect.Lists.newArrayList(Lists.java:119) ~[guava-11.0.2-atlassian-01.jar:na] at com.google.common.collect.NaturalOrdering.sortedCopy(NaturalOrdering.java:57) ~[guava-11.0.2-atlassian-01.jar:na] at com.google.common.collect.Ordering.immutableSortedCopy(Ordering.java:534) ~[guava-11.0.2-atlassian-01.jar:na] at com.atlassian.stash.util.Chainable.sort(Chainable.java:102) ~[stash-util-3.2.0.jar:na] at com.atlassian.stash.internal.branch.model.SimpleBranchModel.getMergePath(SimpleBranchModel.java:72) ~[na:na] at com.atlassian.stash.internal.branch.automerge.DefaultAutoMergeService$$anonfun$getDownstreamBranches$2.apply(DefaultAutoMergeService.scala:44) ~[na:na] at {noformat}
    via by Dariusz Kordonski [Atlassian],
    • java.lang.RuntimeException: deleted object would be re-saved by cascade (remove deleted object from associations): 17596426, of class: com.atlassian.confluence.spaces.Space; nested exception is net.sf.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): 17596426, of class: com.atlassian.confluence.spaces.Space at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54)
    No Bugmate found.