Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-9862

Deletion of repository with commit comments created prior to 5.0 fails

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • 5.2.0, 5.0.5, 5.1.3
    • 4.12.1, 5.0.2, 5.0.4
    • None
    • None

      This issue is essentially identical https://jira.atlassian.com/browse/BSERV-9790

      Summary

      When attempting to delete a repository that has commit comments created prior to 5.0, deletion fails

      Steps to Reproduce

      1. Start a new instance of Bitbucket 4.14
      2. Create a test repo with at least one commit, then go to Commits >> <any commit> and add a comment directly in the diff view
      3. Upgrade to Bitbucket 5.1.1
      4. Attempt to delete the repo

      Expected Results

      Repo deletes successfully

      Actual Results

      Deletion fails with the following error:

      atlassian-bitbucket.log
      2017-06-23 12:14:07,615 WARN  [http-nio-7990-exec-10] admin @YPN8POx734x118x0 1bugxax 172.18.0.1 "DELETE /projects/TEST/repos/test02 HTTP/1.1" o.h.e.jdbc.spi.SqlExceptionHelper SQL Error: 0, SQLState: 23503
      2017-06-23 12:14:07,616 ERROR [http-nio-7990-exec-10] admin @YPN8POx734x118x0 1bugxax 172.18.0.1 "DELETE /projects/TEST/repos/test02 HTTP/1.1" o.h.e.jdbc.spi.SqlExceptionHelper ERROR: update or delete on table "sta_cmt_discussion" violates foreign key constraint "fk_sta_cmt_disc_com_anc_disc" on table "sta_cmt_disc_comment_anchor"
        Detail: Key (id)=(1) is still referenced from table "sta_cmt_disc_comment_anchor".
      2017-06-23 12:14:07,622 WARN  [http-nio-7990-exec-10] admin @YPN8POx734x118x0 1bugxax 172.18.0.1 "DELETE /projects/TEST/repos/test02 HTTP/1.1" o.hibernate.hql.spi.id.local.Helper unable to drop temporary id table afterQuery use [ERROR: current transaction is aborted, commands ignored until end of transaction block]
      

      (Note: this is a postgres instance)

      Workaround

      Manually drop the fk_sta_cmt_disc_com_anc_disc constraint to delete the repo

            [BSERV-9862] Deletion of repository with commit comments created prior to 5.0 fails

            Owen made changes -
            Workflow Original: Stash Workflow - Restricted [ 2402043 ] New: JAC Bug Workflow v3 [ 3137089 ]
            Owen made changes -
            Symptom Severity Original: Minor [ 14432 ] New: Severity 3 - Minor [ 15832 ]
            Caterina Curti made changes -
            Affects Version/s New: 5.0.2 [ 72009 ]
            Jonathan McDaniel (Inactive) made changes -
            Affects Version/s New: 4.12.1 [ 65631 ]
            Michael Andreacchio made changes -
            Remote Link New: This issue links to "Page (Extranet)" [ 310159 ]
            Felix (Inactive) made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: Open [ 1 ] New: Closed [ 6 ]
            Felix (Inactive) made changes -
            Affects Version/s Original: 5.1.1 [ 72404 ]
            Felix (Inactive) made changes -
            Affects Version/s New: 5.0.4 [ 72432 ]
            Felix (Inactive) made changes -
            Status Original: Needs Triage [ 10030 ] New: Open [ 1 ]
            Felix (Inactive) made changes -
            Fix Version/s New: 5.0.5 [ 72634 ]
            Fix Version/s New: 5.1.3 [ 72635 ]
            Fix Version/s New: 5.2.0 [ 71978 ]

              fhaehnel Felix (Inactive)
              dchevell Dave Chevell
              Affected customers:
              0 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: