Skip to content

Error collecting telemetry when custom-resources flag is turned off #5744

@vepatel

Description

@vepatel

Describe the bug

  • IC is trying to collect CR count even when custom-resources flag is turned off.

https://github.com/nginxinc/kubernetes-ingress/blob/main/internal/telemetry/collector.go#L204

Args:
      -nginx-configmaps=$(POD_NAMESPACE)/nginx-config
      -report-ingress-status
      -external-service=nginx-ingress
      -enable-custom-resources=false
E0613 16:04:14.928064       1 runtime.go:79] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
goroutine 398 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic({0x1eee0e0, 0x38797d0})
        k8s.io/apimachinery@v0.30.1/pkg/util/runtime/runtime.go:75 +0x85
k8s.io/apimachinery/pkg/util/runtime.HandleCrash({0x0, 0x0, 0xc0005cd340?})
        k8s.io/apimachinery@v0.30.1/pkg/util/runtime/runtime.go:49 +0x6b
panic({0x1eee0e0?, 0x38797d0?})
        runtime/panic.go:770 +0x132
github.com/nginxinc/kubernetes-ingress/internal/k8s.(*LoadBalancerController).getAllPolicies(0xc0000c4008)
        github.com/nginxinc/kubernetes-ingress/internal/k8s/controller.go:3483 +0xbe
github.com/nginxinc/kubernetes-ingress/internal/telemetry.(*Collector).PolicyCount(0xc00082c4d0)
        github.com/nginxinc/kubernetes-ingress/internal/telemetry/cluster.go:170 +0x45
github.com/nginxinc/kubernetes-ingress/internal/telemetry.(*Collector).BuildReport(_, {_, _})
        github.com/nginxinc/kubernetes-ingress/internal/telemetry/collector.go:219 +0x85
github.com/nginxinc/kubernetes-ingress/internal/telemetry.(*Collector).Collect(0xc00082c4d0, {0x26eb3f0, 0xc00081e460})
        github.com/nginxinc/kubernetes-ingress/internal/telemetry/collector.go:110 +0xd0
k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1()
        k8s.io/apimachinery@v0.30.1/pkg/util/wait/backoff.go:259 +0x1f
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0x30?)
        k8s.io/apimachinery@v0.30.1/pkg/util/wait/backoff.go:226 +0x33
k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc000517f08, {0x26c7de0, 0xc000264b70}, 0x1, 0xc00082a600)
        k8s.io/apimachinery@v0.30.1/pkg/util/wait/backoff.go:227 +0xaf
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc000878f08, 0x4e94914f0000, 0x3fb999999999999a, 0x1, 0xc00082a600)
        k8s.io/apimachinery@v0.30.1/pkg/util/wait/backoff.go:204 +0x7f
k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext({0x26eb3f0, 0xc00081e460}, 0xc000878f98, 0x4e94914f0000, 0x3fb999999999999a, 0x1)
        k8s.io/apimachinery@v0.30.1/pkg/util/wait/backoff.go:259 +0x93
github.com/nginxinc/kubernetes-ingress/internal/telemetry.(*Collector).Start(...)
        github.com/nginxinc/kubernetes-ingress/internal/telemetry/collector.go:103
github.com/nginxinc/kubernetes-ingress/internal/k8s.(*LoadBalancerController).Run.func3({0x26eb3f0?, 0xc00081e460?})
        github.com/nginxinc/kubernetes-ingress/internal/k8s/controller.go:745 +0xd7
created by github.com/nginxinc/kubernetes-ingress/internal/k8s.(*LoadBalancerController).Run in goroutine 1
        github.com/nginxinc/kubernetes-ingress/internal/k8s/controller.go:742 +0x61e
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=0x38 pc=0x1c4205e]

Metadata

Metadata

Assignees

Labels

backlogPull requests/issues that are backlog itemsbugAn issue reporting a potential bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions