Bug 1532289

Summary: oc client crashing on status
Product: OpenShift Container Platform Reporter: Matthew Robson <mrobson>
Component: ocAssignee: Maciej Szulik <maszulik>
Status: CLOSED ERRATA QA Contact: Xingxing Xia <xxia>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.6.1CC: aos-bugs, jokerman, jrosenta, mmccomas
Target Milestone: ---   
Target Release: 3.9.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Empty template was causing a panic in oc status. Consequence: oc status was sometimes panicing. Fix: Properly react when pod template is nil. Result: oc status is working as expected.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-13 22:27:23 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 Matthew Robson 2018-01-08 15:21:41 UTC
Description of problem:

Attempting to deploy an application the oc command line panics. It does a panic when attempting to do ‘oc status’ on a specific project.

oc status
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0xe8 pc=0x1b646ac]

goroutine 1 [running]:
panic(0x3833240, 0xc042004090)
        /usr/lib/golang/src/runtime/panic.go:500 +0x1af
github.com/openshift/origin/pkg/deploy/graph.AddVolumeClaimEdges(0x61365c0, 0xc042f43a40, 0x612edc0, 0x6273688, 0x6130bc0, 0xc042f43a40, 0xc042f43a70, 0xc042f43
a40, 0xc0429bfbf0)
        /builddir/build/BUILD/atomic-openshift-git-0.f95b0e7/_output/local/go/src/github.com/openshift/origin/pkg/deploy/graph/edges.go:95 +0x4c
github.com/openshift/origin/pkg/deploy/graph.AddAllVolumeClaimEdges(0x61365c0, 0xc042f43a40, 0x612edc0, 0x6273688, 0x6130bc0, 0xc042f43a40, 0xc042f43a70, 0xc042
f43a40)
        /builddir/build/BUILD/atomic-openshift-git-0.f95b0e7/_output/local/go/src/github.com/openshift/origin/pkg/deploy/graph/edges.go:117 +0xbf
github.com/openshift/origin/pkg/cmd/cli/describe.(*ProjectStatusDescriber).MakeGraph(0xc042f68960, 0xc042ecbbe0, 0x17, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /builddir/build/BUILD/atomic-openshift-git-0.f95b0e7/_output/local/go/src/github.com/openshift/origin/pkg/cmd/cli/describe/projectstatus.go:139 +0x1adf
github.com/openshift/origin/pkg/cmd/cli/describe.(*ProjectStatusDescriber).Describe(0xc042f68960, 0xc042ecbbe0, 0x17, 0x0, 0x0, 0xc042ed87b0, 0x0, 0x0, 0x1)
        /builddir/build/BUILD/atomic-openshift-git-0.f95b0e7/_output/local/go/src/github.com/openshift/origin/pkg/cmd/cli/describe/projectstatus.go:151 +0xe6
github.com/openshift/origin/pkg/cmd/cli/cmd.StatusOptions.RunStatus(0xc042ecbbe0, 0x17, 0x0, 0x0, 0x0, 0xc042f68960, 0x6102a80, 0xc042024010, 0x0, 0xc042257d49,
...)
        /builddir/build/BUILD/atomic-openshift-git-0.f95b0e7/_output/local/go/src/github.com/openshift/origin/pkg/cmd/cli/cmd/status.go:182 +0x3af
github.com/openshift/origin/pkg/cmd/cli/cmd.NewCmdStatus.func1(0xc04222afc0, 0x6273688, 0x0, 0x0)
        /builddir/build/BUILD/atomic-openshift-git-0.f95b0e7/_output/local/go/src/github.com/openshift/origin/pkg/cmd/cli/cmd/status.go:80 +0x150
github.com/openshift/origin/vendor/github.com/spf13/cobra.(*Command).execute(0xc04222afc0, 0x6273688, 0x0, 0x0, 0xc04222afc0, 0x6273688)
        /builddir/build/BUILD/atomic-openshift-git-0.f95b0e7/_output/local/go/src/github.com/openshift/origin/vendor/github.com/spf13/cobra/command.go:603 +0x44
0
github.com/openshift/origin/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc042255440, 0xc042024008, 0xc042024018, 0xc042255440)
        /builddir/build/BUILD/atomic-openshift-git-0.f95b0e7/_output/local/go/src/github.com/openshift/origin/vendor/github.com/spf13/cobra/command.go:689 +0x36
e
github.com/openshift/origin/vendor/github.com/spf13/cobra.(*Command).Execute(0xc042255440, 0x2, 0xc042255440)
        /builddir/build/BUILD/atomic-openshift-git-0.f95b0e7/_output/local/go/src/github.com/openshift/origin/vendor/github.com/spf13/cobra/command.go:648 +0x32

main.main()
        /builddir/build/BUILD/atomic-openshift-git-0.f95b0e7/_output/local/go/src/github.com/openshift/origin/cmd/oc/oc.go:36 +0x19d


This was reported upstream as well: https://github.com/openshift/origin/issues/17977


Version-Release number of selected component (if applicable):


How reproducible:

oc version
oc v3.6.173.0.21
kubernetes v1.6.1+5115d708d7
features: Basic-Auth

Server ***
openshift v3.6.173.0.21
kubernetes v1.6.1+5115d708d7

Steps to Reproduce:
1.
2.
3.

Actual results:

client crashes

Expected results:

client not crashing

Additional info:

Comment 2 Juan Vallejo 2018-01-08 15:32:17 UTC
Ongoing discussion: https://github.com/openshift/origin/pull/17983

Comment 6 Juan Vallejo 2018-01-15 16:06:01 UTC
PR [1] has merged. Moving to ON_QA.

1. https://github.com/openshift/origin/pull/17983

Comment 7 Xingxing Xia 2018-01-16 10:46:31 UTC
Checked the reproducing steps with oc/OCP v3.9.0-0.19.0:
$ oc new-app openshift/hello-openshift
$ oc autoscale dc hello-openshift --max=4

$ oc delete dc hello-openshift
$ oc status
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xf0 pc=0x220c3a5]

goroutine 1 [running]:
github.com/openshift/origin/pkg/apps/graph.AddVolumeClaimEdges(0x7a95320, 0xc420a4ef30, 0x7a8c6c0, 0x7e9fac8, 0x7a8e600, 0xc420a4ef30, 0xc420a4ef60, 0xc420a4ef30, 0xc421170180)
...

While checked with latest oc/OCP v3.9.0-0.20.0, above panic is gone, `oc status` shows:
In project xxia-proj on server https://MASTER:8443

svc/myapp - 172.30.168.20 ports 8080, 8888

dc/myapp deploys (manual)

Errors:
  * hpa/myapp is attempting to scale DeploymentConfig/myapp, which doesn't exist

View details with 'oc describe <resource>/<name>' or list everything with 'oc get all'.

Comment 8 Xingxing Xia 2018-01-16 11:00:39 UTC
Also checked k8s deployment and hpa, found another issue, using another bug 1534956 to track it. Please check

Comment 11 errata-xmlrpc 2019-03-13 22:27:23 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-2019:0403