Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1487245 - 'oc get' with 'projectrequest' output as yaml or json causes panic
'oc get' with 'projectrequest' output as yaml or json causes panic
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.6.1
Unspecified Unspecified
medium Severity low
: ---
: 3.7.0
Assigned To: Juan Vallejo
Xingxing Xia
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-31 09:39 EDT by David Caldwell
Modified: 2017-11-28 17:08 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-11-28 17:08:20 EST
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 RHSA-2017:3188 normal SHIPPED_LIVE Moderate: Red Hat OpenShift Container Platform 3.7 security, bug, and enhancement update 2017-11-28 21:34:54 EST

  None (edit)
Description David Caldwell 2017-08-31 09:39:21 EDT
Description of problem:
Executing 'oc get --all-namespaces --output=json projectrequests' causes panic. The combination of 'projectrequests' type and -o to yaml or json seems to cause the problem.

Version-Release number of selected component (if applicable):
3.5
3.6
(Customer logged bug with OCP 3.6.1 but I can reproduce using same command using OCP 3.5)

How reproducible:
Execute 'oc get --all-namespaces --output=json projectrequests' on the CLI 

Steps to Reproduce:
1. Log in to master
2. Execute 'oc get --all-namespaces --output=json projectrequests'
3. 

Actual results:
$ oc get --all-namespaces --output=json projectrequests
panic: interface conversion: runtime.Object is *unversioned.Status, not *runtime.Unstructured

goroutine 1 [running]:
panic(0x1fabce0, 0xc4209ac640)
	/usr/lib/golang/src/runtime/panic.go:500 +0x1a1
github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/kubectl/cmd.RunGet(0x362aae0, 0xc420a385a0, 0x35fcd80, 0xc420026010, 0x35fcd80, 0xc420026018, 0xc4202f2b40, 0xc4206f3710, 0x1, 0x3, ...)
	/builddir/build/BUILD/atomic-openshift-git-0.b6f55a2/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/get.go:341 +0xcda
github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/kubectl/cmd.NewCmdGet.func1(0xc4202f2b40, 0xc4206f3710, 0x1, 0x3)
	/builddir/build/BUILD/atomic-openshift-git-0.b6f55a2/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/get.go:105 +0x95
github.com/openshift/origin/vendor/github.com/spf13/cobra.(*Command).execute(0xc4202f2b40, 0xc4206f3680, 0x3, 0x3, 0xc4202f2b40, 0xc4206f3680)
	/builddir/build/BUILD/atomic-openshift-git-0.b6f55a2/_output/local/go/src/github.com/openshift/origin/vendor/github.com/spf13/cobra/command.go:603 +0x439
github.com/openshift/origin/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc420314240, 0xc420026008, 0xc420026018, 0xc420314240)
	/builddir/build/BUILD/atomic-openshift-git-0.b6f55a2/_output/local/go/src/github.com/openshift/origin/vendor/github.com/spf13/cobra/command.go:689 +0x367
github.com/openshift/origin/vendor/github.com/spf13/cobra.(*Command).Execute(0xc420314240, 0x2, 0xc420314240)
	/builddir/build/BUILD/atomic-openshift-git-0.b6f55a2/_output/local/go/src/github.com/openshift/origin/vendor/github.com/spf13/cobra/command.go:648 +0x2b
main.main()
	/builddir/build/BUILD/atomic-openshift-git-0.b6f55a2/_output/local/go/src/github.com/openshift/origin/cmd/oc/oc.go:36 +0x196

Expected results:
Don't panic

Additional info:
Comment 1 Juan Vallejo 2017-08-31 09:51:09 EDT
Related github issue: https://github.com/openshift/origin/issues/16064
Comment 2 Juan Vallejo 2017-08-31 14:38:19 EDT
Upstream PR: https://github.com/kubernetes/kubernetes/pull/51727
Comment 3 Juan Vallejo 2017-09-11 11:07:03 EDT
Origin PR (patch available in latest master): https://github.com/openshift/origin/pull/16082
Comment 4 shahan 2017-09-12 00:03:48 EDT
Checked this issue on oc v3.7.0-alpha.1+37bf502-282 version, it works well now.
[hasha@mypc origin]$ git log --pretty="%h %an %cd - %s"   37bf502  |   grep   '#16082'
4c6b2eb OpenShift Merge Robot Fri Sep 8 22:03:25 2017 -0700 - Merge pull request #16082 from juanvallejo/jvallejo/ensure-unstructured-objects-before-composing

[root@test ~]#oc get --all-namespaces --output=json projectrequests
{
    "apiVersion": "v1",
    "items": [
        {
            "apiVersion": "v1",
            "kind": "Status",
            "metadata": {},
            "status": "Success"
        }
    ],
    "kind": "List",
    "metadata": {
        "resourceVersion": "",
        "selfLink": ""
    }
}
Changed status to verified
Comment 11 errata-xmlrpc 2017-11-28 17:08:20 EST
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/RHSA-2017:3188

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