elsa-core: Elsa 2 - Startup - HTTP Error 500.30 - ASP.NET Core app failed to start (after renaming an activity in a workflow and the app restart)
I’m not sure how I got here after quite a lot of changes to several workflows over the last week… After publishing one it started to error when that workflow attempted to run. Changing a bit of code and starting up iisexpress again killed its startup as well.
But failing to startup probably isn’t the desired response. (I’m just hunting down what data is causing this is now)
System.ArgumentException: An item with the same key has already been added. Key: b8aafcc8-7429-4041-8d7d-7ffd45f45a53
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable`1 source, Func`2 keySelector, IEqualityComparer`1 comparer)
at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable`1 source, Func`2 keySelector)
at Elsa.Services.WorkflowBlueprintMaterializer.CreateWorkflowBlueprintAsync(WorkflowDefinition workflowDefinition, CancellationToken cancellationToken)
at Elsa.WorkflowProviders.DatabaseWorkflowProvider.<>c__DisplayClass3_0.<<OnGetWorkflowsAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Elsa.WorkflowProviders.DatabaseWorkflowProvider.OnGetWorkflowsAsync(CancellationToken cancellationToken)
at Elsa.Services.WorkflowProvider.GetWorkflowsAsync(CancellationToken cancellationToken)+MoveNext()
at Elsa.Services.WorkflowProvider.GetWorkflowsAsync(CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
at Elsa.Services.WorkflowRegistry.GetWorkflowsInternalAsync(CancellationToken cancellationToken)+MoveNext()
at Elsa.Services.WorkflowRegistry.GetWorkflowsInternalAsync(CancellationToken cancellationToken)+MoveNext()
at Elsa.Services.WorkflowRegistry.GetWorkflowsInternalAsync(CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|620_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36
at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|620_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36
at Elsa.Services.WorkflowRegistry.ListAsync(CancellationToken cancellationToken)
at Elsa.Services.WorkflowRegistry.ListActiveWorkflowsAsync(CancellationToken cancellationToken)+MoveNext()
at Elsa.Services.WorkflowRegistry.ListActiveWorkflowsAsync(CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|620_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36
at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|620_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36
at Elsa.Services.WorkflowRegistry.ListActiveAsync(CancellationToken cancellationToken)
at Elsa.Triggers.TriggerIndexer.IndexTriggersAsync(CancellationToken cancellationToken)
at Elsa.StartupTasks.IndexTriggers.ExecuteAsync(CancellationToken cancellationToken)
at Elsa.Runtime.StartupRunner.StartupAsync(CancellationToken cancellationToken)
at Elsa.HostedServices.StartupRunnerHostedService.StartAsync(CancellationToken cancellationToken)
Similar things as start workflow based on my logs:
05/12/2021 15:19:26 +01:00 Unhandled exception rendering component: "An item with the same key has already been added. Key: b8aafcc8-7429-4041-8d7d-7ffd45f45a53"
System.ArgumentException: An item with the same key has already been added. Key: b8aafcc8-7429-4041-8d7d-7ffd45f45a53
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable`1 source, Func`2 keySelector, IEqualityComparer`1 comparer)
at Elsa.Services.WorkflowBlueprintMaterializer.CreateWorkflowBlueprintAsync(WorkflowDefinition workflowDefinition, CancellationToken cancellationToken)
at Elsa.WorkflowProviders.DatabaseWorkflowProvider.<>c__DisplayClass3_0.<<OnGetWorkflowsAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Elsa.WorkflowProviders.DatabaseWorkflowProvider.OnGetWorkflowsAsync(CancellationToken cancellationToken)
at Elsa.Services.WorkflowProvider.GetWorkflowsAsync(CancellationToken cancellationToken)+MoveNext()
at Elsa.Services.WorkflowProvider.GetWorkflowsAsync(CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
at Elsa.Services.WorkflowRegistry.GetWorkflowsInternalAsync(CancellationToken cancellationToken)+MoveNext()
at Elsa.Services.WorkflowRegistry.GetWorkflowsInternalAsync(CancellationToken cancellationToken)+MoveNext()
at Elsa.Services.WorkflowRegistry.GetWorkflowsInternalAsync(CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|620_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36
at System.Linq.AsyncEnumerable.<ToListAsync>g__Core|620_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/ToList.cs:line 36
at Elsa.Services.WorkflowRegistry.ListAsync(CancellationToken cancellationToken)
at Open.Linq.AsyncExtensions.Extensions.ToList[TSource](Task`1 source)
at Elsa.Decorators.CachingWorkflowRegistry.<>c__DisplayClass10_0.<<GetWorkflowBlueprints>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.Extensions.Caching.Memory.CacheExtensions.GetOrCreateAsync[TItem](IMemoryCache cache, Object key, Func`2 factory)
at Elsa.Decorators.CachingWorkflowRegistry.GetWorkflowBlueprints(CancellationToken cancellationToken)
at Elsa.Decorators.CachingWorkflowRegistry.FindAsync(Func`2 predicate, CancellationToken cancellationToken)
at Elsa.Decorators.CachingWorkflowRegistry.GetAsync(String id, String tenantId, VersionOptions version, CancellationToken cancellationToken)
....
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 25 (25 by maintainers)
Sounds good, let’s close this. I created a separate issue to work on the unique key constraints.
Alive again It helps if i have the right css files (previously using some from the blazer project) 😃
todo: fix my data and try it all out again.
That’s one way to put it I guess 😅
All TW classes are now prefixed with
elsa-to avoid potential collisions with “outer” css classes. Probably a hard-refresh will do the trick.