Bug 1377940 - oc observe with --resync-period should prompt --names required rather than cause panic
Summary: oc observe with --resync-period should prompt --names required rather than ca...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 3.9.0
Assignee: Maciej Szulik
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-21 06:03 UTC by Xingxing Xia
Modified: 2019-03-13 22:27 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Nil was causing command to fail. Consequence: Command was panic-ing. Fix: Add nil check. Result: oc observe is working correctly.
Clone Of:
Environment:
Last Closed: 2019-03-13 22:27:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0403 0 None None None 2019-03-13 22:27:29 UTC

Description Xingxing Xia 2016-09-21 06:03:54 UTC
Description of problem:
oc observe with --resync-period should prompt --names required rather than cause panic

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

How reproducible:
Always

Steps to Reproduce:
1. Login to openshift, create project xxia-proj
2. Create sth, e.g. services
$ oc new-app -f https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-stibuild.json
3. Check --resync-period without --names
$ oc observe svc --resync-period=10s -- echo print

Actual results:
3. Caused panic:
# 2016-09-21T13:17:30+08:00 Sync started
# 2016-09-21T13:17:30+08:00 Sync 32365	echo print xxia-proj database
print xxia-proj database
# 2016-09-21T13:17:30+08:00 Sync 32346	echo print xxia-proj frontend
print xxia-proj frontend
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x28 pc=0x12f0539]

goroutine 30 [running]:
panic(0x2488dc0, 0xc82000e0f0)
	/usr/lib/golang/src/runtime/panic.go:481 +0x3e6
github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/cache.(*DeltaFIFO).Resync(0xc820250d10, 0x0, 0x0)
	/builddir/build/BUILD/atomic-openshift-git-0.aede597/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/cache/delta_fifo.go:501 +0xd9
github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/cache.(*Reflector).ListAndWatch.func1(0xc82007e348, 0xc820014cc0, 0xc8207e0c00, 0xc820079c80, 0xc82007e350)
	/builddir/build/BUILD/atomic-openshift-git-0.aede597/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/cache/reflector.go:285 +0x1c2
created by github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/cache.(*Reflector).ListAndWatch
	/builddir/build/BUILD/atomic-openshift-git-0.aede597/_output/local/go/src/github.com/openshift/origin/vendor/k8s.io/kubernetes/pkg/client/cache/reflector.go:292 +0xde3

Expected results:
3. Should prompt --names required, as oc observe -h says for usage of --resync-period.

Additional info:
If --names and --delete are specified, no panic.

Comment 1 Juan Vallejo 2017-10-03 20:05:35 UTC
PR: https://github.com/openshift/origin/pull/16474

Comment 2 Juan Vallejo 2017-10-13 16:54:26 UTC
Upstream PR [1] has merged. Tagging as UpcomingRelease

1. https://github.com/kubernetes/kubernetes/pull/53830

Comment 3 Juan Vallejo 2018-03-07 18:37:22 UTC
The fix from [1] is now in latest master.

1. https://github.com/kubernetes/kubernetes/pull/53830

Comment 4 Xingxing Xia 2018-03-08 09:04:20 UTC
Verified in 3.9.3, no panic now, command works well
$ oc observe svc --resync-period=10s -- echo print
# 2018-03-08T16:57:45+08:00 Sync started
# 2018-03-08T16:57:45+08:00 Sync 218204	echo print xxia-proj myapp
print xxia-proj myapp
# 2018-03-08T16:57:55+08:00 Sync 	echo print xxia-proj myapp
print xxia-proj myapp

Comment 7 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


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