com.atlassian.stash.repository.RepositoryDeletionCanceledException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Deleting repositories with a large number of comments _can_ fail on SQL Server with an error like: {noformat} 2014-03-14 16:06:03,744 DEBUG [http-bio-7990-exec-10634] jdoe 966x1670694x3 2tmzqw1 54.240.197.225,127.0.0.1 "DELETE /projects/KEY/repos/slug HTTP/1.1" c.a.s.r.e.ServiceExceptionMapper Mapping ServiceException to REST response 400 com.atlassian.stash.repository.RepositoryDeletionCanceledException: Repository deletion was canceled. at com.atlassian.stash.internal.repository.RepositoryServiceImpl.fireRepositoryDeletionRequested(RepositoryServiceImpl.java:562) ~[stash-service-impl-2.5.0.jar:na] at com.atlassian.stash.internal.repository.RepositoryServiceImpl.access$000(RepositoryServiceImpl.java:56) ~[stash-service-impl-2.5.0.jar:na] at com.atlassian.stash.internal.repository.RepositoryServiceImpl$1.doInTransaction(RepositoryServiceImpl.java:168) ~[stash-service-impl-2.5.0.jar:na] at com.atlassian.stash.internal.repository.RepositoryServiceImpl$1.doInTransaction(RepositoryServiceImpl.java:164) ~[stash-service-impl-2.5.0.jar:na] at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131) ~[spring-tx-3.2.2.RELEASE.jar:3.2.2.RELEASE] at com.atlassian.stash.internal.repository.RepositoryServiceImpl.delete(RepositoryServiceImpl.java:164) ~[stash-service-impl-2.5.0.jar:na] at sun.reflect.GeneratedMethodAccessor21510.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.6.0_27] Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The DELETE statement conflicted with the SAME TABLE REFERENCE constraint "fk_sta_comment_parent". The conflict occurred in database "stashlhr10", table "dbo.sta_comment", column 'parent_id'. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) ~[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515) ~[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404) ~[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350) ~[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696) ~[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715) ~[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180) ~[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155) ~[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:314) ~[sqljdbc-4.0.2206.jar:na] at com.jolbox.bonecp.PreparedStatementHandle.executeUpdate(PreparedStatementHandle.java:203) ~[bonecp-0.7.1.RELEASE.jar:0.7.1.RELEASE] at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:133) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final] ... 308 common frames omitted {noformat} This is unique to SQL Server, due to how {{ON DELETE CASCADE}} clauses are processed for foreign keys, and cannot affect any other database.
    via by Bryan Turner,
  • Deleting repositories with a large number of comments _can_ fail on SQL Server with an error like: {noformat} 2014-03-14 16:06:03,744 DEBUG [http-bio-7990-exec-10634] jdoe 966x1670694x3 2tmzqw1 54.240.197.225,127.0.0.1 "DELETE /projects/KEY/repos/slug HTTP/1.1" c.a.s.r.e.ServiceExceptionMapper Mapping ServiceException to REST response 400 com.atlassian.stash.repository.RepositoryDeletionCanceledException: Repository deletion was canceled. at com.atlassian.stash.internal.repository.RepositoryServiceImpl.fireRepositoryDeletionRequested(RepositoryServiceImpl.java:562) ~[stash-service-impl-2.5.0.jar:na] at com.atlassian.stash.internal.repository.RepositoryServiceImpl.access$000(RepositoryServiceImpl.java:56) ~[stash-service-impl-2.5.0.jar:na] at com.atlassian.stash.internal.repository.RepositoryServiceImpl$1.doInTransaction(RepositoryServiceImpl.java:168) ~[stash-service-impl-2.5.0.jar:na] at com.atlassian.stash.internal.repository.RepositoryServiceImpl$1.doInTransaction(RepositoryServiceImpl.java:164) ~[stash-service-impl-2.5.0.jar:na] at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131) ~[spring-tx-3.2.2.RELEASE.jar:3.2.2.RELEASE] at com.atlassian.stash.internal.repository.RepositoryServiceImpl.delete(RepositoryServiceImpl.java:164) ~[stash-service-impl-2.5.0.jar:na] at sun.reflect.GeneratedMethodAccessor21510.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.6.0_27] Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The DELETE statement conflicted with the SAME TABLE REFERENCE constraint "fk_sta_comment_parent". The conflict occurred in database "stashlhr10", table "dbo.sta_comment", column 'parent_id'. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) ~[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515) ~[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404) ~[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350) ~[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696) ~[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715) ~[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180) ~[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155) ~[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:314) ~[sqljdbc-4.0.2206.jar:na] at com.jolbox.bonecp.PreparedStatementHandle.executeUpdate(PreparedStatementHandle.java:203) ~[bonecp-0.7.1.RELEASE.jar:0.7.1.RELEASE] at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:133) ~[hibernate-core-4.2.1.Final.jar:4.2.1.Final] ... 308 common frames omitted {noformat} This is unique to SQL Server, due to how {{ON DELETE CASCADE}} clauses are processed for foreign keys, and cannot affect any other database.
    via by Bryan Turner,
    • com.atlassian.stash.repository.RepositoryDeletionCanceledException: Repository deletion was canceled. at com.atlassian.stash.internal.repository.RepositoryServiceImpl.fireRepositoryDeletionRequested(RepositoryServiceImpl.java:562)[stash-service-impl-2.5.0.jar:na] at com.atlassian.stash.internal.repository.RepositoryServiceImpl.access$000(RepositoryServiceImpl.java:56)[stash-service-impl-2.5.0.jar:na] at com.atlassian.stash.internal.repository.RepositoryServiceImpl$1.doInTransaction(RepositoryServiceImpl.java:168)[stash-service-impl-2.5.0.jar:na] at com.atlassian.stash.internal.repository.RepositoryServiceImpl$1.doInTransaction(RepositoryServiceImpl.java:164)[stash-service-impl-2.5.0.jar:na] at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131)[spring-tx-3.2.2.RELEASE.jar:3.2.2.RELEASE] at com.atlassian.stash.internal.repository.RepositoryServiceImpl.delete(RepositoryServiceImpl.java:164)[stash-service-impl-2.5.0.jar:na] at sun.reflect.GeneratedMethodAccessor21510.invoke(Unknown Source)[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.6.0_27] Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The DELETE statement conflicted with the SAME TABLE REFERENCE constraint "fk_sta_comment_parent". The conflict occurred in database "stashlhr10", table "dbo.sta_comment", column 'parent_id'. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515)[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404)[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350)[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180)[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155)[sqljdbc-4.0.2206.jar:na] at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:314)[sqljdbc-4.0.2206.jar:na] at com.jolbox.bonecp.PreparedStatementHandle.executeUpdate(PreparedStatementHandle.java:203)[bonecp-0.7.1.RELEASE.jar:0.7.1.RELEASE] at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:133)[hibernate-core-4.2.1.Final.jar:4.2.1.Final] ... 8 more

    Users with the same issue

    SteVio1989
    2 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    83 more bugmates