OT-CONTAINER-KIT / helm-charts

A repository which that will contain helm charts with best and security practices.
https://ot-container-kit.github.io/helm-charts
49 stars 84 forks source link

Error on BottleRocket AMI: panic: runtime error: invalid memory address or nil pointer dereference #199

Closed VolodymyrSmahliuk closed 4 months ago

VolodymyrSmahliuk commented 4 months ago

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (kubectl version)?

OS: linux (amd64) OS Image: Bottlerocket OS 1.20.2 (aws-k8s-1.30) Kernel version: 6.1.90 Container runtime: containerd://1.6.31+bottlerocket Kubelet version: v1.30.0-eks-fff26e3

kubectl version Output
$ kubectl version

WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.2", GitCommit:"7f6f68fdabc4df88cfea2dcf9a19b2b830f1e647", GitTreeState:"clean", BuildDate:"2023-05-17T14:13:27Z", GoVersion:"go1.20.4", Compiler:"gc", Platform:"darwin/arm64"}
Kustomize Version: v5.0.1
Server Version: version.Info{Major:"1", Minor:"30+", GitVersion:"v1.30.0-eks-036c24b", GitCommit:"59ddf7809432afedd41a880c1dfa8cedb39e5a1c", GitTreeState:"clean", BuildDate:"2024-04-30T23:53:46Z", GoVersion:"go1.22.2", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.27) and server (1.30) exceeds the supported minor version skew of +/-1

What did you do?

  1. Followed the https://github.com/OT-CONTAINER-KIT/helm-charts/blob/main/charts/redis-operator/readme.md to install the redis-operator helm chart.
  2. Followed the https://github.com/OT-CONTAINER-KIT/helm-charts/blob/main/charts/redis/README.md to install the stand-alone redis instance.

What did you expect to see?

The Stand-alone Redis Instance is up and running

What did you see instead?

Got an ERROR ```log {"level":"info","ts":"2024-06-21T06:59:34Z","logger":"controllers.Redis","msg":"Reconciling opstree redis controller","Request.Namespace":"thebigpos","Request.Name":"redis"} {"level":"info","ts":"2024-06-21T06:59:34Z","msg":"Starting workers","controller":"redisreplication","controllerGroup":"redis.redis.opstreelabs.in","controllerKind":"RedisReplication","worker count":1} {"level":"info","ts":"2024-06-21T06:59:34Z", "msg":"Observed a panic in reconciler: runtime error: invalid memory address or nil pointer dereference", "controller":"redis","controllerGroup":"redis.redis.opstreelabs.in","controllerKind":"Redis","Redis":{"name":"redis","namespace":"thebigpos"},"namespace":"thebigpos","name":"redis","reconcileID":"88f19a5e-dd19-41af-8db4-60d95e80b63b"} 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=0x0 pc=0x17a70e8] goroutine 144 [running]: sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1() /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:116 +0x1e5 panic({0x19cf900?, 0x2cc0ca0?}) /usr/local/go/src/runtime/panic.go:914 +0x21f github.com/OT-CONTAINER-KIT/redis-operator/k8sutils.getProbeInfo(0x0, 0x0?, 0x0, 0x0) /workspace/k8sutils/statefulset.go:617 +0x3e8 github.com/OT-CONTAINER-KIT/redis-operator/k8sutils.generateContainerDef({_, _}, {{0xc00005b900, 0x1d}, {0xc0006229a0, 0xc}, 0x0, 0x0, {0xc000057680, 0x26}, ...}, ...) /workspace/k8sutils/statefulset.go:369 +0x159 github.com/OT-CONTAINER-KIT/redis-operator/k8sutils.generateStatefulSetsDef({{0xc000622986, 0x5}, {0x0, 0x0}, {0xc000622990, 0x9}, {0x0, 0x0}, {0x0, 0x0}, ...}, ...) /workspace/k8sutils/statefulset.go:234 +0x467 github.com/OT-CONTAINER-KIT/redis-operator/k8sutils.CreateOrUpdateStateFul({_, _}, {{_, _}, _}, {_, _}, {{0xc000622986, 0x5}, {0x0, ...}, ...}, ...) /workspace/k8sutils/statefulset.go:100 +0x1a5 github.com/OT-CONTAINER-KIT/redis-operator/k8sutils.CreateStandaloneRedis(0xc0005f38c0, {0x1f12bd0, 0xc000279860}) /workspace/k8sutils/redis-standalone.go:59 +0x853 github.com/OT-CONTAINER-KIT/redis-operator/controllers.(*RedisReconciler).Reconcile(0xc000468690, {0x0?, 0x0?}, {{{0xc000622990?, 0x5?}, {0xc000622986?, 0xc0004d3d08?}}}) /workspace/controllers/redis_controller.go:67 +0x346 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x1efc1d0?, {0x1ef8ed0?, 0xc000621b90?}, {{{0xc000622990?, 0xb?}, {0xc000622986?, 0x0?}}}) /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:119 +0xb7 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0003019a0, {0x1ef8f08, 0xc0001c4af0}, {0x1a86860?, 0xc000051040?}) /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:316 +0x3cc sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0003019a0, {0x1ef8f08, 0xc0001c4af0}) /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:266 +0x1af sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2() /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:227 +0x79 created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2 in goroutine 69 /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:223 +0x565 ```

Full log in the attachments: redis-operator.log

VolodymyrSmahliuk commented 4 months ago

I accidentally created the issue in the wrong repo