origam.com

Workflow fails because of an error in adding a row to the trace log

When a workflow step calls a sub-workflow from the Root package that adds an entry to a work queue and the sub-workflow is traced, it fails. When the trace is turned off the workflow works fine.

2021-11-08 10:51:59,077 [Workflow c840f82d-a66b-4dac-9193-f8c5e171cadf] ERROR Origam.DA.Service.AbstractSqlDataService - Update failed
System.Data.SqlClient.SqlException (0x80131904): The INSERT statement conflicted with the FOREIGN KEY constraint "FK_AsapTraceWorkflowStep_refAsapTraceWorkflowId_AsapTraceWorkflow". The conflict occurred in database "wyby_data", table "dbo.OrigamTraceWorkflow", column 'Id'.
The statement has been terminated.
   at System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
   at System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
   at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
   at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
   at System.Data.Common.DbDataAdapter.Update(DataTable dataTable)
   at Origam.DA.Service.AbstractSqlDataService.ExecuteUpdate(DataStructureQuery query, String transactionId, UserProfile profile, DataStructure ds, IDbTransaction transaction, IDbConnection connection, ArrayList deletedRowIds, DataTable changedTable, DataRowState rowState, DataStructureEntity entity, Int32 rowCount, Boolean forceBulkInsert) in D:\a\1\s\origam-source\Origam.DA.Service\AbstractSqlDataService.cs:line 851
   at Origam.DA.Service.AbstractSqlDataService.<>c__DisplayClass23_2.<UpdateData>b__0() in D:\a\1\s\origam-source\Origam.DA.Service\AbstractSqlDataService.cs:line 563
   at Origam.DA.Service.Profiler.ExecuteAndTakeLoggingAction(DataStructureEntity entity, Action`2 loggingAction, Action actionToExecute) in D:\a\1\s\origam-source\Origam.DA.Service\AbstractSqlDataService.cs:line 2698
   at Origam.DA.Service.AbstractSqlDataService.UpdateData(DataStructureQuery query, IPrincipal userProfile, DataSet dataset, String transactionId, Boolean forceBulkInsert) in D:\a\1\s\origam-source\Origam.DA.Service\AbstractSqlDataService.cs:line 569
ClientConnectionId:16c8026a-24b9-49d7-b90a-91048fb38e5f
Error Number:547,State:0,Class:16
2021-11-08 10:51:59,412 [Workflow c840f82d-a66b-4dac-9193-f8c5e171cadf] ERROR Origam.Workflow.WorkflowEngine - ServiceMethodCallTask 02_Send_byQueue failed.
2021-11-08 10:51:59,419 [Workflow c840f82d-a66b-4dac-9193-f8c5e171cadf] ERROR Origam.Workflow.WorkflowEngine - Object reference not set to an instance of an object.
Origam.OrigamException: Object reference not set to an instance of an object.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Origam.Workflow.WorkQueueServiceAgent.TraceLog(String parameter) in D:\a\1\s\origam-source\Origam.Workflow\Service Agents\WorkQueueServiceAgent.cs:line 139
   at Origam.Workflow.WorkQueueServiceAgent.Add(IWorkQueueService wqs) in D:\a\1\s\origam-source\Origam.Workflow\Service Agents\WorkQueueServiceAgent.cs:line 174
   at Origam.Workflow.WorkQueueServiceAgent.Run() in D:\a\1\s\origam-source\Origam.Workflow\Service Agents\WorkQueueServiceAgent.cs:line 58
   at Origam.Workflow.Tasks.ServiceMethodCallEngineTask.OnExecute() in D:\a\1\s\origam-source\Origam.Workflow\Tasks\ServiceMethodCallEngineTask.cs:line 213
   at Origam.Workflow.ProfilingTools.<>c__DisplayClass4_0.<ExecuteAndLogDuration>g__FuncToExecute|0() in D:\a\1\s\origam-source\Origam.Workflow\ProfilingTools.cs:line 68
   at Origam.Workflow.ProfilingTools.ExecuteAndLogDuration(Func`1 funcToExecute, String logEntryType, String path, String id, Func`1 logOnlyIf) in D:\a\1\s\origam-source\Origam.Workflow\ProfilingTools.cs:line 108
   at Origam.Workflow.ProfilingTools.ExecuteAndLogDuration(Action action, String logEntryType, String path, String id, Func`1 logOnlyIf) in D:\a\1\s\origam-source\Origam.Workflow\ProfilingTools.cs:line 72
   at Origam.Workflow.Tasks.AbstractWorkflowEngineTask.MeasuredExecution() in D:\a\1\s\origam-source\Origam.Workflow\Tasks\AbstractWorkflowEngineTask.cs:line 100
   at Origam.Workflow.Tasks.ServiceMethodCallEngineTask.Execute() in D:\a\1\s\origam-source\Origam.Workflow\Tasks\ServiceMethodCallEngineTask.cs:line 71
   --- End of inner exception stack trace ---