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.
rpc error: code = Unknown desc = Unable to resolve "release-1.4" to a commit SHACommon 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
- Confirm the branch, tag, or SHA exists in the repo.
- Update
spec.source.targetRevisionto that value. - For CI-created tags, push the tag before syncing the app.
git ls-remote --tags --heads origin | grep release-1.4Pin 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.
spec:
source:
targetRevision: v1.4.0How 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-remotein CI.