Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception: System.ArgumentException: An item with the same key has already been added. #9495

Closed
1 task done
martincostello opened this issue Apr 13, 2024 · 6 comments
Labels
L: dotnet:nuget NuGet packages via nuget or dotnet L: git:submodules Git submodules T: bug 🐞 Something isn't working

Comments

@martincostello
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Package ecosystem

NuGet

Package manager version

No response

Language version

No response

Manifest location and content before the Dependabot update

martincostello/alexa-london-travel@1b47c2e

dependabot.yml content

dependabot.yml

Updated dependency

None

What you expected to see, versus what you actually saw

Dependencies should have been updated, but instead nothing is updated an an error is logged:

updater | 2024/04/13 09:39:39 ERROR <job_814225123> Block argument of NuGetConfigCredentialHelpers::patch_nuget_config_for_action causes an exception Discovering build files in workspace [/home/dependabot/dependabot-updater/repo].
updater |   No dotnet-tools.json file found.
updater |   Discovered [global.json] file.
updater |   Discovering projects beneath [.].
updater |   No packages.config file found.
updater | Unhandled exception: System.ArgumentException: An item with the same key has already been added. Key: coverlet.msbuild
updater |    at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
updater |    at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
updater |    at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable`1 source, Func`2 keySelector, IEqualityComparer`1 comparer)
updater |    at NuGetUpdater.Core.Discover.SdkProjectDiscovery.DiscoverAsync(String repoRootPath, String workspacePath, String projectPath, Logger logger) in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Core/Discover/SdkProjectDiscovery.cs:line 32
updater |    at NuGetUpdater.Core.Discover.DiscoveryWorker.RunForProjectPathsAsync(String repoRootPath, String workspacePath, IEnumerable`1 projectPaths) in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs:line 160
updater |    at NuGetUpdater.Core.Discover.DiscoveryWorker.RunForDirectoryAsnyc(String repoRootPath, String workspacePath) in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs:line 125
updater |    at NuGetUpdater.Core.Discover.DiscoveryWorker.RunAsync(String repoRootPath, String workspacePath, String outputPath) in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs:line 59
updater |    at NuGetUpdater.Cli.Commands.DiscoverCommand.<>c.<<GetCommand>b__4_0>d.MoveNext() in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/DiscoverCommand.cs:line 30
updater | --- End of stack trace from previous location ---
updater |    at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context)
updater |    at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater |    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseErrorReporting>b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater |    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseHelp>b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater |    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater |    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<<UseTypoCorrections>b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater |    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__18_0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater |    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseDirective>b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater |    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__5_0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater |    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<<UseExceptionHandler>b__0>d.MoveNext():
updater | Discovering build files in workspace [/home/dependabot/dependabot-updater/repo].
updater |   No dotnet-tools.json file found.
updater |   Discovered [global.json] file.
updater |   Discovering projects beneath [.].
updater |   No packages.config file found.
updater | Unhandled exception: System.ArgumentException: An item with the same key has already been added. Key: coverlet.msbuild
updater |    at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
updater |    at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
updater |    at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable`1 source, Func`2 keySelector, IEqualityComparer`1 comparer)
updater |    at NuGetUpdater.Core.Discover.SdkProjectDiscovery.DiscoverAsync(String repoRootPath, String workspacePath, String projectPath, Logger logger) in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Core/Discover/SdkProjectDiscovery.cs:line 32
updater |    at NuGetUpdater.Core.Discover.DiscoveryWorker.RunForProjectPathsAsync(String repoRootPath, String workspacePath, IEnumerable`1 projectPaths) in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs:line 160
updater |    at NuGetUpdater.Core.Discover.DiscoveryWorker.RunForDirectoryAsnyc(String repoRootPath, String workspacePath) in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs:line 125
updater |    at NuGetUpdater.Core.Discover.DiscoveryWorker.RunAsync(String repoRootPath, String workspacePath, String outputPath) in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs:line 59
updater |    at NuGetUpdater.Cli.Commands.DiscoverCommand.<>c.<<GetCommand>b__4_0>d.MoveNext() in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/DiscoverCommand.cs:line 30
updater | --- End of stack trace from previous location ---
updater |    at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context)
updater |    at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater |    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<<UseParseErrorReporting>b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater |    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<<UseHelp>b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater |    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseVersionOption>b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater |    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<<UseTypoCorrections>b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater |    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__18_0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater |    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseDirective>b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater |    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__5_0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater |    at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<<UseExceptionHandler>b__0>d.MoveNext()
updater | 
updater | 2024/04/13 09:39:39 WARN <job_814225123> Please check your configuration as there are groups where no dependencies match:
updater | - awssdk
updater | - opentelemetry
updater | - polly
updater | - xunit
updater | 
updater | This can happen if:
updater | - the group's 'pattern' rules are misspelled
updater | - your configuration's 'allow' rules do not permit any of the dependencies that match the group
updater | - the dependencies that match the group rules have been removed from your project

Native package manager behavior

No response

Images of the diff or a link to the PR, issue, or logs

No response

Smallest manifest that reproduces the issue

No response

@martincostello martincostello added the T: bug 🐞 Something isn't working label Apr 13, 2024
@github-actions github-actions bot added L: dotnet:nuget NuGet packages via nuget or dotnet L: git:submodules Git submodules labels Apr 13, 2024
@fuzzzerd
Copy link

I am experiencing the same error:

Unhandled exception: System.ArgumentException: An item with the same key has already been added. Key: System.ValueTuple

Full log

proxy | 2024/04/14 19:25:29 proxy starting, commit: cf8623577dad71c128f219df2b27df6de35b909d
proxy | 2024/04/14 19:25:29 Listening (:1080)
updater | 2024-04-14T19:25:29.841515450 [814287777:main:WARN:src/devices/src/legacy/serial.rs:222] Detached the serial input due to peer close/error.
updater | time="2024-04-14T19:25:33Z" level=info msg="guest starting" commit=23d5de4e561c0902c1073f9798c09b5fb9912de9
updater | time="2024-04-14T19:25:33Z" level=info msg="starting job..." fetcher_timeout=10m0s job_id=814287777 updater_timeout=45m0s updater_version=b76786b8dbe56b9b9f20c9c0c623440927bcdf2b-nuget
updater | 2024/04/14 19:25:40 INFO <job_814287777> Starting job processing
updater | 2024/04/14 19:25:40 INFO <job_814287777> Job definition: {"job":{"allowed-updates":[{"dependency-type":"direct","update-type":"all"}],"commit-message-options":{"include-scope":null,"prefix":null,"prefix-development":null},"credentials-metadata":[{"host":"github.com","type":"git_source"}],"debug":null,"dependencies":null,"dependency-group-to-refresh":null,"dependency-groups":[{"name":"xunit","rules":{"patterns":["xunit*"]}}],"existing-group-pull-requests":[],"existing-pull-requests":[[{"dependency-name":"Microsoft.SourceLink.GitHub","dependency-version":"1.1.0"}],[{"dependency-name":"xunit.runner.visualstudio","dependency-version":"2.4.4"}],[{"dependency-name":"AWSSDK.CognitoIdentityProvider","dependency-version":"3.7.6.5"}],[{"dependency-name":"moq","dependency-version":"4.20.1"}],[{"dependency-name":"moq","dependency-version":"4.20.2"}],[{"dependency-name":"xunit.runner.visualstudio","dependency-version":"2.5.1"}],[{"dependency-name":"xunit","dependency-version":"2.5.1"}],[{"dependency-name":"xunit.runner.console","dependency-version":"2.5.1"}]],"experiments":{"proxy-cached":true,"record-ecosystem-versions":true,"record-update-job-unknown-error":true},"ignore-conditions":[{"dependency-name":"AWSSDK.CognitoIdentityProvider","source":"@dependabot ignore command","update-types":null,"updated-at":"2022-09-15T14:33:19.000Z","version-requirement":"\u003c 3.8, \u003e 3.7.6.4"},{"dependency-name":"moq","source":"@dependabot ignore command","update-types":null,"updated-at":"2023-08-10T14:20:47.000Z","version-requirement":"\u003e 4.20.0"}],"lockfile-only":false,"max-updater-run-time":2700,"package-manager":"nuget","proxy-log-response-body-on-auth-failure":true,"reject-external-code":false,"repo-private":false,"requirements-update-strategy":null,"security-advisories":[],"security-updates-only":false,"source":{"api-endpoint":"https://api.github.com/","branch":null,"directory":"/.","hostname":"github.com","provider":"github","repo":"fuzzzerd/fmdata"},"update-subdependencies":false,"updating-a-pull-request":false,"vendor-dependencies":false}}
updater |
proxy | 2024/04/14 19:25:41 [002] GET https://github.com:443/fuzzzerd/fmdata/info/refs?service=git-upload-pack
proxy | 2024/04/14 19:25:41 [002] * authenticating git server request (host: github.com)
proxy | 2024/04/14 19:25:41 [002] 200 https://github.com:443/fuzzzerd/fmdata/info/refs?service=git-upload-pack
proxy | 2024/04/14 19:25:41 [004] POST https://github.com:443/fuzzzerd/fmdata/git-upload-pack
proxy | 2024/04/14 19:25:41 [004] * authenticating git server request (host: github.com)
proxy | 2024/04/14 19:25:41 [004] 200 https://github.com:443/fuzzzerd/fmdata/git-upload-pack
proxy | 2024/04/14 19:25:41 [006] POST https://github.com:443/fuzzzerd/fmdata/git-upload-pack
proxy | 2024/04/14 19:25:41 [006] * authenticating git server request (host: github.com)
proxy | 2024/04/14 19:25:41 [006] 200 https://github.com:443/fuzzzerd/fmdata/git-upload-pack
updater | 2024/04/14 19:25:41 INFO <job_814287777> Finished job processing
updater | time="2024-04-14T19:25:41Z" level=info msg="task complete" container_id=job-814287777-file-fetcher exit_code=0 job_id=814287777 step=fetcher
updater | 2024/04/14 19:25:48 INFO <job_814287777> Starting job processing
updater | running NuGet discovery:
updater | /opt/nuget/NuGetUpdater/NuGetUpdater.Cli discover --repo-root /home/dependabot/dependabot-updater/repo --workspace / --output /tmp/.dependabot/discovery.json --verbose
updater | 2024/04/14 19:25:49 ERROR <job_814287777> Block argument of NuGetConfigCredentialHelpers::patch_nuget_config_for_action causes an exception Discovering build files in workspace [/home/dependabot/dependabot-updater/repo].
updater | No dotnet-tools.json file found.
updater | Discovered [global.json] file.
updater | Discovering projects beneath [.].
updater | No packages.config file found.
updater | Unhandled exception: System.ArgumentException: An item with the same key has already been added. Key: System.ValueTuple
updater | at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) updater | at System.Collections.Generic.Dictionary2.Add(TKey key, TValue value)
updater | at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable1 source, Func2 keySelector, IEqualityComparer1 comparer) updater | at NuGetUpdater.Core.Discover.SdkProjectDiscovery.DiscoverAsync(String repoRootPath, String workspacePath, String projectPath, Logger logger) in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Core/Discover/SdkProjectDiscovery.cs:line 32 updater | at NuGetUpdater.Core.Discover.DiscoveryWorker.RunForProjectPathsAsync(String repoRootPath, String workspacePath, IEnumerable1 projectPaths) in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs:line 160
updater | at NuGetUpdater.Core.Discover.DiscoveryWorker.RunForDirectoryAsnyc(String repoRootPath, String workspacePath) in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs:line 125
updater | at NuGetUpdater.Core.Discover.DiscoveryWorker.RunAsync(String repoRootPath, String workspacePath, String outputPath) in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs:line 59
updater | at NuGetUpdater.Cli.Commands.DiscoverCommand.<>c.<b__4_0>d.MoveNext() in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/DiscoverCommand.cs:line 30
updater | --- End of stack trace from previous location ---
updater | at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context)
updater | at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater | at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater | at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater | at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater | at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater | at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__18_0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater | at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater | at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__5_0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater | at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<b__0>d.MoveNext():
updater | Discovering build files in workspace [/home/dependabot/dependabot-updater/repo].
updater | No dotnet-tools.json file found.
updater | Discovered [global.json] file.
updater | Discovering projects beneath [.].
updater | No packages.config file found.
updater | Unhandled exception: System.ArgumentException: An item with the same key has already been added. Key: System.ValueTuple
updater | at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) updater | at System.Collections.Generic.Dictionary2.Add(TKey key, TValue value)
updater | at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable1 source, Func2 keySelector, IEqualityComparer1 comparer) updater | at NuGetUpdater.Core.Discover.SdkProjectDiscovery.DiscoverAsync(String repoRootPath, String workspacePath, String projectPath, Logger logger) in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Core/Discover/SdkProjectDiscovery.cs:line 32 updater | at NuGetUpdater.Core.Discover.DiscoveryWorker.RunForProjectPathsAsync(String repoRootPath, String workspacePath, IEnumerable1 projectPaths) in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs:line 160
updater | at NuGetUpdater.Core.Discover.DiscoveryWorker.RunForDirectoryAsnyc(String repoRootPath, String workspacePath) in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs:line 125
updater | at NuGetUpdater.Core.Discover.DiscoveryWorker.RunAsync(String repoRootPath, String workspacePath, String outputPath) in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs:line 59
updater | at NuGetUpdater.Cli.Commands.DiscoverCommand.<>c.<b__4_0>d.MoveNext() in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/DiscoverCommand.cs:line 30
updater | --- End of stack trace from previous location ---
updater | at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext context)
updater | at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater | at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater | at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater | at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater | at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater | at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__18_0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater | at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<b__0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater | at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__5_0>d.MoveNext()
updater | --- End of stack trace from previous location ---
updater | at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<b__0>d.MoveNext()
updater |
updater | 2024/04/14 19:25:49 WARN <job_814287777> Please check your configuration as there are groups where no dependencies match:
updater | - xunit
updater |
updater | This can happen if:
updater | - the group's 'pattern' rules are misspelled
updater | - your configuration's 'allow' rules do not permit any of the dependencies that match the group
updater | - the dependencies that match the group rules have been removed from your project
updater |
updater | 2024/04/14 19:25:50 INFO <job_814287777> Starting grouped update job for fuzzzerd/fmdata
updater | 2024/04/14 19:25:50 INFO <job_814287777> Found 1 group(s).
updater | 2024/04/14 19:25:50 WARN <job_814287777> Skipping update group for 'xunit' as it does not match any allowed dependencies.
updater | 2024/04/14 19:25:50 INFO <job_814287777> Finished job processing
updater | time="2024-04-14T19:25:50Z" level=info msg="task complete" container_id=job-814287777-updater exit_code=0 job_id=814287777 step=updater

