Skip to content
Latchkey

Argo CD "Unable to resolve ... to a commit SHA" (bad targetRevision) in CI

Argo CD resolves targetRevision to a commit before rendering. If the branch, tag, or SHA does not exist in the repo, resolution fails and the Application cannot sync to anything.

What this error means

The Application shows "Unable to resolve \"<revision>\" to a commit SHA" (or "reference not found"), often after a branch or tag was renamed, deleted, or misspelled.

argocd
rpc error: code = Unknown desc = Unable to resolve "release-1.4" to a commit SHA

Common causes

The revision does not exist

A misspelled branch, a deleted tag, or a SHA that was never pushed leaves targetRevision unresolvable.

A moving ref that CI has not pushed yet

Pointing at a tag or branch the pipeline creates later means Argo CD resolves before the ref exists.

How to fix it

Set targetRevision to a real ref

  1. Confirm the branch, tag, or SHA exists in the repo.
  2. Update spec.source.targetRevision to that value.
  3. For CI-created tags, push the tag before syncing the app.
Terminal
git ls-remote --tags --heads origin | grep release-1.4

Pin to an immutable revision for deploys

Pinning to a tag or commit SHA (not a moving branch) makes CI deploys deterministic and avoids resolving a ref mid-flight.

application.yaml
spec:
  source:
    targetRevision: v1.4.0

How to prevent it

  • Push tags before pointing an Application at them.
  • Pin deploys to an immutable tag or SHA, not a moving branch.
  • Verify targetRevision exists with git ls-remote in CI.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →