-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
runtime error: invalid memory address or nil pointer dereference #14098
Comments
Looks like this line in gitops-engine: https://github.com/argoproj/gitops-engine/blob/b4dd8b8c3976d03f9928a393c2447830a3ef7449/pkg/diff/diff.go#L153 |
I can reproduce it pretty much weekly now, with the same stacktrace. If any debugging info would be useful, I can annotate some code around with extra logging. |
I think either if pt == nil || p.live == nil {
log.Errorf("pt: %v, p.live: %v, gvk: %v", pt, p.live, gvk)
} It would at least give us a start. |
Facing the same issue on |
It looks like I figured where this one is coming from. I had argo-cd manage a VolumeSnapshotClass, specifically Argocd fails to diff it because live's empty at that version. A simple fix my side was to use the proper GVK for the resource, but practically, it should fail in a more user-friendly way up the chain. |
Hit this in 2.8.0 - the issue seemed to stem from a PodDisruptionBudget from the Kyverno chart, which used a cluster capabilities function to decide if it was creating the new v1 or deprecated v1beta1 PDB kind. Had to remove the offending PDB from the clusters manually before I could get a sync to work. |
We see this quite often also. Currently our workaround is to invalidate the cache for the affected cluster. We're running crossplane so this GVK issue would probably be more extreme than usual. ArgoCD: v2.6.7 |
my problem was api version change: HorizontalPodAutoscaler/v2beta1 to HorizontalPodAutoscaler/v2 time="2023-10-17T12:08:21Z" level=info msg="Adding resource result, status: 'SyncFailed', phase: '', message: 'the server could not find the requested resource'" application=argocd/app-backend-feature-test kind=HorizontalPodAutoscaler name=app-hpa namespace=backend-feature-test phase=Sync syncId=00005-RAPRf message in gui after application recreate. contrintuitive problem :( |
@blakebarnett how to invalidate the cache? |
Settings -> Clusters -> (click cluster) -> Invalidate Cache (top-left) |
@blakebarnett Thx! |
Observing this in 2.8.1 |
What to do if the the issue persists, and the solution above don't help?
I invalidated the cache, removed the cluster. I even deployed the whole cluster (the remote cluster as I use ApplicationSet), still I see the same issue. I addition I removed all pods of ArgoCD, but nothing helped. |
I've had exactly this problem recently in one of my ArgoCD apps in ArgoCD v2.10.11+27e49f8. The Invalidate Cache workaround mentioned in this ticket worked for me. One of my colleagues had the same issue but in one our other ArgoCD apps on his local Openshift CRC environment so it isn't specific to one of our apps. This is the stack trace I got:
|
As of the latest gitops-engine commit, this error is at least handled instead of panicking:
Of course that doesn't resolve the underlying problem... |
argocd v2.10.7 faced this when deploying clickhouse operator installation:
maybe related to server-side diff restarting or clearing cache doesn't help |
Was hit by this today, I've invalidated caches, basically restarted/zero-ed out all the ArgoCD components, can't seem to get things to figure itself out, if anyone had any other things that worked, would love to hear em! 🙏 Edit a day later 😄 We were running |
Running into this (
Happened after enabling |
Upgrading to 2.11.5 with the new gitops-engine version solved the issue. We moved onto 2.11.9 after that and the behavior didn't reappear so far. |
Checklist:
argocd version
.Describe the bug
At some point the sync stops working and the sync status reports
runtime error: invalid memory address or nil pointer dereference
.The following stacktrace can be observed:
I'm pretty much reporting it only because nil pointer dereference is a bad thing(tm) and it seems like I triggered some very non-trivial race condition. Looking through the code, I don't have an immediate clue of what could have gone wrong there.
To Reproduce
I wasn't able to repo properly. It was 100% reproduceable on the broken instance but went away after the restart (and was fine since). Just before the issue happened I manually triggered a sync for a bunch of projects.
Expected behavior
Screenshots
Version
The text was updated successfully, but these errors were encountered: