1
SmarterTrack throws error when replying to ticket and checking box to close it
Problem reported by Speednet - 2/17/2019 at 5:24 PM
Resolved
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:

  1. As a customer, start a new ticket. (In my system it is created via the API - not sure if this matters).
  2. I received the autoresponder e-mail and clicked the link to view the ticket online.
  3. I entered a random reply and check the box for "This ticket can be closed".
  4. 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.

2 Replies

Reply to Thread
0
Andrew Barker Replied
Employee Post
We have added this to our internal tracking system for further investigation.
Andrew Barker Software Developer SmarterTools Inc. www.smartertools.com
0
Andrew Barker Replied
Employee Post Marked As Resolution
After internal discussion, we made the decision to prevent unauthenticated users from being able to reply to a ticket from the portal. Since this error only occurred if the user was not authenticated, it will no longer be an issue. This change was made in build 7005, which was released yesterday.
Andrew Barker Software Developer SmarterTools Inc. www.smartertools.com

Reply to Thread