nexus-public
nexus-public copied to clipboard
NuGet publish duplicate package fails with 400 instead of 409
- What problem are you trying to solve?
Nexus returns 400 instead of 409 for package conflicts, meaning NuGet will interpret the upload as a failure. Even if we use the raw nuget command we still will get a failure even though there is the -SkipDuplicate flag: https://learn.microsoft.com/en-us/nuget/reference/cli-reference/cli-ref-push https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-push
We see that the implementation treats 409 Duplicate as a special return code as seen in the pull request: https://github.com/NuGet/NuGet.Client/pull/2802/files
- Do you have a workaround you are using at present?
Ignore dotnet
or nuget
return value.
- What feature or behavior is this required for?
NuGet package feed
- How could we solve this issue? (Not knowing is okay!)
Return status code 409 instead of 400 for NuGet packages that have version already uploaded and has Deployment Policy: Disable redeploy.
- Tell us about your Nexus Repository deployment: what version, operating system, and database are you using?
Versions: OSS 3.68.1-02 to OSS 3.71.0-06, operating system Linux using official docker image
- Anything else?