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.

[BUG] Error in Publisher when making a new revision current

See original GitHub issue

Release version

v.3.0.1

Describe the bug

When I create a new revision in my API and extract and publish the changes, everything works as expected, but when I make that revision current, extract and publish the changes I get the following error attempting to publish from the last commit.

Expected behavior

Revisions should match lower level environments and have the same version id as the current revision.

Actual behavior

I’m not 100% sure what’s happening, but it appears that when you make the revision current it changes the url which is changing the folder in the extractor run.

Here is the error:

crit: Publisher[0]
      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, IEqualityComparer`1 keyOnlyComparer, IEqualityComparer`1 valueComparer, KeyCollisionBehavior behavior, OperationResult& result)
         at System.Collections.Immutable.ImmutableDictionary`2.AddRange(IEnumerable`1 items, MutationInput origin, KeyCollisionBehavior collisionBehavior)
         at System.Collections.Immutable.ImmutableDictionary`2.AddRange(IEnumerable`1 pairs, Boolean avoidToHashMap)
         at System.Collections.Immutable.ImmutableDictionary`2.AddRange(IEnumerable`1 pairs)
         at System.Collections.Immutable.ImmutableDictionary.ToImmutableDictionary[TSource,TKey,TValue](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 keyComparer, IEqualityComparer`1 valueComparer)
         at System.Collections.Immutable.ImmutableDictionary.ToImmutableDictionary[TSource,TKey,TValue](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
         at publisher.Publisher.GetCommitIdFiles(CommitId commitId)
         at publisher.Publisher.RunWithCommitId(CommitId commitId, 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, IEqualityComparer`1 keyOnlyComparer, IEqualityComparer`1 valueComparer, KeyCollisionBehavior behavior, OperationResult& result)
         at System.Collections.Immutable.ImmutableDictionary`2.AddRange(IEnumerable`1 items, MutationInput origin, KeyCollisionBehavior collisionBehavior)
         at System.Collections.Immutable.ImmutableDictionary`2.AddRange(IEnumerable`1 pairs, Boolean avoidToHashMap)
         at System.Collections.Immutable.ImmutableDictionary`2.AddRange(IEnumerable`1 pairs)
         at System.Collections.Immutable.ImmutableDictionary.ToImmutableDictionary[TSource,TKey,TValue](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 keyComparer, IEqualityComparer`1 valueComparer)
         at System.Collections.Immutable.ImmutableDictionary.ToImmutableDictionary[TSource,TKey,TValue](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
         at publisher.Publisher.GetCommitIdFiles(CommitId commitId)
         at publisher.Publisher.RunWithCommitId(CommitId commitId, 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.ImmutableDictionary`2.HashBucket.Add(TKey key, TValue value, IEqualityComparer`1 keyOnlyComparer, IEqualityComparer`1 valueComparer, KeyCollisionBehavior behavior, OperationResult& result)
         at System.Collections.Immutable.ImmutableDictionary`2.AddRange(IEnumerable`1 items, MutationInput origin, KeyCollisionBehavior collisionBehavior)
         at System.Collections.Immutable.ImmutableDictionary`2.AddRange(IEnumerable`1 pairs, Boolean avoidToHashMap)
         at System.Collections.Immutable.ImmutableDictionary`2.AddRange(IEnumerable`1 pairs)
         at System.Collections.Immutable.ImmutableDictionary.ToImmutableDictionary[TSource,TKey,TValue](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 keyComparer, IEqualityComparer`1 valueComparer)
         at System.Collections.Immutable.ImmutableDictionary.ToImmutableDictionary[TSource,TKey,TValue](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
         at publisher.Publisher.GetCommitIdFiles(CommitId commitId)
         at publisher.Publisher.RunWithCommitId(CommitId commitId, CancellationToken cancellationToken)
         at publisher.Publisher.Run(CancellationToken cancellationToken)
         at publisher.Publisher.ExecuteAsync(CancellationToken cancellationToken)
         at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)

Reproduction Steps

Add a revision to an api in your lower level environment and make that the current revision. Run the extractor, approve and complete the PR and you will see the error in the dev publisher run.

Issue Analytics

  • State:open
  • Created 9 months ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
aristosvocommented, Mar 15, 2023

Sure! Thanks a lot:)

0reactions
waelkdouhcommented, Mar 15, 2023

@aristosvo can we close this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue with pictures in publisher
1. Make sure you've updated publisher to the latest version that some issues can be resolved with such method. 2. Try open your...
Read more >
How to troubleshoot a damaged publication in Publisher
Copy one object at a time from the problem page to the new publication to determine which object is damaged. Then, make sure...
Read more >
Fix: 'Publisher detected a problem in the file you are trying ...
What's causing the 'Publisher has detected a problem' Error? · Method 1: Disabling 3rd party AV protection (if applicable) · Method 2: Duplicating ......
Read more >
Publisher won't open ANY prior files.
I have a client that uses MS Publisher to create their weekly bulletins. ... greeted with the "Cannot Open File" warning and 1100009...
Read more >
Publisher Version 2 - Error or Bug - pages won't delete
Hi Support, When trying to delete unwanted pages, I highlight, then click on the Dustbin to Delete the page but it doesn't work, ......
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