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.

NuGet Publisher fails with 409 due to publishing symbols packages twice

See original GitHub issue

When using the NuGet Publisher task with a wildcard pattern of *__.nupkg, the step inevitably fails when symbols packages are present. For example, if I have these packages:

bin\my.1.0.nupkg
bin\my.1.0.symbols.nupkg

This task will find both files and try to publish them both. But nuget.exe push will automatically push the symbols package when you push bin\my.1.0.nupkg so when this task then tries to push the symbols package itself, a 409 inevitably results.

I workaround this by using this search pattern instead of the default: **\*.nupkg;-:**\*.symbols.nupkg but it would be nice if the task was smart enough to suppress symbol packages from being uploaded twice.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
vtbassmattcommented, Apr 11, 2016

Your workaround is the correct way to achieve what you want.

At some point, NuGet will probably change how symbols packages work. Per their design that a package is uniquely identified by id + version, it’s pretty broken that the client emits two packages with the same id + version but different contents.

0reactions
bkwdesigncommented, Oct 30, 2020

what am I doing wrong? I’m using a dot net push task step in my Azure CI pipe and am getting this 409 error. I see this git issue is closed as if it’s all good, but I don’t think so.

Active code page: 65001

SYSTEMVSSCONNECTION exists true

SYSTEMVSSCONNECTION exists true

SYSTEMVSSCONNECTION exists true

"C:\Program Files\dotnet\dotnet.exe" nuget push D:\a\1\a\Ross.Manifest.PdfSplitter.OpenSource.1.0.0-CI-20201030-190639.nupkg --source https://pkgs.dev.azure.com/RossEnvironmentalServices/_packaging/1631486d-2386-7339-ae02-4bbae3d4a949/nuget/v3/index.json --api-key VSTS

Pushing Ross.Manifest.PdfSplitter.OpenSource.1.0.0-CI-20201030-190639.nupkg to 'https://pkgs.dev.azure.com/RossEnvironmentalServices/_packaging/1631486d-2386-7339-ae02-4bbae3d4a949/nuget/v2/'...

  PUT https://pkgs.dev.azure.com/RossEnvironmentalServices/_packaging/1631486d-2386-7339-ae02-4bbae3d4a949/nuget/v2/

  Accepted https://pkgs.dev.azure.com/RossEnvironmentalServices/_packaging/1631486d-2386-7339-ae02-4bbae3d4a949/nuget/v2/ 21430ms

Your package was pushed.

"C:\Program Files\dotnet\dotnet.exe" nuget push D:\a\1\a\Ross.Manifest.PdfSplitter.OpenSource.1.0.0-CI-20201030-190639.symbols.nupkg --source https://pkgs.dev.azure.com/RossEnvironmentalServices/_packaging/1631486d-2386-7339-ae02-4bbae3d4a949/nuget/v3/index.json --api-key VSTS

Pushing Ross.Manifest.PdfSplitter.OpenSource.1.0.0-CI-20201030-190639.symbols.nupkg to 'https://pkgs.dev.azure.com/RossEnvironmentalServices/_packaging/1631486d-2386-7339-ae02-4bbae3d4a949/nuget/v2/'...

  PUT https://pkgs.dev.azure.com/RossEnvironmentalServices/_packaging/1631486d-2386-7339-ae02-4bbae3d4a949/nuget/v2/

  Conflict https://pkgs.dev.azure.com/RossEnvironmentalServices/_packaging/1631486d-2386-7339-ae02-4bbae3d4a949/nuget/v2/ 4221ms

To skip already published packages, use the option --skip-duplicate

error: Response status code does not indicate success: 409 (Conflict - The feed already contains 'Ross.Manifest.PdfSplitter.OpenSource 1.0.0-CI-20201030-190639'. (DevOps Activity ID: 7978D218-A115-4018-987E-A10F1E93E14C)).





Usage: dotnet nuget push [arguments] [options]



Arguments:

  [root]  Specify the path to the package and your API key to push the package to the server.



Options:

  -h|--help                      Show help information

  --force-english-output         Forces the application to run using an invariant, English-based culture.

  -s|--source <source>           Package source (URL, UNC/folder path or package source name) to use. Defaults to DefaultPushSource if specified in NuGet.Config.

  -ss|--symbol-source <source>   Symbol server URL to use.

  -t|--timeout <timeout>         Timeout for pushing to a server in seconds. Defaults to 300 seconds (5 minutes).

  -k|--api-key <apiKey>          The API key for the server.

  -sk|--symbol-api-key <apiKey>  The API key for the symbol server.

  -d|--disable-buffering         Disable buffering when pushing to an HTTP(S) server to decrease memory usage.

  -n|--no-symbols                If a symbols package exists, it will not be pushed to a symbols server.

  --no-service-endpoint          Does not append "api/v2/package" to the source URL.

  --interactive                  Allow the command to block and require manual action for operations like authentication.

  --skip-duplicate               If a package and version already exists, skip it and continue with the next package in the push, if any.

##[error]Error: The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1

##[error]Packages failed to publish

Read more comments on GitHub >

github_iconTop Results From Across the Web

.NET Core Publish fails when using SourceLink or snupkg ...
Publishing to my repository then appears to fail because it complains the package already exists when adding the second old symbols format nupkg...
Read more >
VSO Build - NuGet Publish 409 Conflict - Stack Overflow
So I'm wondering if the package is published twice during the process. You need to check your build definition to see if the...
Read more >
Creating symbol packages (.snupkg) - NuGet - Microsoft Learn
Symbol packages published to NuGet.org will fail validation if these constraints aren't met. Native projects, such as C++ projects, produce ...
Read more >
Azure DevOps Server–Error publishing nuget packages
The nuget command failed with exit code(1) and error(Response status code does not indicate success: 409 (Conflict - The feed already contains ' ......
Read more >
.NET SDK Support - Jenkins
NET: Publish NuGet package (nuget push); dotnetTest : . ... If this is checked, errors encountered will cause the build status to be...
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