Thread

Skip Navigation LinksForums > SpiraTest Forums > SpiraTest Issues & Questi... > Can't delete a project

Can't delete a project RSS Feed

Tuesday, May 1, 2012
Trying to delete a project from a partial/failed import from HP QC 10.

When I try the delete, ST says it can't. Application log shows:

APPLICATION.Business.DataAccess::ExecuteNonQuery: The DELETE statement conflicted with the REFERENCE constraint "FK_TST_PROJECT_TST_ARTIFACT_ATTACHMENT". The conflict occurred in database "SpiraTest", table "dbo.TST_ARTIFACT_ATTACHMENT", column 'PROJECT_ID'. The statement has been terminated. [System.Data.SqlClient.SqlException] Stack Trace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at APPLICATION.Business.DataAccess.ExecuteNonQuery(String sqlCommand, Boolean useParam)
3 Replies
Adam SAdam S
re: Matt Warren on Tuesday, May 1, 2012
Thursday, May 24, 2012

To give specific support on this issue, please contact Inflectra support. It looks like an attachment that has gotten cross-linked across a project. There is a SQL command that should fix it:

DELETE FROM TST_ARTIFACT_ATTACHMENT WHERE PROJECT_ID = X

(where X is the ID of the project in SpiraTest)

Christoph BruendlerChristoph Bruendler
re: Adam S on Thursday, May 24, 2012
Wednesday, July 25, 2012
There is still a project I can't delete... Here is what we found in Application log:

we got several entries here just the first one (as pasting two much, fills up the capacity of the text field):

Error 1

 APPLICATION.Business.DataAccess::ExecuteNonQuery:

The DELETE statement conflicted with the REFERENCE constraint "FK_TST_PROJECT_ATTACHMENT_TYPE_TST_PROJECT_ATTACHMENT". The conflict occurred in database "SpiraTeam", table "dbo.TST_PROJECT_ATTACHMENT", column 'PROJECT_ATTACHMENT_TYPE_ID'.

The statement has been terminated. [System.Data.SqlClient.SqlException]

 

Stack Trace:

   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()

   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)

   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)

   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

   at APPLICATION.Business.DataAccess.ExecuteNonQuery(String sqlCommand, Boolean useParam)

 

Error 2

 APPLICATION.Business.Attachment::DeleteAllProjectAttachmentInfo: Database foreign key violation occurred [APPLICATION.Business.DataAccessForeignKeyException]

etc....

I have delete the only incident in that project, and the table dbo.TST_ARTIFACT_ATTACHMENT" does not contain any record for this project anymore.

What shall we try next?
Adam SAdam S
re: Christoph Bruendler on Wednesday, July 25, 2012
Friday, July 27, 2012
It looks like you have some project attachment types that have somehow gotten linked to attachments in a different project. You need to get a list of all the PROJECT_ATTACHMENT_TYPE_IDs in the project you're deleting and make sure that all attachments (TST_PROJECT_ATTACHMENT) in other projects are not using them.
Tagged
Statistics
  • Started: 5/1/2012
  • Last Reply: 7/27/2012
  • Replies: 3
  • Views: 866
Powered by KronoDesk v1.1.0.15 | © Copyright Inflectra Corporation 2011-2016 | Licensed to Inflectra Corporation.