The related dependabot.yml: https://github.com/fuzzzerd/fmdata/blob/master/.github/dependabot.yml

@edumserrano
Copy link

edumserrano commented Apr 20, 2024

I started getting this exception as well:

updater | Restoring `global.json` to `/home/dependabot/dependabot-updater/repo` after MSBuild discovery.
updater | Discovering build files in workspace [/home/dependabot/dependabot-updater/repo].
updater |   No dotnet-tools.json file found.
updater |   Discovered [global.json] file.
updater |   Discovering projects beneath [.].
updater |   No packages.config file found.
updater | Unhandled exception: System.ArgumentException: An item with the same key has already been added. Key: Microsoft.AspNetCore.Mvc.Testing
updater |    at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
updater |    at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
updater |    at System.Linq.Enumerable.ToDictionary[TSource,TKey](IEnumerable`1 source, Func`2 keySelector, IEqualityComparer`1 comparer)
updater |    at NuGetUpdater.Core.Discover.SdkProjectDiscovery.DiscoverAsync(String repoRootPath, String workspacePath, String projectPath, Logger logger) in /opt/nuget/lib/NuGetUpdater/NuGetUpdater.Core/Discover/SdkProjectDiscovery.cs:line 32

And the worst part is that Dependabot still shows the execution as successful/green with the end of the log saying:

updater | 2024/04/20 13:19:44 WARN <job_817375711> Please check your configuration as there are groups where no dependencies match:
updater | - nuget
updater | 
updater | This can happen if:
updater | - the group's 'pattern' rules are misspelled
updater | - your configuration's 'allow' rules do not permit any of the dependencies that match the group
updater | - the dependencies that match the group rules have been removed from your project
updater | 
updater | 2024/04/20 13:19:45 INFO <job_817375711> Starting grouped update job for edumserrano/dotnet-sdk-extensions
updater | 2024/04/20 13:19:45 INFO <job_817375711> Found 1 group(s).
updater | 2024/04/20 13:19:45 WARN <job_817375711> Skipping update group for 'nuget' as it does not match any allowed dependencies.
updater | 2024/04/20 13:19:45 INFO <job_817375711> Finished job processing
updater | time="2024-04-20T13:19:45Z" level=info msg="task complete" container_id=job-817375711-updater exit_code=0 job_id=817375711 step=updater

I think this is happening for me because I have a Microsoft.NET.Sdk project with the following:

  <ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.26" />
  </ItemGroup>
  <ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.15" />
  </ItemGroup>
  <ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.1" />
  </ItemGroup>

Here's the dependabot file and csproj files in question: DotNet.Sdk.Extensions.Testing.csproj and DotNet.Sdk.Extensions.Testing.Tests.csproj.

I've also tried with having an ignore for the package like this:

    ignore:
      # Ignored because the csproj using this  NuGet supports multiple target frameworks and dependabot does not handle this well.
      # This NuGet needs to be manually updated for each target framework
      - dependency-name: "Microsoft.AspNetCore.Mvc.Testing"

But I'm still getting the same error.

@martincostello
Copy link
Contributor Author

Easier to consume log using the new actions support: logs

@fuzzzerd
Copy link

Here is a more recent dependabot log showing the same error but using the new actions runners for my repo above: https://github.com/fuzzzerd/fmdata/actions/runs/8848899385/job/24299632274

@DavidBoike
Copy link
Contributor

@brettfo
Copy link
Collaborator

brettfo commented May 8, 2024

Fixed in #9642.

@brettfo brettfo closed this as completed May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: dotnet:nuget NuGet packages via nuget or dotnet L: git:submodules Git submodules T: bug 🐞 Something isn't working
Projects
Status: Done
Development

No branches or pull requests

5 participants