Bug 1421632

Summary: Observed a panic: "invalid memory address or nil pointer dereference" when creating ingress with malformed file
Product: OpenShift Container Platform Reporter: Hongan Li <hongli>
Component: NetworkingAssignee: Maru Newby <mnewby>
Networking sub component: router QA Contact: zhaozhanqi <zzhao>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: aos-bugs, bbennett, eparis, mnewby, tdawson
Version: 3.5.0   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-12 19:12:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Hongan Li 2017-02-13 10:12:27 UTC
Description of problem:
Observed a panic: "invalid memory address or nil pointer dereference" when creating ingress with malformed file  

Version-Release number of selected component (if applicable):
openshift v3.5.0.19+199197c
kubernetes v1.5.2+43a9be4
etcd 3.1.0

router image: ose-haproxy-router  v3.5.0.19    525568cc07b5

How reproducible:
always

Steps to Reproduce:
1. enable ingress
# oc env dc/router ROUTER_ENABLE_INGRESS=true
2. create ingress from malformed file (host without http section) :
# oc create -f error-ingress.yaml -n u2p2
ingress "test" created
# cat error-ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: test
spec:
  rules:
  - host: foo.bar.com


Actual results:
The ingress is created but error logs in haproxy router pod:
E0213 09:48:24.357266       1 runtime.go:64] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
/builddir/build/BUILD/atomic-openshift-git-0.199197c/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/util/runtime/runtime.go:70
/builddir/build/BUILD/atomic-openshift-git-0.199197c/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/util/runtime/runtime.go:63
/builddir/build/BUILD/atomic-openshift-git-0.199197c/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/util/runtime/runtime.go:49
/usr/lib/golang/src/runtime/asm_amd64.s:479
/usr/lib/golang/src/runtime/panic.go:458
/usr/lib/golang/src/runtime/panic.go:62
/usr/lib/golang/src/runtime/sigpanic_unix.go:24
/builddir/build/BUILD/atomic-openshift-git-0.199197c/_output/local/go/src/github.com/openshift/origin/pkg/router/controller/ingress.go:443
/builddir/build/BUILD/atomic-openshift-git-0.199197c/_output/local/go/src/github.com/openshift/origin/pkg/router/controller/ingress.go:244
/builddir/build/BUILD/atomic-openshift-git-0.199197c/_output/local/go/src/github.com/openshift/origin/pkg/router/controller/ingress.go:209
/builddir/build/BUILD/atomic-openshift-git-0.199197c/_output/local/go/src/github.com/openshift/origin/pkg/router/controller/ingress.go:129
/builddir/build/BUILD/atomic-openshift-git-0.199197c/_output/local/go/src/github.com/openshift/origin/pkg/router/controller/controller.go:239
/builddir/build/BUILD/atomic-openshift-git-0.199197c/_output/local/go/src/github.com/openshift/origin/pkg/router/controller/controller.go:81
/builddir/build/BUILD/atomic-openshift-git-0.199197c/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/util/wait/wait.go:96
/builddir/build/BUILD/atomic-openshift-git-0.199197c/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/util/wait/wait.go:97
/builddir/build/BUILD/atomic-openshift-git-0.199197c/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/util/wait/wait.go:52
/builddir/build/BUILD/atomic-openshift-git-0.199197c/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/util/wait/wait.go:43
/usr/lib/golang/src/runtime/asm_amd64.s:2086

Expected results:
should not show panic error

Additional info:
the ingress is created and you can get ingress:
[root@host-8-175-173 ~]# oc get ingress -n u2p2 -o yaml
apiVersion: v1
items:
- apiVersion: extensions/v1beta1
  kind: Ingress
  metadata:
    creationTimestamp: 2017-02-13T09:48:24Z
    generation: 1
    name: test
    namespace: u2p2
    resourceVersion: "8502"
    selfLink: /apis/extensions/v1beta1/namespaces/u2p2/ingresses/test
    uid: 8fbfb046-f1d1-11e6-926a-fa163e172ae0
  spec:
    rules:
    - host: foo.bar.com
  status:
    loadBalancer: {}
kind: List
metadata: {}
resourceVersion: ""
selfLink: ""
[root@host-8-175-173 ~]#

Comment 1 Maru Newby 2017-02-13 18:25:35 UTC
Fixed in linked github PR.

Comment 2 Troy Dawson 2017-02-16 20:31:46 UTC
This has been merged into ocp and is in OCP v3.5.0.21 or newer.

Comment 4 Hongan Li 2017-02-17 09:08:06 UTC
verified in OCP openshift v3.5.0.26-1+da1be19 and issue has been fixed.
there is no panic error log in router pod.

Comment 6 errata-xmlrpc 2017-04-12 19:12:31 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:0884