Skip to content
Latchkey

dotnet nuget push "409 Conflict ... already exists" in CI

The feed already has the package version you are pushing. nuget.org and most feeds treat published versions as immutable, so the push returns 409. Bump the version, or use --skip-duplicate to make re-runs safe.

What this error means

dotnet nuget push (or nuget push) fails with "Response status code does not indicate success: 409 (Conflict)." and a message that the package version already exists on the feed.

nuget
Pushing MyLib.1.2.0.nupkg to 'https://api.nuget.org/v3/index.json'...
error: Response status code does not indicate success: 409 (Conflict - The feed already contains 'MyLib 1.2.0').

Common causes

The package version was not bumped

CI pushed a version already present on the feed. Published NuGet versions cannot be overwritten, so the feed returns 409.

A re-run of an already-successful push

A retried release pushes the same .nupkg again; the first succeeded and the second conflicts.

How to fix it

Push with --skip-duplicate for idempotent releases

This treats an existing version as success instead of failing, so retried jobs do not break.

Terminal
dotnet nuget push "**/*.nupkg" \
  --api-key "$NUGET_API_KEY" \
  --source https://api.nuget.org/v3/index.json \
  --skip-duplicate

Bump the package version

For a genuine new release, increment the version so the push targets a version that does not exist yet.

MyLib.csproj
<PropertyGroup>
  <Version>1.2.1</Version>
</PropertyGroup>

How to prevent it

  • Publish only from tagged releases with a fresh version.
  • Use --skip-duplicate so retried pushes do not fail.
  • Drive the package version from the release tag.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →