F5Networks / k8s-bigip-ctlr

Repository for F5 Container Ingress Services for Kubernetes & OpenShift.
Apache License 2.0
357 stars 194 forks source link

CIS crashes with "invalid memory address or nil pointer dereference" as soon as CIS-args "namespace-label" is used! #2898

Closed joebride closed 1 year ago

joebride commented 1 year ago

Setup Details

CIS Version : 2.12.1
Build: f5networks/k8s-bigip-ctlr:latest
BIGIP Version: Big IP 15.1.8.1.0.32.3
AS3 Version: 3.34
Agent Mode: AS3
Orchestration: K8S/OSCP v4.9.xx, Kubernetes v1.24.0+3882f8f
Orchestration Version:
Pool Mode: Cluster

Description

I use the CIS in legacy mode (OpenShift Routes). The CIS crashes as soon as I switch to CIS-option "--namespace-label=F5_env=foo". When I switch back to my former multiple CIS-options "--namespace=foo1, ""--namespace=foo2" etc. the CIS does not crash.

Steps To Reproduce

1) Remove CIS-options "--namespace=foo1, ""--namespace=foo2" etc. 2) Add CIS-option "--namespace-label=F5_env=foo". 3) Start CIS

Expected Result

CIS should start normally and should watch Namespaces which use the specified namespace-label.

Actual Result

CIS crashes at starting.

Diagnostic Information

[...]
2023/05/23 13:10:23 [DEBUG] [CORE] Finished syncing namespace xyz (100.315733ms)
2023/05/23 13:10:23 [DEBUG] [CORE] Creating new app informer
2023/05/23 13:10:23 [DEBUG] [CCCL] ConfigWriter (0xc0002b7b60) writing section name vxlan-fdb
2023/05/23 13:10:23 [INFO] [CORE] Not watching Ingress resources.
E0523 13:10:23.792194       1 runtime.go:78] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
goroutine 215 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic({0x167fae0?, 0x2697750})
    /go/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:74 +0x99
k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0x80?})
    /go/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:48 +0x75
panic({0x167fae0, 0x2697750})
    /usr/local/go/src/runtime/panic.go:884 +0x212
github.com/F5Networks/k8s-bigip-ctlr/v2/pkg/appmanager.(*Manager).setupNodeProcessing(0xc000144000)
    /go/src/github.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager/appManager.go:3543 +0x99
github.com/F5Networks/k8s-bigip-ctlr/v2/pkg/appmanager.(*Manager).newAppInformer.func21({0xc00099fe38?, 0x1?})
    /go/src/github.com/F5Networks/k8s-bigip-ctlr/pkg/appmanager/appManager.go:858 +0x1d
k8s.io/client-go/tools/cache.ResourceEventHandlerFuncs.OnAdd(...)
    /go/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/client-go/tools/cache/controller.go:231
k8s.io/client-go/tools/cache.(*processorListener).run.func1()
    /go/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/client-go/tools/cache/shared_informer.go:777 +0x134
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0x26ea2a0?)
    /go/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:155 +0x3e
k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc00042e738?, {0x1ae3220, 0xc000520060}, 0x1, 0xc000224120)
    /go/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:156 +0xb6
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0x10?, 0x3b9aca00, 0x0, 0x31?, 0xc00042e788?)
    /go/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133 +0x89
k8s.io/apimachinery/pkg/util/wait.Until(...)
    /go/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:90
k8s.io/client-go/tools/cache.(*processorListener).run(0xc0000c4300?)
    /go/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/client-go/tools/cache/shared_informer.go:771 +0x6b
k8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1()
    /go/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:73 +0x5a
created by k8s.io/apimachinery/pkg/util/wait.(*Group).Start
    /go/src/github.com/F5Networks/k8s-bigip-ctlr/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:71 +0x85
2023/05/23 13:10:23 [INFO] [CORE] Watching ConfigMap resources.
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=0x1 addr=0x90 pc=0x1420e59]
[...]

Observations (if any)

trinaths commented 1 year ago

Created [CONTCNTR-3976] for internal tracking.