question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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)

See original GitHub issue

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)
   ....

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:25 (25 by maintainers)

github_iconTop GitHub Comments

1reaction
sfmskywalkercommented, May 13, 2021

Sounds good, let’s close this. I created a separate issue to work on the unique key constraints.

1reaction
matt4446commented, May 13, 2021

Alive again It helps if i have the right css files (previously using some from the blazer project) 😃

    <link rel="stylesheet" href="/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/assets/fonts/inter/inter.css">
    <link rel="stylesheet" href="/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/assets/styles/tailwind.css">

todo: fix my data and try it all out again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP Error 500.30 - ASP.NET Core 5 app failed to start
Most often, this issue is caused by a faulty dependency injection in one of your classes. · Ensure your interfaces are registered in...
Read more >
how to fix HTTP Error 500.30 - ASP.NET Core app failed ...
I have an ASP.NET Core web app which is failing to run. The application is running fine on my PC. I even downloaded...
Read more >
HTTP Error 500.30 - ASP.NET Core app failed to start help
A common problem for startup problems with ASP.NET Core is an invalid appsettings.json and/or appsettings.Production.json . It could be either a ...
Read more >
HTTP Error 500.30 - ASP.NET Core app failed to start
NET Core CLR in-process, but it fails to start, thus preventing the app from running. Unfortunately, the cause of a process startup failure...
Read more >
How to Fix Error 500.30 – ASP.NET Core app failed to start
NET Core CLR in-process, but it fails to start, thus preventing the app from running. Unfortunately, the cause of a process startup failure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found