[BUG] Better errors when publishing
See original GitHub issueRelease version
v1.2.0
Describe the bug
Errors seems to not contain enough information to help debug / figure our the issue.
crit: publisher.Publisher[0]
System.ArgumentException: An element with the same key but a different value already exists. Key: ‘Put’
at System.Collections.Immutable.ImmutableDictionary2.HashBucket.Add(TKey key, TValue value, IEqualityComparer
1 keyOnlyComparer, IEqualityComparer1 valueComparer, KeyCollisionBehavior behavior, OperationResult& result) at System.Collections.Immutable.ImmutableDictionary
2.AddRange(IEnumerable1 items, MutationInput origin, KeyCollisionBehavior collisionBehavior) at System.Collections.Immutable.ImmutableDictionary
2.AddRange(IEnumerable1 pairs, Boolean avoidToHashMap) at System.Collections.Immutable.ImmutableDictionary
2.AddRange(IEnumerable1 pairs) at System.Collections.Immutable.ImmutableDictionary.ToImmutableDictionary[TSource,TKey,TValue](IEnumerable
1 source, Func2 keySelector, Func
2 elementSelector, IEqualityComparer1 keyComparer, IEqualityComparer
1 valueComparer)
at System.Collections.Immutable.ImmutableDictionary.ToImmutableDictionary[TSource,TKey,TValue](IEnumerable1 source, Func
2 keySelector, Func2 elementSelector) at publisher.Publisher.GetFileRecordsFromCommitId(CommitId commitId, CancellationToken cancellationToken) at publisher.Publisher.GetFilesToProcess(CancellationToken cancellationToken) at publisher.Publisher.Run(CancellationToken cancellationToken) at publisher.Publisher.ExecuteAsync(CancellationToken cancellationToken) info: Microsoft.Hosting.Lifetime[0] Application is shutting down... fail: Microsoft.Extensions.Hosting.Internal.Host[9] BackgroundService failed System.ArgumentException: An element with the same key but a different value already exists. Key: 'Put' at System.Collections.Immutable.ImmutableDictionary
2.HashBucket.Add(TKey key, TValue value, IEqualityComparer1 keyOnlyComparer, IEqualityComparer
1 valueComparer, KeyCollisionBehavior behavior, OperationResult& result)
at System.Collections.Immutable.ImmutableDictionary2.AddRange(IEnumerable
1 items, MutationInput origin, KeyCollisionBehavior collisionBehavior)
at System.Collections.Immutable.ImmutableDictionary2.AddRange(IEnumerable
1 pairs, Boolean avoidToHashMap)
at System.Collections.Immutable.ImmutableDictionary2.AddRange(IEnumerable
1 pairs)
at System.Collections.Immutable.ImmutableDictionary.ToImmutableDictionary[TSource,TKey,TValue](IEnumerable1 source, Func
2 keySelector, Func2 elementSelector, IEqualityComparer
1 keyComparer, IEqualityComparer1 valueComparer) at System.Collections.Immutable.ImmutableDictionary.ToImmutableDictionary[TSource,TKey,TValue](IEnumerable
1 source, Func2 keySelector, Func
2 elementSelector)
at publisher.Publisher.GetFileRecordsFromCommitId(CommitId commitId, CancellationToken cancellationToken)
at publisher.Publisher.GetFilesToProcess(CancellationToken cancellationToken)
at publisher.Publisher.Run(CancellationToken cancellationToken)
at publisher.Publisher.ExecuteAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)
crit: Microsoft.Extensions.Hosting.Internal.Host[10]
The HostOptions.BackgroundServiceExceptionBehavior is configured to StopHost. A BackgroundService has thrown an unhandled exception, and the IHost instance is stopping. To avoid this behavior, configure this to Ignore; however the BackgroundService will not be restarted.
System.ArgumentException: An element with the same key but a different value already exists. Key: ‘Put’
at System.Collections.Immutable.ImmutableDictionary2.HashBucket.Add(TKey key, TValue value, IEqualityComparer
1 keyOnlyComparer, IEqualityComparer1 valueComparer, KeyCollisionBehavior behavior, OperationResult& result) at System.Collections.Immutable.ImmutableDictionary
2.AddRange(IEnumerable1 items, MutationInput origin, KeyCollisionBehavior collisionBehavior) at System.Collections.Immutable.ImmutableDictionary
2.AddRange(IEnumerable1 pairs, Boolean avoidToHashMap) at System.Collections.Immutable.ImmutableDictionary
2.AddRange(IEnumerable1 pairs) at System.Collections.Immutable.ImmutableDictionary.ToImmutableDictionary[TSource,TKey,TValue](IEnumerable
1 source, Func2 keySelector, Func
2 elementSelector, IEqualityComparer1 keyComparer, IEqualityComparer
1 valueComparer)
at System.Collections.Immutable.ImmutableDictionary.ToImmutableDictionary[TSource,TKey,TValue](IEnumerable1 source, Func
2 keySelector, Func`2 elementSelector)
at publisher.Publisher.GetFileRecordsFromCommitId(CommitId commitId, CancellationToken cancellationToken)
at publisher.Publisher.GetFilesToProcess(CancellationToken cancellationToken)
at publisher.Publisher.Run(CancellationToken cancellationToken)
at publisher.Publisher.ExecuteAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)
Error: Process completed with exit code 255.
Expected behavior
Errors should highlight the api / product / file that is causing the error
Actual behavior
Errors are internal errors missing details
Reproduction Steps
Deploy apis / products with exceptions
Issue Analytics
- State:
- Created 10 months ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
Issue with v1. I just updated v2 and this issue doesn’t exists anymore. Thanks for new version!
@jarkkojarvinen - are you seeing this issue when using v2 or v1? If v1, please try again with the latest code and report back.