Skip to content
Latchkey

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.

octo
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

  1. Derive the version from the run number or commit so each build is unique.
  2. Pack and push with that version.
  3. Confirm the feed now accepts the new, unique version.
.github/workflows/ci.yml
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.

Terminal
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.

Related guides

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