elsa-workflows / elsa-workflows/elsa-core

'Object reference not set to an instance of an object' error after restarting

Open
#4,276 12 comments 0 reactions 0 assignees View on GitHub
stale triaged
Dominant language
C#
Stars
7.9k
Forks
1.5k
Avg merge
15h 22m
Merged PRs (30d)
114

Description

Ever since adding hangfire, we now get the following error after restarting our k8s pods. It will eventually start after throwing this error a few times. It seems that each node will throw this error until one starts, then another will not throw and start etc... Like a node is locking something during start, and all others throw this error?

```
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at Elsa.Activities.Temporal.Hangfire.Services.HangfireWorkflowDefinitionScheduler.<>c.b__14_0(RecurringJobDto x)
at System.Linq.Utilities.<>c__DisplayClass1_0`1.b__0(TSource x)
at System.Linq.Enumerable.WhereListIterator`1.ToList()
at Elsa.Activities.Temporal.Hangfire.Services.HangfireWorkflowDefinitionScheduler.DeleteRecurringJobs(String workflowDefinitionId)
at Elsa.Activities.Temporal.Hangfire.Services.HangfireWorkflowDefinitionScheduler.UnscheduleAsync(String workflowDefinitionId, CancellationToken cancellationToken)
at Elsa.Activities.Temporal.Common.Handlers.ScheduleTimers.Handle(TriggerIndexingFinished notification, CancellationToken cancellationToken)
at MediatR.NotificationPublishers.ForeachAwaitPublisher.Publish(IEnumerable`1 handlerExecutors, INotification notification, CancellationToken cancellationToken)
at Elsa.Services.Triggers.TriggerIndexer.IndexTriggersAsync(IWorkflowBlueprint workflowBlueprint, CancellationToken cancellationToken)
at Elsa.Services.Triggers.TriggerIndexer.IndexTriggersAsync(IEnumerable`1 workflowBlueprints, CancellationToken cancellationToken)
at Elsa.Services.Triggers.TriggerIndexer.IndexTriggersAsync(CancellationToken cancellationToken)
at Elsa.StartupTasks.IndexTriggers.ExecuteAsync(CancellationToken cancellationToken)
at Elsa.Runtime.StartupRunner.StartupAsync(CancellationToken cancellationToken)
at Elsa.Runtime.StartupRunner.StartupAsync(CancellationToken cancellationToken)
at Elsa.HostedServices.StartupRunnerHostedService.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
at Program.$(String[] args) in /src/Dashboard/Program.cs:line 213
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.