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

Attachment migration from filesystem to database results in DataIntegrityViolationException while removing space

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Medium Medium
    • None
    • 2.5.7
    • None

      The problem of space removal when attachments are stored within the database occurred and generated the following error exception:

      2008-03-25 13:11:45,359 ERROR [http-8484-Processor3] [atlassian.xwork.interceptors.XWorkTransactionInterceptor] onThrowable Invoking rollback for transaction on action '/spaces/doremovespace.action (RemoveSpaceAction.doRemove())' due to throwable: org.springframework.dao.DataIntegrityViolationException: (Hibernate operation): data integrity violated by SQL ''; nested exception is java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`confdb_257_csp16708/attachmentdata`, CONSTRAINT `FK9DC3E34D34A4917E` FOREIGN KEY (`ATTACHMENTID`) REFERENCES `attachments` (`ATTACHMENTID`))
      
       -- url: /spaces/doremovespace.action | userName: admin
      org.springframework.dao.DataIntegrityViolationException: (Hibernate operation): data integrity violated by SQL ''; nested exception is java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`confdb_257_csp16708/attachmentdata`, CONSTRAINT `FK9DC3E34D34A4917E` FOREIGN KEY (`ATTACHMENTID`) REFERENCES `attachments` (`ATTACHMENTID`))
      
      java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`confdb_257_csp16708/attachmentdata`, CONSTRAINT `FK9DC3E34D34A4917E` FOREIGN KEY (`ATTACHMENTID`) REFERENCES `attachments` (`ATTACHMENTID`))
      
      	at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:648)
      

      The same happened while using the embedded DB.

      Steps to replicate:

      1. Migrate attachment storage to database
      2. Delete the space (Please try the space export from CSP-16708)

            [CONFSERVER-11218] Attachment migration from filesystem to database results in DataIntegrityViolationException while removing space

            Hi Mei Yan Chan

            This issue has now been open for 6 years with very little movement. Rather than leave this on the backlog I am going to close is 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'll re-address this status and look at implementing a fix

            Regards
            Steve Haffenden
            Confluence Bugmaster
            Atlassian

            Steve Haffenden (Inactive) added a comment - Hi Mei Yan Chan This issue has now been open for 6 years with very little movement. Rather than leave this on the backlog I am going to close is 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'll re-address this status and look at implementing a fix Regards Steve Haffenden Confluence Bugmaster Atlassian

            Adding a unique constraint for CONF-7882 will require making the attachmentid column in attachmentdata to be not-null, thus any parentless rows will need to be dropped beforehand, and this bug will be fixed.

            Don Willis added a comment - Adding a unique constraint for CONF-7882 will require making the attachmentid column in attachmentdata to be not-null, thus any parentless rows will need to be dropped beforehand, and this bug will be fixed.

              shaffenden Steve Haffenden (Inactive)
              meiyan.chan@atlassian.com Mei Yan Chan [Atlassian]
              Affected customers:
              0 This affects my team
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: