Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can kill OpenShift process with go panic by invalid json file #4374

Closed
nak3 opened this issue Aug 26, 2015 · 4 comments
Closed

Can kill OpenShift process with go panic by invalid json file #4374

nak3 opened this issue Aug 26, 2015 · 4 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/P0

Comments

@nak3
Copy link
Member

nak3 commented Aug 26, 2015

Env

# openshift version
openshift v1.0.5-27-g2cc96dc
kubernetes v1.1.0-alpha.0-1605-g44c91b1

# go version
go version go1.4.2 linux/amd64

NOTE: I couldn't reproduce this issue with OSE v3.0.1.0 due to another error.

Issue:

  • We can kill OpenShift process by sending request with invalid json file.
  • Please see following steps.

Reproduce steps

step-1. Start openshift origin with standalone mode, and create route and docker-registry. (Followed with here)

step-2. Send invalid json file by my origin-killer.json

[root@localhost ~]# oc create -f https://gist.githubusercontent.com/nak3/23de3850fd3abf5ed038/raw/eba398a3e778459ca21ff8f60371e708566f7950/origin-killer.json
imagestream "sti-python" created
Unable to connect to the server: EOF
The connection to the server 192.168.122.27:8443 was refused - did you specify the right host or port?
The connection to the server 192.168.122.27:8443 was refused - did you specify the right host or port?

step-3. You can see go panic and stop the OpenShift process

The log is here: https://kenjiro.fedorapeople.org/misc/logs/origin.log (Too long, please check from the bottom.)

@liggitt
Copy link
Contributor

liggitt commented Aug 26, 2015

I0826 16:21:40.165796    2410 image_change_controller.go:47] Build image change controller detected ImageStream change 172.30.157.204:5000/default/sti-python
I0826 16:21:40.166325    2410 controller.go:38] Detecting changed images for DeploymentConfig default/docker-registry:1
I0826 16:21:40.166483    2410 controller.go:38] Detecting changed images for DeploymentConfig default/router:1
I0826 16:21:40.166497    2410 controller.go:86] Updated all DeploymentConfigs for trigger on ImageStream default/sti-python
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x66bbb8]

goroutine 6548 [running]:
github.com/openshift/origin/pkg/build/util.GetImageStreamForStrategy(0xc20a2fadda, 0x6, 0x0, 0x0, 0xc20e0d3720, 0x401ed10)
    /tmp/origin/_output/local/go/src/github.com/openshift/origin/pkg/build/util/util.go:37 +0x128
github.com/openshift/origin/pkg/build/api/validation.ValidateBuildConfig(0xc20bf47200, 0x0, 0x0, 0x0)
    /tmp/origin/_output/local/go/src/github.com/openshift/origin/pkg/build/api/validation/validation.go:67 +0x5e8
github.com/openshift/origin/pkg/build/registry/buildconfig.strategy.Validate(0x7f6b977fd3c8, 0xc2080d4af0, 0x7f6b977fb558, 0x401ed10, 0x7f6b9781cd30, 0xc20d53a090, 0x7f6b977fe438, 0xc20bf47200, 0x0, 0x0, ...)
    /tmp/origin/_output/local/go/src/github.com/openshift/origin/pkg/build/registry/buildconfig/strategy.go:51 +0x67
github.com/openshift/origin/pkg/build/registry/buildconfig.(*strategy).Validate(0xc208f535c0, 0x7f6b9781cd30, 0xc20d53a090, 0x7f6b977fe438, 0xc20bf47200, 0x0, 0x0, 0x0)
    <autogenerated>:32 +0xef
k8s.io/kubernetes/pkg/api/rest.BeforeCreate(0x7f6b97672698, 0xc208f535c0, 0x7f6b9781cd30, 0xc20d53a090, 0x7f6b977fe438, 0xc20bf47200, 0x0, 0x0)
    /tmp/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/rest/create.go:66 +0x367
k8s.io/kubernetes/pkg/registry/generic/etcd.(*Etcd).Create(0xc208e45a20, 0x7f6b9781cd30, 0xc20d53a090, 0x7f6b977fe438, 0xc20bf47200, 0x0, 0x0, 0x0, 0x0)
    /tmp/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/registry/generic/etcd/etcd.go:205 +0x193
k8s.io/kubernetes/pkg/apiserver.(*namedCreaterAdapter).Create(0xc2093a3970, 0x7f6b9781cd30, 0xc20d53a090, 0x0, 0x0, 0x7f6b977fe438, 0xc20bf47200, 0x0, 0x0, 0x0, ...)
    /tmp/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apiserver/resthandler.go:357 +0xa2
k8s.io/kubernetes/pkg/apiserver.func·025(0x0, 0x0, 0x0, 0x0)
    /tmp/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apiserver/resthandler.go:322 +0xaa
k8s.io/kubernetes/pkg/apiserver.func·033()
    /tmp/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apiserver/resthandler.go:622 +0x38
created by k8s.io/kubernetes/pkg/apiserver.finishRequest
    /tmp/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apiserver/resthandler.go:627 +0x1e4

@liggitt
Copy link
Contributor

liggitt commented Aug 26, 2015

should fix the assumption that strategy guaranteed a non-nil params field, but also find out why a panic handler wasn't catching this

@liggitt liggitt added kind/bug Categorizes issue or PR as related to a bug. priority/P1 labels Aug 26, 2015
@smarterclayton
Copy link
Contributor

P0 - we may need to hot fix

@smarterclayton
Copy link
Contributor

We may have lost the panic handler accidently in the API installer. Could be upstream too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/P0
Projects
None yet
Development

No branches or pull requests

3 participants