DataService UpdateReferences returns error Specified cast is not valid

Hello,

I was trying to run deduplication workflow I had made some time back and it does not work. Workflow ends on task UpdateReferences. As far as I remember it was working (given the fact that it’s in production model).

Here is the log from trace:

Specified cast is not valid.

at CZ.Advantages.Asap.DA.Service.AbstractDataService.GetLog(DataTable table, UserProfile profile, String transactionId, Int32 overrideActionType)
at CZ.Advantages.Asap.DA.Service.AbstractSqlDataService.LogData(DataTable changedTable, UserProfile profile, String transactionId, IDbConnection connection, IDbTransaction transaction, Int32 overrideActionType)
at CZ.Advantages.Asap.DA.Service.AbstractSqlDataService.UpdateField(Guid entityId, Guid fieldId, Object oldValue, Object newValue, IPrincipal userProfile, String transactionId)
at CZ.Advantages.Asap.Workflow.DataServiceAgent.UpdateReferences(Guid entityId, Object oldValue, Object newValue) in d:\BuildServer\TeamCity\buildAgent\work\4d047c3a021b26c8\architect\CZ.Advantages.Asap.Workflow\Service Agents\DataServiceAgent.cs:line 386
at CZ.Advantages.Asap.Workflow.DataServiceAgent.Run() in d:\BuildServer\TeamCity\buildAgent\work\4d047c3a021b26c8\architect\CZ.Advantages.Asap.Workflow\Service Agents\DataServiceAgent.cs:line 598
at CZ.Advantages.Asap.Workflow.Tasks.ServiceMethodCallEngineTask.OnExecute() in d:\BuildServer\TeamCity\buildAgent\work\4d047c3a021b26c8\architect\CZ.Advantages.Asap.Workflow\Tasks\ServiceMethodCallEngineTask.cs:line 154
at CZ.Advantages.Asap.Workflow.Tasks.AbstractWorkflowEngineTask.Execute() in d:\BuildServer\TeamCity\buildAgent\work\4d047c3a021b26c8\architect\CZ.Advantages.Asap.Workflow\Tasks\AbstractWorkflowEngineTask.cs:line 101

Aren’t there any recent changes? Or am I missing something obvious?

I don’ see a line number on the last line of the stack trace. Are you missing a PDB file from CZ.Advantages.Asap.DA.Service? It would help to see the line number to investigate further.

I posted debug from Architect Trace. This one below is from log and I believe it’s the one you are looking for.

2017-10-04 13:46:59,870 [2080] ERROR CZ.Advantages.Asap.Workflow.DataServiceAgent [(null)] <(null)> - Updating references failed.
System.InvalidCastException: Specified cast is not valid.
at CZ.Advantages.Asap.DA.Service.AbstractDataService.GetLog(DataTable table, UserProfile profile, String transactionId, Int32 overrideActionType)
at CZ.Advantages.Asap.DA.Service.AbstractSqlDataService.LogData(DataTable changedTable, UserProfile profile, String transactionId, IDbConnection connection, IDbTransaction transaction, Int32 overrideActionType)
at CZ.Advantages.Asap.DA.Service.AbstractSqlDataService.UpdateField(Guid entityId, Guid fieldId, Object oldValue, Object newValue, IPrincipal userProfile, String transactionId)
at CZ.Advantages.Asap.Workflow.DataServiceAgent.UpdateReferences(Guid entityId, Object oldValue, Object newValue) in d:\BuildServer\TeamCity\buildAgent\work\4d047c3a021b26c8\architect\CZ.Advantages.Asap.Workflow\Service Agents\DataServiceAgent.cs:line 349
2017-10-04 13:46:59,882 [2080] ERROR CZ.Advantages.Asap.Workflow.WorkflowEngine [(null)] <(null)> - ServiceMethodCallTask 02_UpdateReferences failed.
2017-10-04 13:46:59,883 [2080] ERROR CZ.Advantages.Asap.Workflow.WorkflowEngine [(null)] <(null)> - Specified cast is not valid.
CZ.Advantages.Asap.AsapException: Specified cast is not valid. —> System.InvalidCastException: Specified cast is not valid.
at CZ.Advantages.Asap.DA.Service.AbstractDataService.GetLog(DataTable table, UserProfile profile, String transactionId, Int32 overrideActionType)
at CZ.Advantages.Asap.DA.Service.AbstractSqlDataService.LogData(DataTable changedTable, UserProfile profile, String transactionId, IDbConnection connection, IDbTransaction transaction, Int32 overrideActionType)
at CZ.Advantages.Asap.DA.Service.AbstractSqlDataService.UpdateField(Guid entityId, Guid fieldId, Object oldValue, Object newValue, IPrincipal userProfile, String transactionId)
at CZ.Advantages.Asap.Workflow.DataServiceAgent.UpdateReferences(Guid entityId, Object oldValue, Object newValue) in d:\BuildServer\TeamCity\buildAgent\work\4d047c3a021b26c8\architect\CZ.Advantages.Asap.Workflow\Service Agents\DataServiceAgent.cs:line 386
at CZ.Advantages.Asap.Workflow.DataServiceAgent.Run() in d:\BuildServer\TeamCity\buildAgent\work\4d047c3a021b26c8\architect\CZ.Advantages.Asap.Workflow\Service Agents\DataServiceAgent.cs:line 598
at CZ.Advantages.Asap.Workflow.Tasks.ServiceMethodCallEngineTask.OnExecute() in d:\BuildServer\TeamCity\buildAgent\work\4d047c3a021b26c8\architect\CZ.Advantages.Asap.Workflow\Tasks\ServiceMethodCallEngineTask.cs:line 154
at CZ.Advantages.Asap.Workflow.Tasks.AbstractWorkflowEngineTask.Execute() in d:\BuildServer\TeamCity\buildAgent\work\4d047c3a021b26c8\architect\CZ.Advantages.Asap.Workflow\Tasks\AbstractWorkflowEngineTask.cs:line 101
— End of inner exception stack trace —
2017-10-04 13:46:59,890 [2080] ERROR CZ.Advantages.Asap.Workflow.WorkflowEngine [(null)] <(null)> - TransactionWorkflowBlock 01_TransactionMerge failed.
2017-10-04 13:46:59,890 [2080] ERROR CZ.Advantages.Asap.Workflow.WorkflowEngine [(null)] <(null)> - Specified cast is not valid.
CZ.Advantages.Asap.AsapException: Specified cast is not valid. —> CZ.Advantages.Asap.AsapException: Specified cast is not valid. —> System.InvalidCastException: Specified cast is not valid.
at CZ.Advantages.Asap.DA.Service.AbstractDataService.GetLog(DataTable table, UserProfile profile, String transactionId, Int32 overrideActionType)
at CZ.Advantages.Asap.DA.Service.AbstractSqlDataService.LogData(DataTable changedTable, UserProfile profile, String transactionId, IDbConnection connection, IDbTransaction transaction, Int32 overrideActionType)
at CZ.Advantages.Asap.DA.Service.AbstractSqlDataService.UpdateField(Guid entityId, Guid fieldId, Object oldValue, Object newValue, IPrincipal userProfile, String transactionId)
at CZ.Advantages.Asap.Workflow.DataServiceAgent.UpdateReferences(Guid entityId, Object oldValue, Object newValue) in d:\BuildServer\TeamCity\buildAgent\work\4d047c3a021b26c8\architect\CZ.Advantages.Asap.Workflow\Service Agents\DataServiceAgent.cs:line 386
at CZ.Advantages.Asap.Workflow.DataServiceAgent.Run() in d:\BuildServer\TeamCity\buildAgent\work\4d047c3a021b26c8\architect\CZ.Advantages.Asap.Workflow\Service Agents\DataServiceAgent.cs:line 598
at CZ.Advantages.Asap.Workflow.Tasks.ServiceMethodCallEngineTask.OnExecute() in d:\BuildServer\TeamCity\buildAgent\work\4d047c3a021b26c8\architect\CZ.Advantages.Asap.Workflow\Tasks\ServiceMethodCallEngineTask.cs:line 154
at CZ.Advantages.Asap.Workflow.Tasks.AbstractWorkflowEngineTask.Execute() in d:\BuildServer\TeamCity\buildAgent\work\4d047c3a021b26c8\architect\CZ.Advantages.Asap.Workflow\Tasks\AbstractWorkflowEngineTask.cs:line 101
— End of inner exception stack trace —
— End of inner exception stack trace —
2017-10-04 13:46:59,891 [2080] ERROR CZ.Advantages.Asap.Workflow.WorkflowEngine [(null)] <(null)> - ForeachWorkflowBlock 03_IterateOverSelected failed.
2017-10-04 13:46:59,891 [2080] ERROR CZ.Advantages.Asap.Workflow.WorkflowEngine [(null)] <(null)> - Specified cast is not valid.
CZ.Advantages.Asap.AsapException: Specified cast is not valid. —> CZ.Advantages.Asap.AsapException: Specified cast is not valid. —> CZ.Advantages.Asap.AsapException: Specified cast is not valid. —> System.InvalidCastException: Specified cast is not valid.
at CZ.Advantages.Asap.DA.Service.AbstractDataService.GetLog(DataTable table, UserProfile profile, String transactionId, Int32 overrideActionType)
at CZ.Advantages.Asap.DA.Service.AbstractSqlDataService.LogData(DataTable changedTable, UserProfile profile, String transactionId, IDbConnection connection, IDbTransaction transaction, Int32 overrideActionType)
at CZ.Advantages.Asap.DA.Service.AbstractSqlDataService.UpdateField(Guid entityId, Guid fieldId, Object oldValue, Object newValue, IPrincipal userProfile, String transactionId)
at CZ.Advantages.Asap.Workflow.DataServiceAgent.UpdateReferences(Guid entityId, Object oldValue, Object newValue) in d:\BuildServer\TeamCity\buildAgent\work\4d047c3a021b26c8\architect\CZ.Advantages.Asap.Workflow\Service Agents\DataServiceAgent.cs:line 386
at CZ.Advantages.Asap.Workflow.DataServiceAgent.Run() in d:\BuildServer\TeamCity\buildAgent\work\4d047c3a021b26c8\architect\CZ.Advantages.Asap.Workflow\Service Agents\DataServiceAgent.cs:line 598
at CZ.Advantages.Asap.Workflow.Tasks.ServiceMethodCallEngineTask.OnExecute() in d:\BuildServer\TeamCity\buildAgent\work\4d047c3a021b26c8\architect\CZ.Advantages.Asap.Workflow\Tasks\ServiceMethodCallEngineTask.cs:line 154
at CZ.Advantages.Asap.Workflow.Tasks.AbstractWorkflowEngineTask.Execute() in d:\BuildServer\TeamCity\buildAgent\work\4d047c3a021b26c8\architect\CZ.Advantages.Asap.Workflow\Tasks\AbstractWorkflowEngineTask.cs:line 101
— End of inner exception stack trace —
— End of inner exception stack trace —
— End of inner exception stack trace —

Any progress on this matter?