ingress-nginx: Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
NGINX Ingress controller version: Release: 0.30.0 Build: git-7e65b90c4 Repository: https://github.com/kubernetes/ingress-nginx nginx version: nginx/1.17.8
Kubernetes version (use kubectl version
):
Client Version: version.Info{Major:“1”, Minor:“17”, GitVersion:“v1.17.3”, GitCommit:“06ad960bfd03b39c8310aaf92d1e7c12ce618213”, GitTreeState:“clean”, BuildDate:“2020-02-11T18:14:22Z”, GoVersion:“go1.13.6”, Compiler:“gc”, Platform:“linux/amd64”}
Server Version: version.Info{Major:“1”, Minor:“17”, GitVersion:“v1.17.3”, GitCommit:“06ad960bfd03b39c8310aaf92d1e7c12ce618213”, GitTreeState:“clean”, BuildDate:“2020-02-11T18:07:13Z”, GoVersion:“go1.13.6”, Compiler:“gc”, Platform:“linux/amd64”}
Environment:
- Cloud provider or hardware configuration: hardware
- OS (e.g. from /etc/os-release): CentOS 7.7
- Kernel (e.g.
uname -a
): Linux 3.10.0-1062.12.1.el7.x86_64 #1 SMP Tue Feb 4 23:02:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
What happened:
I am getting error in NGINX Controller while adding below ingress, After that now its in error. if i delete this ingress Controller is now again in running state.
W0306 16:39:05.723067 6 flags.go:260] SSL certificate chain completion is disabled (--enable-ssl-chain-completion=false)
W0306 16:39:05.723149 6 client_config.go:543] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
I0306 16:39:05.723378 6 main.go:193] Creating API client for https://10.96.0.1:443
I0306 16:39:05.730621 6 main.go:237] Running in Kubernetes cluster version v1.17 (v1.17.3) - git (clean) commit 06ad960bfd03b39c8310aaf92d1e7c12ce618213 - platform linux/amd64
I0306 16:39:06.112296 6 main.go:102] SSL fake certificate created /etc/ingress-controller/ssl/default-fake-certificate.pem
I0306 16:39:06.180460 6 nginx.go:263] Starting NGINX Ingress controller
I0306 16:39:06.208221 6 event.go:281] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress-nginx", Name:"udp-services", UID:"7e7560ab-c4b1-4ab5-9283-108d4f61a6a0", APIVersion:"v1", ResourceVersion:"1381", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-nginx/udp-services
I0306 16:39:06.211197 6 event.go:281] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress-nginx", Name:"nginx-configuration", UID:"db51ad8d-bbf1-43e1-ae8f-1b31d7580cd3", APIVersion:"v1", ResourceVersion:"1377", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-nginx/nginx-configuration
I0306 16:39:06.219682 6 event.go:281] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress-nginx", Name:"tcp-services", UID:"29079ede-4943-4863-9313-0402b8d9894f", APIVersion:"v1", ResourceVersion:"1380", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-nginx/tcp-services
I0306 16:39:07.287198 6 event.go:281] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"kubernetes-dashboard", Name:"kubernetes-dashboard1", UID:"8091c66e-534f-45f9-b554-5045c9ae309b", APIVersion:"networking.k8s.io/v1beta1", ResourceVersion:"346622", FieldPath:""}): type: 'Normal' reason: 'CREATE' Ingress kubernetes-dashboard/kubernetes-dashboard1
I0306 16:39:07.287257 6 event.go:281] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"kubernetes-dashboard", Name:"kubernetes-dashboard", UID:"ee88f247-b00d-4ab5-a136-ef5c903d3944", APIVersion:"networking.k8s.io/v1beta1", ResourceVersion:"343566", FieldPath:""}): type: 'Normal' reason: 'CREATE' Ingress kubernetes-dashboard/kubernetes-dashboard
I0306 16:39:07.287739 6 backend_ssl.go:66] Adding Secret "kubernetes-dashboard/dashboard-admin-sa-token-kfxvc" to the local store
I0306 16:39:07.287816 6 event.go:281] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"kubernetes-dashboard", Name:"kubernetes-dashboard2", UID:"73884b1d-8b92-4800-9ddd-70804c4e4a4f", APIVersion:"networking.k8s.io/v1beta1", ResourceVersion:"351445", FieldPath:""}): type: 'Normal' reason: 'CREATE' Ingress kubernetes-dashboard/kubernetes-dashboard2
I0306 16:39:07.383495 6 nginx.go:760] Starting TLS proxy for SSL Passthrough
I0306 16:39:07.383594 6 nginx.go:307] Starting NGINX process
I0306 16:39:07.383597 6 leaderelection.go:242] attempting to acquire leader lease ingress-nginx/ingress-controller-leader-nginx...
E0306 16:39:07.387342 6 runtime.go:78] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
goroutine 155 [running]:
k8s.io/ingress-nginx/vendor/k8s.io/apimachinery/pkg/util/runtime.logPanic(0x163bb00, 0x276b5b0)
/tmp/go/src/k8s.io/ingress-nginx/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:74 +0xa3
k8s.io/ingress-nginx/vendor/k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
/tmp/go/src/k8s.io/ingress-nginx/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:48 +0x82
panic(0x163bb00, 0x276b5b0)
/home/ubuntu/.gimme/versions/go1.13.8.linux.amd64/src/runtime/panic.go:679 +0x1b2
crypto/x509.(*Certificate).hasSANExtension(...)
/home/ubuntu/.gimme/versions/go1.13.8.linux.amd64/src/crypto/x509/x509.go:787
crypto/x509.(*Certificate).commonNameAsHostname(0x0, 0x1c)
/home/ubuntu/.gimme/versions/go1.13.8.linux.amd64/src/crypto/x509/verify.go:932 +0x82
crypto/x509.(*Certificate).VerifyHostname(0x0, 0xc0006dd5c0, 0x1c, 0xc0004c85a0, 0x0)
/home/ubuntu/.gimme/versions/go1.13.8.linux.amd64/src/crypto/x509/verify.go:1015 +0x22b
k8s.io/ingress-nginx/internal/ingress/controller.(*NGINXController).createServers(0xc0002f4000, 0xc00087e4c0, 0x3, 0x4, 0xc000880540, 0xc0006f5a20, 0x0)
/tmp/go/src/k8s.io/ingress-nginx/internal/ingress/controller/controller.go:1110 +0x173a
k8s.io/ingress-nginx/internal/ingress/controller.(*NGINXController).getBackendServers(0xc0002f4000, 0xc00087e4c0, 0x3, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/tmp/go/src/k8s.io/ingress-nginx/internal/ingress/controller/controller.go:457 +0xe4
k8s.io/ingress-nginx/internal/ingress/controller.(*NGINXController).getConfiguration(0xc0002f4000, 0xc00087e4c0, 0x3, 0x4, 0x4, 0x20, 0x16b7760, 0xc000029a01, 0xc00087e3e0)
/tmp/go/src/k8s.io/ingress-nginx/internal/ingress/controller/controller.go:405 +0x80
k8s.io/ingress-nginx/internal/ingress/controller.(*NGINXController).syncIngress(0xc0002f4000, 0x16dd5a0, 0xc000875300, 0xc0170f7355, 0x102b82e8a55)
/tmp/go/src/k8s.io/ingress-nginx/internal/ingress/controller/controller.go:125 +0xcc
k8s.io/ingress-nginx/internal/task.(*Queue).worker(0xc000546480)
/tmp/go/src/k8s.io/ingress-nginx/internal/task/queue.go:129 +0x30c
k8s.io/ingress-nginx/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1(0xc00068cfa8)
/tmp/go/src/k8s.io/ingress-nginx/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:152 +0x5e
k8s.io/ingress-nginx/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc00089ffa8, 0x3b9aca00, 0x0, 0xb65d01, 0xc000088180)
/tmp/go/src/k8s.io/ingress-nginx/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:153 +0xf8
k8s.io/ingress-nginx/vendor/k8s.io/apimachinery/pkg/util/wait.Until(...)
/tmp/go/src/k8s.io/ingress-nginx/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88
k8s.io/ingress-nginx/internal/task.(*Queue).Run(0xc000546480, 0x3b9aca00, 0xc000088180)
/tmp/go/src/k8s.io/ingress-nginx/internal/task/queue.go:61 +0x6b
created by k8s.io/ingress-nginx/internal/ingress/controller.(*NGINXController).Start
/tmp/go/src/k8s.io/ingress-nginx/internal/ingress/controller/nginx.go:310 +0x48e
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=0x2e8 pc=0x700ec2]
goroutine 155 [running]:
k8s.io/ingress-nginx/vendor/k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
/tmp/go/src/k8s.io/ingress-nginx/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:55 +0x105
panic(0x163bb00, 0x276b5b0)
/home/ubuntu/.gimme/versions/go1.13.8.linux.amd64/src/runtime/panic.go:679 +0x1b2
crypto/x509.(*Certificate).hasSANExtension(...)
/home/ubuntu/.gimme/versions/go1.13.8.linux.amd64/src/crypto/x509/x509.go:787
crypto/x509.(*Certificate).commonNameAsHostname(0x0, 0x1c)
/home/ubuntu/.gimme/versions/go1.13.8.linux.amd64/src/crypto/x509/verify.go:932 +0x82
crypto/x509.(*Certificate).VerifyHostname(0x0, 0xc0006dd5c0, 0x1c, 0xc0004c85a0, 0x0)
/home/ubuntu/.gimme/versions/go1.13.8.linux.amd64/src/crypto/x509/verify.go:1015 +0x22b
k8s.io/ingress-nginx/internal/ingress/controller.(*NGINXController).createServers(0xc0002f4000, 0xc00087e4c0, 0x3, 0x4, 0xc000880540, 0xc0006f5a20, 0x0)
/tmp/go/src/k8s.io/ingress-nginx/internal/ingress/controller/controller.go:1110 +0x173a
k8s.io/ingress-nginx/internal/ingress/controller.(*NGINXController).getBackendServers(0xc0002f4000, 0xc00087e4c0, 0x3, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/tmp/go/src/k8s.io/ingress-nginx/internal/ingress/controller/controller.go:457 +0xe4
k8s.io/ingress-nginx/internal/ingress/controller.(*NGINXController).getConfiguration(0xc0002f4000, 0xc00087e4c0, 0x3, 0x4, 0x4, 0x20, 0x16b7760, 0xc000029a01, 0xc00087e3e0)
/tmp/go/src/k8s.io/ingress-nginx/internal/ingress/controller/controller.go:405 +0x80
k8s.io/ingress-nginx/internal/ingress/controller.(*NGINXController).syncIngress(0xc0002f4000, 0x16dd5a0, 0xc000875300, 0xc0170f7355, 0x102b82e8a55)
/tmp/go/src/k8s.io/ingress-nginx/internal/ingress/controller/controller.go:125 +0xcc
k8s.io/ingress-nginx/internal/task.(*Queue).worker(0xc000546480)
/tmp/go/src/k8s.io/ingress-nginx/internal/task/queue.go:129 +0x30c
k8s.io/ingress-nginx/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1(0xc00068cfa8)
/tmp/go/src/k8s.io/ingress-nginx/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:152 +0x5e
k8s.io/ingress-nginx/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc00089ffa8, 0x3b9aca00, 0x0, 0xb65d01, 0xc000088180)
/tmp/go/src/k8s.io/ingress-nginx/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:153 +0xf8
k8s.io/ingress-nginx/vendor/k8s.io/apimachinery/pkg/util/wait.Until(...)
/tmp/go/src/k8s.io/ingress-nginx/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88
k8s.io/ingress-nginx/internal/task.(*Queue).Run(0xc000546480, 0x3b9aca00, 0xc000088180)
/tmp/go/src/k8s.io/ingress-nginx/internal/task/queue.go:61 +0x6b
created by k8s.io/ingress-nginx/internal/ingress/controller.(*NGINXController).Start
/tmp/go/src/k8s.io/ingress-nginx/internal/ingress/controller/nginx.go:310 +0x48e
What you expected to happen:
it should accept ingress or show error if syntax is not correct
How to reproduce it:
Create an ingress
echo "
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
annotations:
ingress.kubernetes.io/ssl-passthrough: "true"
nginx.org/ssl-backends: "kubernetes-dashboard"
kubernetes.io/ingress.allow-http: "false"
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
name: kubernetes-dashboard2
namespace: kubernetes-dashboard
spec:
tls:
- hosts:
- 123.com
secretName: kubernetes-dashboard-certs
rules:
- host: 123.com
http:
paths:
- path: /dashboard1
backend:
serviceName: kubernetes-dashboard
servicePort: 443
" | kubectl apply -f -
/kind bug
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 19 (10 by maintainers)
Please use
quay.io/kubernetes-ingress-controller/nginx-ingress-controller-amd64:dev
This image contains #5225Ok, that is not a valid secret for SSL. What command are you using to generate the secret?