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

            Katherine Yabut made changes -
            Workflow Original: JAC Bug Workflow v3 [ 2897572 ] New: CONFSERVER Bug Workflow v4 [ 2991922 ]
            Owen made changes -
            Workflow Original: JAC Bug Workflow v2 [ 2789391 ] New: JAC Bug Workflow v3 [ 2897572 ]
            Status Original: Resolved [ 5 ] New: Closed [ 6 ]
            Owen made changes -
            Workflow Original: JAC Bug Workflow [ 2719605 ] New: JAC Bug Workflow v2 [ 2789391 ]
            Owen made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2388726 ] New: JAC Bug Workflow [ 2719605 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 [ 2265647 ] New: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2388726 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5.1 - TEMP [ 2209229 ] New: Confluence Workflow - Public Facing - Restricted v5 [ 2265647 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2193136 ] New: Confluence Workflow - Public Facing - Restricted v5.1 - TEMP [ 2209229 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 [ 1933285 ] New: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2193136 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v3 [ 1733069 ] New: Confluence Workflow - Public Facing - Restricted v5 [ 1933285 ]
            Katherine Yabut made changes -
            Workflow Original: CONF Bug Subtask WF (TEMP) [ 1689631 ] New: Confluence Workflow - Public Facing - Restricted v3 [ 1733069 ]

              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: