There is some kind of database error happening when I use the customer interface to reply to a ticket and check the box for "This ticket can be closed".
To reproduce:
- As a customer, start a new ticket. (In my system it is created via the API - not sure if this matters).
- I received the autoresponder e-mail and clicked the link to view the ticket online.
- I entered a random reply and check the box for "This ticket can be closed".
- When I click Send Reply it throws an error.
I tried again without checking the box and there was no error.
The error message in the Error log is:
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_st_TicketComments_st_Users". The conflict occurred in database "SmarterTrack", table "dbo.st_Users", column 'UserID'. The statement has been terminated. System.Data.SqlClient.SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "FK_st_TicketComments_st_Users". The conflict occurred in database "SmarterTrack", table "dbo.st_Users", column 'UserID'. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader() at SmarterTrack.Data.SqlHelperInternal.ExecuteReader(SqlConnection connection, SqlTransaction transaction, CommandType commandType, String commandText, SqlParameter[] commandParameters, SqlConnectionOwnership connectionOwnership) at SmarterTrack.Data.SqlHelper.ExecuteReader(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) at SmarterTrack.Data.TicketCommentEntityBase.Save_SQL(IDbConnection& connection) at SmarterTrack.Data.TicketCommentEntityBase.Save(IDbConnection& connection) at SmarterTrack.Data.TicketCommentEntityBase.Save() at SmarterTrack.Data.TicketCommentEntity.Save(Int32 userDoingAction) at SmarterTrack.HelperClasses.Tickets.TicketHelper.AddResourceStringComment(Int32 ticketId, Int32 savedByUserId, CommentTypes type, String resourceStringName) at SmarterTrack.MRS.Main.frmTicket.TicketNext_Click(Object sender, EventArgs e) at System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ClientConnectionId:b1645af7-fc76-448f-a28b-b06a1a0dac6f Error Number:547,State:0,Class:16
I didn't do any additional debugging, so maybe it's because I did not interact with the ticket on the management side before replying -- I have no idea.