Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Servers, nginx and Docker

Argo CD shows ComparisonError because the app path is not in the repo

Your error

ComparisonError2 more lines it can show

Fix it fast

Most common cause, 1 of 3

The folder is not in the commit that targetRevision resolves to

Point the Application at a path and revision where the folder really exists.

Fix
spec:
  source:
    repoURL: https://github.com/my-org/gitops.git
    targetRevision: main
    path: apps/my-app
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

Argo CD shows app path does not exist when the repo-server joins spec.source.path to its clone at targetRevision and finds no folder there. Fix the folder name or the branch, replace Windows backslashes such as bootstrap\argo-cd with forward slashes (old argocd-autopilot builds on Windows wrote them), then hard refresh so the cached error clears. Applies to Argo CD 3.6.

  • Applies to Argo CD 3.6.2, argocd CLI 3.6, argocd-autopilot 0.4.20
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

Print the path and revision Argo CD uses, then ask Git whether that folder exists at exactly that revision. Empty output from ls-tree means the folder is not there.

Run this first
argocd app get my-app -o yaml | grep -E 'path:|targetRevision:'
git fetch origin
git ls-tree -d origin/main -- apps/my-app

Then find the line you see in this list and open its fix:

  1. 1The folder is not in the commit that targetRevision resolves togit ls-tree prints nothing for that revision, but the folder exists on another branch or under a slightly different name
  2. 2The path was written with Windows backslashesThe error shows a backslash, for example bootstrap\argo-cd, while the folder in Git is bootstrap/argo-cd
  3. 3The repo is fixed, but Argo CD keeps serving the cached failureThe message starts with Manifest generation error (cached) even though ls-tree now finds the folder

What does the error look like?

  • ComparisonError
  • Manifest generation error (cached): bootstrap\argo-cd: app path does not exist
  • <path>: app path does not exist

Cause 1 of 3

The folder is not in the commit that targetRevision resolves to

You seegit ls-tree prints nothing for that revision, but the folder exists on another branch or under a slightly different name

Check

The repo-server builds the app path by joining spec.source.path to the checked-out repo, and returns app path does not exist when nothing is found there. A typo, a different letter case, a leading folder you forgot, or a folder that only lives on a feature branch all end the same way.

Check
git ls-tree -d --name-only origin/main -- apps/

Fix

Point the Application at a path and revision where the folder really exists. Either correct spec.source.path, or set targetRevision to the branch, tag or commit that contains it, then push.

Fix
spec:
  source:
    repoURL: https://github.com/my-org/gitops.git
    targetRevision: main
    path: apps/my-app

Verify

ls-tree now lists the folder, and after the next refresh the Application no longer carries the ComparisonError condition.

Verify
git ls-tree -d origin/main -- apps/my-app

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 2 of 3

The path was written with Windows backslashes

You seeThe error shows a backslash, for example bootstrap\argo-cd, while the folder in Git is bootstrap/argo-cd

Check

The error repeats the path exactly as the Application gives it, backslash included, so the repo-server went looking for one folder literally called bootstrap\argo-cd and never reached bootstrap/argo-cd. The argocd-autopilot 0.4.11 release notes list a fix for bootstrapping on Windows. In issue 454 the reporter traced the bad path to a Chocolatey copy of the tool that was much older than the latest release.

Check
grep -rn 'path:' bootstrap/*.yaml

Fix

Change every backslash in spec.source.path to a forward slash and push. Then replace the old autopilot binary with a current release from the project's release page and check its version.

Fix
# bootstrap/argo-cd.yaml
spec:
  source:
    path: bootstrap/argo-cd
argocd-autopilot version

Verify

The argo-cd Application loses its ComparisonError after the next refresh, and argocd-autopilot version reports 0.4.11 or later.

Verify
argocd app get argo-cd --refresh

Confirmed by github.com

Did this fix it?

Cause 3 of 3

The repo is fixed, but Argo CD keeps serving the cached failure

You seeThe message starts with Manifest generation error (cached) even though ls-tree now finds the folder

Check

After repeated generation failures the repo-server saves the last error and hands it back with the (cached) prefix until a set time or number of requests has passed. Its repo cache, manifest results included, expires after 24 hours by default, and a resolved revision is kept for 3 minutes, so a plain refresh right after your push can still get the stored error.

Check
argocd app get my-app

Fix

Run a hard refresh. It reloads the application data and also drops the target manifests cache, so the repo-server generates the manifests again from Git.

Fix
argocd app get my-app --hard-refresh

Verify

The cached prefix and the ComparisonError are gone, and the app shows a real sync status.

Verify
argocd app get my-app -o wide

Confirmed by argo-cd.readthedocs.io

Did this fix it?

How do I stop it coming back?

  • Add a CI step that runs git ls-tree for every spec.source.path in your Application manifests and fails the pull request when one is missing.
  • Install argocd-autopilot from its GitHub release page and print its version in setup docs, so an outdated packaged binary is spotted.
  • Rename or move an app folder in the same commit that updates the Application pointing at it.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.