Observed a panic: "invalid memory address or nil pointer dereference"

I am creating an Ingress resource using some cert-manager annotations and suddenly kong-ingress-controller starts to crash.

Kong Ingress controller
  Release:    0.5.0
  Build:      922ae26b
  Repository: git@github.com:Kong/kubernetes-ingress-controller.git
  Go:         go1.12.6
-------------------------------------------------------------------------------
I0916 12:05:43.117007       1 main.go:303] Creating API client for https://10.0.0.1:443
I0916 12:05:43.147502       1 main.go:347] Running in Kubernetes Cluster version v1.14 (v1.14.6) - git (clean) commit 96fac5cd13a5dc064f7d9f4f23030a6aeface6cc - platform linux/amd64
I0916 12:05:43.682854       1 main.go:148] kong version: 1.3.0
I0916 12:05:43.682877       1 main.go:151] Kong datastore: postgres
I0916 12:05:44.130789       1 controller.go:235] starting Ingress controller
I0916 12:05:44.148526       1 status.go:199] new leader elected: kong-kong-controller-8fc8f84c4-84jwh
E0916 12:05:47.467372       1 runtime.go:69] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190404173353-6a84e37a896d/pkg/util/runtime/runtime.go:76
/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190404173353-6a84e37a896d/pkg/util/runtime/runtime.go:65
/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190404173353-6a84e37a896d/pkg/util/runtime/runtime.go:51
/usr/local/go/src/runtime/panic.go:522
/usr/local/go/src/runtime/panic.go:82
/usr/local/go/src/runtime/signal_unix.go:390
/kong-ingress-controller/internal/ingress/controller/parser/parser.go:248
/kong-ingress-controller/internal/ingress/controller/parser/parser.go:124
/kong-ingress-controller/internal/ingress/controller/controller.go:119
/kong-ingress-controller/internal/ingress/task/queue.go:112
/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190404173353-6a84e37a896d/pkg/util/wait/wait.go:152
/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190404173353-6a84e37a896d/pkg/util/wait/wait.go:153
/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190404173353-6a84e37a896d/pkg/util/wait/wait.go:88
/kong-ingress-controller/internal/ingress/task/queue.go:59
/usr/local/go/src/runtime/asm_amd64.s:1337
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=0x10690a2]
goroutine 150 [running]:
k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
    /go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190404173353-6a84e37a896d/pkg/util/runtime/runtime.go:58 +0x105
panic(0x13691e0, 0x22abc40)
    /usr/local/go/src/runtime/panic.go:522 +0x1b5
github.com/kong/kubernetes-ingress-controller/internal/ingress/controller/parser.(*Parser).parseIngressRules(0xc0002f9c38, 0xc0005a99d0, 0x2, 0x2, 0x10, 0x203000, 0x16)
    /kong-ingress-controller/internal/ingress/controller/parser/parser.go:250 +0x132
github.com/kong/kubernetes-ingress-controller/internal/ingress/controller/parser.(*Parser).Build(0xc0002f9c38, 0xc000599a00, 0xc000450d20, 0xc000599a80)
    /kong-ingress-controller/internal/ingress/controller/parser/parser.go:124 +0x79
github.com/kong/kubernetes-ingress-controller/internal/ingress/controller.(*KongController).syncIngress(0xc0002f9ba0, 0x13d0c20, 0xc0005c7a60, 0xc008dc5724, 0xe47f98e95088)
    /kong-ingress-controller/internal/ingress/controller/controller.go:119 +0x1e5
github.com/kong/kubernetes-ingress-controller/internal/ingress/task.(*Queue).worker(0xc000499950)
    /kong-ingress-controller/internal/ingress/task/queue.go:112 +0x2e5
k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1(0xc00023ffa8)
    /go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190404173353-6a84e37a896d/pkg/util/wait/wait.go:152 +0x54
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc000661fa8, 0x3b9aca00, 0x0, 0x1, 0xc000080ea0)
    /go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190404173353-6a84e37a896d/pkg/util/wait/wait.go:153 +0xf8
k8s.io/apimachinery/pkg/util/wait.Until(...)
    /go/pkg/mod/k8s.io/apimachinery@v0.0.0-20190404173353-6a84e37a896d/pkg/util/wait/wait.go:88
github.com/kong/kubernetes-ingress-controller/internal/ingress/task.(*Queue).Run(0xc000499950, 0x3b9aca00, 0xc000080ea0)
    /kong-ingress-controller/internal/ingress/task/queue.go:59 +0x6c
created by github.com/kong/kubernetes-ingress-controller/internal/ingress/controller.(*KongController).Start
    /kong-ingress-controller/internal/ingress/controller/controller.go:243 +0xe9
[I]                                                                                                                                             [I] 

Does someone know about this log? Looks like an allocating memory problem

Just opened up a PR to fix this issue:

1 Like

© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