Octopus "A package with the same ID and version already exists" (409) in CI
octo push returned HTTP 409 because the Octopus built-in feed already contains a package with that exact ID and version. Feeds are immutable by default, so re-pushing the same version without changing it is rejected.
What this error means
octo push fails with "A package with the same ID and version already exists in the repository" on a re-run, or when the build did not bump the version.
Octopus.Client.Exceptions.OctopusValidationException: A package with the same
ID and version already exists in the repository. (HTTP 409)Common causes
The build produced a version that was already pushed
The package version is static or derived from a value that did not change (a fixed tag, an unchanged file), so a re-run tries to push an identical version.
A retried or duplicated job re-pushes the same artifact
A pipeline re-run or a duplicate step pushes the same versioned package into an immutable feed, which rejects the duplicate.
How to fix it
Bump the package version per build
- Derive the version from the run number or commit so each build is unique.
- Pack and push with that version.
- Confirm the feed now accepts the new, unique version.
VERSION="1.0.${{ github.run_number }}"
octo pack --id Web --version "$VERSION" --format zip
octo push --package "Web.$VERSION.zip" --server "$OCTOPUS_URL" --apiKey "$OCTOPUS_API_KEY"Allow overwrite only when re-publishing is intended
If re-pushing the same version is deliberate, set the overwrite behavior explicitly rather than failing.
octo push --package "Web.1.0.0.zip" --overwrite-mode OverwriteExisting \
--server "$OCTOPUS_URL" --apiKey "$OCTOPUS_API_KEY"How to prevent it
- Generate a unique package version for every build.
- Do not reuse fixed versions across pipeline runs.
- Reserve --overwrite-mode OverwriteExisting for intentional re-publishes.