Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1612661 - `oc debug ... -- $command` will meet panic error
`oc debug ... -- $command` will meet panic error
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.11.0
Unspecified Unspecified
high Severity high
: ---
: 3.11.0
Assigned To: Juan Vallejo
Xingxing Xia
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2018-08-06 02:01 EDT by zhou ying
Modified: 2018-10-11 03:23 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-10-11 03:23:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:2652 None None None 2018-10-11 03:23 EDT

  None (edit)
Description zhou ying 2018-08-06 02:01:43 EDT
Description of problem:
`oc debug ... -- $command` will meet panic error. `oc debug ...` without $command works

Version-Release number of selected component (if applicable):
oc v3.11.0-0.11.0
kubernetes v1.11.0+d4cacc0
openshift v3.11.0-0.11.0

How reproducible:
always

Steps to Reproduce:
1. Create a DC:
  `oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/deployment/dc-with-two-containers.yaml`

2. Try to debug the running deployment with command:
  ` oc debug dc/dctest -- /bin/env`



Actual results:
2. Met panic error:
[root@dhcp-141-94 ~]# oc debug dc/dctest -- /bin/env
Defaulting container name to dctest-1.
Use 'oc describe pod/dctest-debug -n zhouyt' to see all of the containers in this pod.

Debugging with pod/dctest-debug, original command: /hello-openshift
Waiting for pod to start ...

Removing debug pod ...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x2435826]

goroutine 1 [running]:
github.com/openshift/origin/pkg/oc/originpolymorphichelpers.NewLogsForObjectFn.func1(0x0, 0x0, 0x3102500, 0xc4214f6e00, 0x3102600, 0xc421a24f00, 0x0, 0xc421786ab0, 0x829966, 0xc421364ea0)
    /builddir/build/BUILD/atomic-openshift-git-0.c5fa1e4/_output/local/go/src/github.com/openshift/origin/pkg/oc/originpolymorphichelpers/logsforobject.go:33 +0x46
github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/kubectl/cmd.LogsOptions.getLogs(0x0, 0x0, 0x0, 0x0, 0x0, 0x3102600, 0xc421a24f00, 0x3102500, 0xc4214f6e00, 0x0, ...)
    /builddir/build/BUILD/atomic-openshift-git-0.c5fa1e4/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/logs.go:285 +0x93
github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/kubectl/cmd.LogsOptions.getPodLogs(0x0, 0x0, 0x0, 0x0, 0x0, 0x3102600, 0xc421a24f00, 0x3102500, 0xc4214f6e00, 0x0, ...)
    /builddir/build/BUILD/atomic-openshift-git-0.c5fa1e4/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/logs.go:266 +0x3a7
github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/kubectl/cmd.LogsOptions.RunLogs(0x0, 0x0, 0x0, 0x0, 0x0, 0x3102600, 0xc421a24f00, 0x3102500, 0xc4214f6e00, 0x0, ...)
    /builddir/build/BUILD/atomic-openshift-git-0.c5fa1e4/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/logs.go:256 +0x147
github.com/openshift/origin/pkg/oc/cli/debug.(*DebugOptions).RunDebug.func3(0xc400000008, 0x2e406a8)
    /builddir/build/BUILD/atomic-openshift-git-0.c5fa1e4/_output/local/go/src/github.com/openshift/origin/pkg/oc/cli/debug/debug.go:452 +0x501
github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/util/interrupt.(*Handler).Run(0xc421a807b0, 0xc421787848, 0x0, 0x0)
    /builddir/build/BUILD/atomic-openshift-git-0.c5fa1e4/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/util/interrupt/interrupt.go:103 +0xff
github.com/openshift/origin/pkg/oc/cli/debug.(*DebugOptions).RunDebug(0xc420987180, 0x0, 0x0)
    /builddir/build/BUILD/atomic-openshift-git-0.c5fa1e4/_output/local/go/src/github.com/openshift/origin/pkg/oc/cli/debug/debug.go:427 +0xd86
github.com/openshift/origin/pkg/oc/cli/debug.NewCmdDebug.func1(0xc420987400, 0xc4211127b0, 0x2, 0x3)
    /builddir/build/BUILD/atomic-openshift-git-0.c5fa1e4/_output/local/go/src/github.com/openshift/origin/pkg/oc/cli/debug/debug.go:171 +0x104
github.com/openshift/origin/vendor/github.com/spf13/cobra.(*Command).execute(0xc420987400, 0xc421112720, 0x3, 0x3, 0xc420987400, 0xc421112720)
    /builddir/build/BUILD/atomic-openshift-git-0.c5fa1e4/_output/local/go/src/github.com/openshift/origin/vendor/github.com/spf13/cobra/command.go:760 +0x2c1
github.com/openshift/origin/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc420d2cf00, 0xc4200cc000, 0xc4200cc010, 0xc420d2cf00)
    /builddir/build/BUILD/atomic-openshift-git-0.c5fa1e4/_output/local/go/src/github.com/openshift/origin/vendor/github.com/spf13/cobra/command.go:846 +0x30a
github.com/openshift/origin/vendor/github.com/spf13/cobra.(*Command).Execute(0xc420d2cf00, 0x2, 0xc420d2cf00)
    /builddir/build/BUILD/atomic-openshift-git-0.c5fa1e4/_output/local/go/src/github.com/openshift/origin/vendor/github.com/spf13/cobra/command.go:794 +0x2b
main.main()
    /builddir/build/BUILD/atomic-openshift-git-0.c5fa1e4/_output/local/go/src/github.com/openshift/origin/cmd/oc/oc.go:49 +0x365



Expected results:
2. Could debug running deployment.


Additional info:
Comment 1 Juan Vallejo 2018-08-06 13:53:22 EDT
Origin PR https://github.com/openshift/origin/pull/20550
Comment 2 Juan Vallejo 2018-08-14 10:20:00 EDT
Origin PR has merged. Moving to MODIFIED
Comment 4 zhou ying 2018-08-23 22:18:40 EDT
Confrimed with latest OCP , the issue has fixed:

oc v3.11.0-0.21.0
kubernetes v1.11.0+d4cacc0

openshift v3.11.0-0.21.0
Comment 6 errata-xmlrpc 2018-10-11 03:23:29 EDT
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-2018:2652

Note You need to log in before you can comment on or make changes to this bug.