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

    XMLWordPrintable

Details

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

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              fhaehnel Felix
              dchevell Dave Chevell
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: