Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync clash with failed to diff ... git diff ... when using ManifestGeneratePaths and syncedRevision proceeds targetRevision #21014

Closed
3 tasks done
toyamagu-2021 opened this issue Dec 1, 2024 · 4 comments · Fixed by #21015
Assignees
Labels
bug Something isn't working component:repo-server version:2.13 Latest confirmed affected version is 2.13

Comments

@toyamagu-2021
Copy link
Member

toyamagu-2021 commented Dec 1, 2024

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug

  • ArgoCD sync clashed by follwoing error.
    • commit sha 481fbe3e687c8f339c0ecca000ee7ee7666a7aab proceeds 85dd68870f5c09225ae05c2b81e9136af7bce397.
ComparisonError: Failed to load target state: failed to compare revisions for source 1 of 1: rpc error: code = Internal desc = unable to get changed files for repo https://github.com/xxx/xxx.git with revision 85dd68870f5c09225ae05c2b81e9136af7bce397: failed to diff 481fbe3e687c8f339c0ecca000ee7ee7666a7aab..85dd68870f5c09225ae05c2b81e9136af7bce397: git diff --name-only 481fbe3e687c8f339c0ecca000ee7ee7666a7aab..85dd68870f5c09225ae05c2b81e9136af7bce397` failed exit status 128: fatal: Invalid revision range 481fbe3e687c8f339c0ecca000ee7ee7666a7aab..85dd68870f5c09225ae05c2b81e9136af7bce397 (retried 3 times).`
  • We use manifestGeneratePaths with large monorepo and have multiple repo-server.

Root cause

*To Reproduce

Described in root cause. Note that we need more than two repo-servers to reproduce this issue.

argocd-repo-server-856db549f5-pgh49 repo-server time="2024-12-01T16:20:41Z" level=info msg="git cat-file -t db63a656360ed3a57c2bcd76f72ef38d793f5733" dir=/tmp/_argocd-repo/74473fb6-60e9-44dd-8fd0-25f9fb516214 execID=dde19
argocd-repo-server-856db549f5-pgh49 repo-server time="2024-12-01T16:20:41Z" level=info msg=Trace args="[git cat-file -t db63a656360ed3a57c2bcd76f72ef38d793f5733]" dir=/tmp/_argocd-repo/74473fb6-60e9-44dd-8fd0-25f9fb516214 operation_name="exec git" time_ms=1.7880369999999999
argocd-repo-server-856db549f5-pgh49 repo-server time="2024-12-01T16:20:41Z" level=info msg="git checkout --force db63a656360ed3a57c2bcd76f72ef38d793f5733" dir=/tmp/_argocd-repo/74473fb6-60e9-44dd-8fd0-25f9fb516214 execID=eae87
argocd-repo-server-856db549f5-pgh49 repo-server time="2024-12-01T16:20:41Z" level=info msg=Trace args="[git checkout --force db63a656360ed3a57c2bcd76f72ef38d793f5733]" dir=/tmp/_argocd-repo/74473fb6-60e9-44dd-8fd0-25f9fb516214 operation_name="exec git" time_ms=2.4994940000000003
argocd-repo-server-856db549f5-pgh49 repo-server time="2024-12-01T16:20:41Z" level=info msg="git clean -ffdx" dir=/tmp/_argocd-repo/74473fb6-60e9-44dd-8fd0-25f9fb516214 execID=5ae04
argocd-repo-server-856db549f5-pgh49 repo-server time="2024-12-01T16:20:41Z" level=info msg=Trace args="[git clean -ffdx]" dir=/tmp/_argocd-repo/74473fb6-60e9-44dd-8fd0-25f9fb516214 operation_name="exec git" time_ms=1.080456
argocd-repo-server-856db549f5-pgh49 repo-server time="2024-12-01T16:20:41Z" level=info msg="git diff --name-only c39784b87ce7df09f2c22651cbcb95536c938deb..db63a656360ed3a57c2bcd76f72ef38d793f5733" dir=/tmp/_argocd-repo/74473fb6-60e9-44dd-8fd0-25f9fb516214 execID=8e750
argocd-repo-server-856db549f5-pgh49 repo-server time="2024-12-01T16:20:41Z" level=error msg="`git diff --name-only c39784b87ce7df09f2c22651cbcb95536c938deb..db63a656360ed3a57c2bcd76f72ef38d793f5733` failed exit status 128: fatal: Invalid revision range c39784b87ce7df09f2c22651cbcb95536c938deb..db63a656360ed3a57c2bcd76f72ef38d793f5733" execID=8e750
argocd-repo-server-856db549f5-pgh49 repo-server time="2024-12-01T16:20:41Z" level=info msg=Trace args="[git diff --name-only c39784b87ce7df09f2c22651cbcb95536c938deb..db63a656360ed3a57c2bcd76f72ef38d793f5733]" dir=/tmp/_argocd-repo/74473fb6-60e9-44dd-8fd0-25f9fb516214 operation_name="exec git" time_ms=1.462371
argocd-repo-server-856db549f5-pgh49 repo-server time="2024-12-01T16:20:41Z" level=error msg="finished unary call with code Internal" error="rpc error: code = Internal desc = unable to get changed files for repo https://github.com/toyamagu-2021/argo-cd-sandbox.git with revision db63a656360ed3a57c2bcd76f72ef38d793f5733: failed to diff c39784b87ce7df09f2c22651cbcb95536c938deb..db63a656360ed3a57c2bcd76f72ef38d793f5733: `git diff --name-only c39784b87ce7df09f2c22651cbcb95536c938deb..db63a656360ed3a57c2bcd76f72ef38d793f5733` failed exit status 128: fatal: Invalid revision range c39784b87ce7df09f2c22651cbcb95536c938deb..db63a656360ed3a57c2bcd76f72ef38d793f5733" grpc.code=Internal grpc.method=UpdateRevisionForPaths grpc.service=repository.RepoServerService grpc.start_time="2024-12-01T16:20:41Z" grpc.time_ms=7.459 span.kind=server system=grpc

