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

Make panics not crash the entire controller #5

Open
jmcshane opened this issue Mar 31, 2024 · 0 comments
Open

Make panics not crash the entire controller #5

jmcshane opened this issue Mar 31, 2024 · 0 comments

Comments

@jmcshane
Copy link
Contributor

jmcshane commented Mar 31, 2024

2024-03-31T04:10:59.958530Z info ERROR Failed to decode kubeconfig bytes for cluster name=kind-kubeconfig
2024-03-31T04:10:59.958557Z info ERROR Failed to build rest config from kubeconfig for cluster API cluster name=kind-kubeconfig
2024-03-31T04:10:59.960974Z error klog Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
goroutine 36 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic({0x10281d620, 0x1046d7de0})
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/pkg/util/runtime/runtime.go:75 +0x7c
k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0x140009ae000?})
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/pkg/util/runtime/runtime.go:49 +0x78
panic({0x10281d620?, 0x1046d7de0?})
/opt/homebrew/Cellar/go/1.22.1/libexec/src/runtime/panic.go:770 +0x124
github.com/superorbital/capargo/internal/controller.buildClusterConfigFromRestConfig(0x0?)
/Users/jamesmcshane/Projects/argo-cluster-api-declarative-controller/internal/controller/controller.go:126 +0x50
github.com/superorbital/capargo/internal/controller.NewCollection.func2({0x102d27cc0?, 0x140007faea0?}, 0x140009daa00)
/Users/jamesmcshane/Projects/argo-cluster-api-declarative-controller/internal/controller/controller.go:74 +0x348
istio.io/istio/pkg/kube/krt.NewCollection[...].func1(0x14b72c598?)
/Users/jamesmcshane/go/pkg/mod/istio.io/[email protected]/pkg/kube/krt/collection.go:309 +0x2c
istio.io/istio/pkg/kube/krt.(*manyCollection[...]).onPrimaryInputEventLocked(0x102d98960, {0x140005cc030, 0x1, 0x1})
/Users/jamesmcshane/go/pkg/mod/istio.io/[email protected]/pkg/kube/krt/collection.go:185 +0x13c
istio.io/istio/pkg/kube/krt.(*manyCollection[...]).onPrimaryInputEvent(0x102d98960, {0x140005cc030, 0x1, 0x1})
/Users/jamesmcshane/go/pkg/mod/istio.io/[email protected]/pkg/kube/krt/collection.go:168 +0x1f0
istio.io/istio/pkg/kube/krt.newManyCollection[...].func1.1()
/Users/jamesmcshane/go/pkg/mod/istio.io/[email protected]/pkg/kube/krt/collection.go:364 +0x168
istio.io/istio/pkg/kube/krt.(*informer[...]).RegisterBatch.func1()
/Users/jamesmcshane/go/pkg/mod/istio.io/[email protected]/pkg/kube/krt/informer.go:94 +0x90
istio.io/istio/pkg/kube/krt.(*informer[...].func2()
/Users/jamesmcshane/go/pkg/mod/istio.io/[email protected]/pkg/kube/krt/informer.go:106 +0x78
istio.io/istio/pkg/kube/controllers.EventHandler[...].OnAdd(0x100469484?, {0x102cea280?, 0x140009daa00?}, 0x80?)
/Users/jamesmcshane/go/pkg/mod/istio.io/[email protected]/pkg/kube/controllers/common.go:312 +0x50
k8s.io/client-go/tools/cache.FilteringResourceEventHandler.OnAdd({0x140009ac090?, {0x102d57ca0?, 0x140009ac078?}}, {0x102cea280, 0x140009daa00}, 0x1)
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/tools/cache/controller.go:302 +0x6c
k8s.io/client-go/tools/cache.(*processorListener).run.func1()
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/tools/cache/shared_informer.go:972 +0x154
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0x30?)
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:226 +0x40
k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0x14000089f60, {0x102d28cc0, 0x140007fae70}, 0x1, 0x14000618780)
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:227 +0x90
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0x140000af760, 0x3b9aca00, 0x0, 0x1, 0x14000618780)
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:204 +0x80
k8s.io/apimachinery/pkg/util/wait.Until(...)
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:161
k8s.io/client-go/tools/cache.(*processorListener).run(0x140008322d0)
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/tools/cache/shared_informer.go:966 +0x68
k8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1()
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:72 +0x5c
created by k8s.io/apimachinery/pkg/util/wait.(*Group).Start in goroutine 69
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:70 +0x7c
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x60 pc=0x10212a370]

goroutine 36 [running]:
k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0x140009ae000?})
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/pkg/util/runtime/runtime.go:56 +0xe0
panic({0x10281d620?, 0x1046d7de0?})
/opt/homebrew/Cellar/go/1.22.1/libexec/src/runtime/panic.go:770 +0x124
github.com/superorbital/capargo/internal/controller.buildClusterConfigFromRestConfig(0x0?)
/Users/jamesmcshane/Projects/argo-cluster-api-declarative-controller/internal/controller/controller.go:126 +0x50
github.com/superorbital/capargo/internal/controller.NewCollection.func2({0x102d27cc0?, 0x140007faea0?}, 0x140009daa00)
/Users/jamesmcshane/Projects/argo-cluster-api-declarative-controller/internal/controller/controller.go:74 +0x348
istio.io/istio/pkg/kube/krt.NewCollection[...].func1(0x14b72c598?)
/Users/jamesmcshane/go/pkg/mod/istio.io/[email protected]/pkg/kube/krt/collection.go:309 +0x2c
istio.io/istio/pkg/kube/krt.(*manyCollection[...]).onPrimaryInputEventLocked(0x102d98960, {0x140005cc030, 0x1, 0x1})
/Users/jamesmcshane/go/pkg/mod/istio.io/[email protected]/pkg/kube/krt/collection.go:185 +0x13c
istio.io/istio/pkg/kube/krt.(*manyCollection[...]).onPrimaryInputEvent(0x102d98960, {0x140005cc030, 0x1, 0x1})
/Users/jamesmcshane/go/pkg/mod/istio.io/[email protected]/pkg/kube/krt/collection.go:168 +0x1f0
istio.io/istio/pkg/kube/krt.newManyCollection[...].func1.1()
/Users/jamesmcshane/go/pkg/mod/istio.io/[email protected]/pkg/kube/krt/collection.go:364 +0x168
istio.io/istio/pkg/kube/krt.(*informer[...]).RegisterBatch.func1()
/Users/jamesmcshane/go/pkg/mod/istio.io/[email protected]/pkg/kube/krt/informer.go:94 +0x90
istio.io/istio/pkg/kube/krt.(*informer[...].func2()
/Users/jamesmcshane/go/pkg/mod/istio.io/[email protected]/pkg/kube/krt/informer.go:106 +0x78
istio.io/istio/pkg/kube/controllers.EventHandler[...].OnAdd(0x100469484?, {0x102cea280?, 0x140009daa00?}, 0x80?)
/Users/jamesmcshane/go/pkg/mod/istio.io/[email protected]/pkg/kube/controllers/common.go:312 +0x50
k8s.io/client-go/tools/cache.FilteringResourceEventHandler.OnAdd({0x140009ac090?, {0x102d57ca0?, 0x140009ac078?}}, {0x102cea280, 0x140009daa00}, 0x1)
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/tools/cache/controller.go:302 +0x6c
k8s.io/client-go/tools/cache.(*processorListener).run.func1()
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/tools/cache/shared_informer.go:972 +0x154
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0x30?)
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:226 +0x40
k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0x14000089f60, {0x102d28cc0, 0x140007fae70}, 0x1, 0x14000618780)
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:227 +0x90
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0x140000af760, 0x3b9aca00, 0x0, 0x1, 0x14000618780)
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:204 +0x80
k8s.io/apimachinery/pkg/util/wait.Until(...)
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:161
k8s.io/client-go/tools/cache.(*processorListener).run(0x140008322d0)
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/tools/cache/shared_informer.go:966 +0x68
k8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1()
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:72 +0x5c
created by k8s.io/apimachinery/pkg/util/wait.(*Group).Start in goroutine 69
/Users/jamesmcshane/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:70 +0x7c
exit status 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant