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
- Start a new instance of Bitbucket 4.14
- Create a test repo with at least one commit, then go to Commits >> <any commit> and add a comment directly in the diff view
- Upgrade to Bitbucket 5.1.1
- 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
- is related to
-
BSERV-9790 Repository and Pull Request deletion fails due to Database error
-
- Closed
-
- mentioned in
-
Page Failed to load