image

Expected behavior

Screenshots

Version

ArgoCD v2.13.1

Logs

Paste any relevant application logs here.
@toyamagu-2021 toyamagu-2021 added the bug Something isn't working label Dec 1, 2024
@toyamagu-2021 toyamagu-2021 changed the title Sync clash by failed to diff ... git diff ... when using ManifestGeneratePaths and syncedRevision proceeds targetRevision Sync clash with failed to diff ... git diff ... when using ManifestGeneratePaths and syncedRevision proceeds targetRevision Dec 1, 2024
@toyamagu-2021 toyamagu-2021 self-assigned this Dec 1, 2024
@andrii-korotkov-verkada andrii-korotkov-verkada added the version:2.13 Latest confirmed affected version is 2.13 label Dec 1, 2024
@pasha-codefresh
Copy link
Member

Should we just not fail flow ( sync or reconcile ) in case if we were not able to update revision paths? i think it was mainly for performance optimization

@toyamagu-2021
Copy link
Member Author

toyamagu-2021 commented Dec 2, 2024

We can do that, but I think git fetch origin ${syncedRevision} is enough to avoid this corner case and unnecessary templating. #21015

@FangjianLu
Copy link

Thanks for the fix in #21015! We've been experiencing the error daily, is there a timeline to merge and release that?

@toyamagu-2021
Copy link
Member Author

@pasha-codefresh
Hi. Can we merge #21015 ?
I've confirmed that cherry-piking this PR works fine in our environment.

gdsoumya pushed a commit that referenced this issue Feb 25, 2025
Signed-off-by: toyamagu2021 <toyamagu2021@gmail.com>
Signed-off-by: toyamagu-2021 <toyamagu2021@gmail.com>
gcp-cherry-pick-bot bot pushed a commit that referenced this issue Feb 25, 2025
Signed-off-by: toyamagu2021 <toyamagu2021@gmail.com>
Signed-off-by: toyamagu-2021 <toyamagu2021@gmail.com>
gdsoumya pushed a commit that referenced this issue Feb 26, 2025
…pick #21015) (#22011)

Signed-off-by: toyamagu2021 <toyamagu2021@gmail.com>
Signed-off-by: toyamagu-2021 <toyamagu2021@gmail.com>
Co-authored-by: gussan <83329336+toyamagu-2021@users.noreply.github.com>
kingbj940429 pushed a commit to kingbj940429/argo-cd that referenced this issue Feb 26, 2025
…rgoproj#21015)

Signed-off-by: toyamagu2021 <toyamagu2021@gmail.com>
Signed-off-by: toyamagu-2021 <toyamagu2021@gmail.com>
Signed-off-by: kingbj0429 <kingbj0429@lunit.io>
chzar pushed a commit to chzar/argo-cd that referenced this issue Mar 3, 2025
…rgoproj#21015)

Signed-off-by: toyamagu2021 <toyamagu2021@gmail.com>
Signed-off-by: toyamagu-2021 <toyamagu2021@gmail.com>
kingbj940429 pushed a commit to kingbj940429/argo-cd that referenced this issue Mar 4, 2025
…rgoproj#21015)

Signed-off-by: toyamagu2021 <toyamagu2021@gmail.com>
Signed-off-by: toyamagu-2021 <toyamagu2021@gmail.com>
Signed-off-by: kingbj0429 <kingbj0429@lunit.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component:repo-server version:2.13 Latest confirmed affected version is 2.13
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants