argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
17.9k stars 5.46k forks source link

ArgoCD Applicationset Controller failed to create object due to corrupted cache ? #20228

Open allamand opened 1 month ago

allamand commented 1 month ago

Checklist:

Describe the bug

I already had this issue several times, so decided to log the issue.

I was not able to create a non existant applicationset in the cluster

To Reproduce

It was previously created and deleted, and for some reason, the applicationset controller was trying to update the object instead of creating it.

Expected behavior

applicationset controller just create the applicationset requested

**Workarround

To FIx the problem, I just deleted the controller, which restarted from fresh (with no corrupted cache), and then, just created the object.

Version

argocd-server: v2.10.7+b060053
  BuildDate: 2024-04-15T08:45:08Z
  GitCommit: b060053b099b4c81c1e635839a309c9c8c1863e9
  GitTreeState: clean
  GoVersion: go1.21.3
  Compiler: gc
  Platform: linux/amd64
  Kustomize Version: v5.2.1 2023-10-19T20:13:51Z
  Helm Version: v3.14.3+gf03cc04
  Kubectl Version: v0.26.11
  Jsonnet Version: v0.20.0

Logs

argo-cd-argocd-applicationset-controller-67687b4c4d-vzrx2 applicationset-controller time="2024-10-04T10:01:46Z" level=error msg="failed to unchanged Application" action=unchanged app=argocd/bootstrap applicationset=argocd/bootstrap error="applications.argoproj.io \"bootstrap\" not found"
agaudreault commented 3 weeks ago

It is possible that the controller (kubernetes informer) miss the event. Can you add more information on how this ApplicationSet is deleted (manually, other operator, pruning by argo cd, etc)?

It does seem like a scenario that the AppSet could handle, fail once, update the informer status for this resource, then retry.

allamand commented 3 weeks ago

The object was deleted with kubectl, and yes for some reason the controller may have missed the update but never tried to update his cache with more recent datas

andrii-korotkov-verkada commented 1 day ago

2.10 has reached EOL, can you upgrade and check if the issue is still present, please?