Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-15964

Unable to purge the trash if notification for old version of a page is present

      1. View an old version of a page
      2. Choose "Watch" from the tools menu
      3. View the current version of that page
      4. Remove that page
      5. Go to space admin and purge the trash
      6. You will get an exception because of a foreign key constraint

      The problem here is that purging the trash does not delete notifications on old versions of a page (which should never exist anyway).

      Workaround

      Backup your database before attempting to perform this! (the following removes all notifications from all deleted pages in the space):

      1. Identify the SPACEID of the space which you are trying to purge all trash from, via this query:
        SELECT * FROM SPACES;
        
      2. Use the SPACEID in the following query (this query is applicable to Confluence 5.3 only):
        DELETE FROM NOTIFICATIONS WHERE CONTENTID IN (SELECT CONTENTID FROM CONTENT WHERE (CONTENT_STATUS = 'deleted' AND SPACEID = <SPACEID>) OR PREVVER IN (SELECT CONTENTID FROM CONTENT WHERE CONTENT_STATUS = 'deleted' AND SPACEID = <SPACEID>));
        
      3. Run the query above, then try to purge the trash again

            [CONFSERVER-15964] Unable to purge the trash if notification for old version of a page is present

            Hi Gurleen

            Thanks for taking the time to raise this issue. This has been on our backlog now for 5 years with very little movement in that time. Rather than leave this here I'm going to close this issue out as won't fix, I believe that this better reflects the status of this issue.

            If the problem is raised again in the future we will re-address it.

            Regards
            Steve Haffenden
            Confluence Bugmaster
            Atlassian

            Steve Haffenden (Inactive) added a comment - Hi Gurleen Thanks for taking the time to raise this issue. This has been on our backlog now for 5 years with very little movement in that time. Rather than leave this here I'm going to close this issue out as won't fix, I believe that this better reflects the status of this issue. If the problem is raised again in the future we will re-address it. Regards Steve Haffenden Confluence Bugmaster Atlassian

            Hi everyone

            I'm going to regrade this issue as a major rather than a critical issue. The impact here seems to be that an exception is generated. It does not crash Confluence, does not cause a loss of data and does not cause a major memory leak. In addition this issue has been open for 4+ years.

            Regards
            Steve Haffenden
            Confluence Bugmaster
            Atlassian

            Steve Haffenden (Inactive) added a comment - Hi everyone I'm going to regrade this issue as a major rather than a critical issue. The impact here seems to be that an exception is generated. It does not crash Confluence, does not cause a loss of data and does not cause a major memory leak. In addition this issue has been open for 4+ years. Regards Steve Haffenden Confluence Bugmaster Atlassian

            Here is the log file extract:

            2009-05-28 19:45:14,480 ERROR [TP-Processor2420] [sf.hibernate.util.JDBCExceptionReporter] logExceptions ERROR: update or delete on table "content" violates foreign key constraint "fk594acc88c38fbea" on table "notifications"
              Detail: Key (contentid)=(182682701) is still referenced from table "notifications".
             -- space: 20 | url: /pages/doemptytrash.action | userName: ckiehl | referer: http://confluence.atlassian.com/pages/emptytrash.action?key=JIRAEXT | action: doemptytrash
            2009-05-28 19:45:14,482 ERROR [TP-Processor2420] [sf.hibernate.impl.SessionImpl] execute Could not synchronize database state with session
             -- space: 20 | url: /pages/doemptytrash.action | userName: ckiehl | referer: http://confluence.atlassian.com/pages/emptytrash.action?key=JIRAEXT | action: doemptytrash
            2009-05-28 19:45:14,485 ERROR [TP-Processor2420] [atlassian.xwork.interceptors.TransactionalInvocation] commitOrRollbackTransaction Action /pages/doemptytrash.action (EmptyTrashAction.execute()) is already completed and can not be committ
            ed again.
             -- url: /pages/doemptytrash.action | userName: ckiehl | referer: http://confluence.atlassian.com/pages/emptytrash.action?key=JIRAEXT
            2009-05-28 19:45:14,486 ERROR [TP-Processor2420] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action
             -- url: /pages/doemptytrash.action | userName: ckiehl | referer: http://confluence.atlassian.com/pages/emptytrash.action?key=JIRAEXT
            org.springframework.transaction.IllegalTransactionStateException: Transaction is already completed - do not call commit or rollback more than once per transaction
                    at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:725)
                    at com.atlassian.xwork.interceptors.TransactionalInvocation.commitOrRollbackTransaction(TransactionalInvocation.java:93)
                    at com.atlassian.xwork.interceptors.TransactionalInvocation.invokeInTransaction(TransactionalInvocation.java:63)
                    at com.atlassian.xwork.interceptors.XWorkTransactionInterceptor.intercept(XWorkTransactionInterceptor.java:56)
                    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
                    at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
                    at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
                    at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:115)
                    at com.atlassian.confluence.servlet.ConfluenceServletDispatcher.serviceAction(ConfluenceServletDispatcher.java:53)
                    at com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:199)
            

            Chris Kiehl added a comment - Here is the log file extract: 2009-05-28 19:45:14,480 ERROR [TP-Processor2420] [sf.hibernate.util.JDBCExceptionReporter] logExceptions ERROR: update or delete on table "content" violates foreign key constraint "fk594acc88c38fbea" on table "notifications" Detail: Key (contentid)=(182682701) is still referenced from table "notifications". -- space: 20 | url: /pages/doemptytrash.action | userName: ckiehl | referer: http://confluence.atlassian.com/pages/emptytrash.action?key=JIRAEXT | action: doemptytrash 2009-05-28 19:45:14,482 ERROR [TP-Processor2420] [sf.hibernate.impl.SessionImpl] execute Could not synchronize database state with session -- space: 20 | url: /pages/doemptytrash.action | userName: ckiehl | referer: http://confluence.atlassian.com/pages/emptytrash.action?key=JIRAEXT | action: doemptytrash 2009-05-28 19:45:14,485 ERROR [TP-Processor2420] [atlassian.xwork.interceptors.TransactionalInvocation] commitOrRollbackTransaction Action /pages/doemptytrash.action (EmptyTrashAction.execute()) is already completed and can not be committ ed again. -- url: /pages/doemptytrash.action | userName: ckiehl | referer: http://confluence.atlassian.com/pages/emptytrash.action?key=JIRAEXT 2009-05-28 19:45:14,486 ERROR [TP-Processor2420] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action -- url: /pages/doemptytrash.action | userName: ckiehl | referer: http://confluence.atlassian.com/pages/emptytrash.action?key=JIRAEXT org.springframework.transaction.IllegalTransactionStateException: Transaction is already completed - do not call commit or rollback more than once per transaction at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:725) at com.atlassian.xwork.interceptors.TransactionalInvocation.commitOrRollbackTransaction(TransactionalInvocation.java:93) at com.atlassian.xwork.interceptors.TransactionalInvocation.invokeInTransaction(TransactionalInvocation.java:63) at com.atlassian.xwork.interceptors.XWorkTransactionInterceptor.intercept(XWorkTransactionInterceptor.java:56) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165) at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:115) at com.atlassian.confluence.servlet.ConfluenceServletDispatcher.serviceAction(ConfluenceServletDispatcher.java:53) at com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:199)

              shaffenden Steve Haffenden (Inactive)
              ckiehl Chris Kiehl
              Affected customers:
              2 This affects my team
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: