Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object reference not set to an instance of an object. #1070

Open
Yuval2612 opened this issue Jul 20, 2022 · 2 comments
Open

Object reference not set to an instance of an object. #1070

Yuval2612 opened this issue Jul 20, 2022 · 2 comments

Comments

@Yuval2612
Copy link

Describe the bug
I'm using WorkFlowCore with asp.net core, at the end of each workflow I see in the log 'fail: WorkflowCore.Services.BackgroundTasks.WorkflowConsumer[0]'
I look into it and saw that somehow the function GetWorkflowInstance was called and the workflows are empty.
this function is located in the class that uses IPersistenceProvider.

To Reproduce
Create a flow from JSON

Expected behavior
The null exception should not appear.

Additional context
example of the error log:
fail: WorkflowCore.Services.BackgroundTasks.WorkflowConsumer[0]
Error executing item 41b5ef64-ba42-4511-8ccc-7b78d65adc80 - Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at WorkflowCore.Services.BackgroundTasks.WorkflowConsumer.ProcessItem(String itemId, CancellationToken cancellationToken)
at WorkflowCore.Services.BackgroundTasks.WorkflowConsumer.ProcessItem(String itemId, CancellationToken cancellationToken)
at WorkflowCore.Services.BackgroundTasks.QueueConsumer.ExecuteItem(String itemId, EventWaitHandle waitHandle, Activity activity)

this is the JSON flow
{
"Id": "ny",
"Version": 1,
"DataType": "Getb.Evaluation.Flow.Manager.FlowExecution.FlowContext, Getb.Evaluation.Flow.Manager",
"ErrorBehavior":"Terminate",
"Steps": [
{
"Id": "Initialization",
"StepType": "Getb.Evaluation.Flow.Manager.Steps.Initialization, Getb.Evaluation.Flow.Manager",
"ErrorBehavior":"Terminate",
"NextStepId": "ParallelTracking"
},
{
"Id": "ParallelTracking",
"StepType": "WorkflowCore.Primitives.Sequence, WorkflowCore",
"ErrorBehavior":"Terminate",
"NextStepId": "Evaluation",
"Do": [
[
{
"Id": "Tracking",
"StepType": "Getb.Evaluation.Flow.Manager.Steps.Tracking, Getb.Evaluation.Flow.Manager",
"ErrorBehavior":"Terminate",
"Inputs": {
"System": ""ny"",
"IgnorePlots": ""py""
}
}
]
]
},
{
"Id": "Evaluation",
"StepType": "Retb.Evaluation.Flow.Manager.Steps.Evaluation, Retb.Evaluation.Flow.Manager",
"ErrorBehavior":"Terminate",
"NextStepId": "Finalization",
"Inputs": {
"System": ""ny""
}
},
{
"Id": "Finalization",
"StepType": "Retb.Evaluation.Flow.Manager.Steps.Finalization, Retb.Evaluation.Flow.Manager",
"ErrorBehavior":"Terminate"
}
]
}

@scccboom
Copy link

scccboom commented Aug 8, 2022

This is usually caused by incorrect persistence, and sometimes the workflow ends after it is started.
You should provide more detailed information. For example persistence code, database

@eli-ilushin
Copy link

I've encountered a similar issue and it was caused because in some cases my implementation of IPersistenceProvider was returning null from GetWorkflowInstance(...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants