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

fix crash when run sonobuoy in serverless kubernetes cluster #1108

Merged
merged 2 commits into from
Apr 24, 2020

Conversation

jovizhangwei
Copy link
Contributor

We found a crash when ran sonobuoy in serverless kubernetes cluster, see below error log.

In serverless kubernetes cluster, pod may need 10s to start after creation, before container start, pod.Status.StartTime is nil.

kubectl -n sonobuoy get pod

NAME READY STATUS RESTARTS AGE
sonobuoy 0/1 Error 0 4h57m
sonobuoy-e2e-job-61031ae7baac48e1 2/2 Running 0 4h57m

kubectl -n sonobuoy logs sonobuoy

time="2020-04-20T02:49:23Z" level=info msg="Starting aggregation server" address=0.0.0.0 port=8080
time="2020-04-20T02:49:23Z" level=info msg="Starting annotation update routine"
time="2020-04-20T02:49:23Z" level=info msg="Running plugin" plugin=e2e
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x1010651]
goroutine 121 [running]:
github.com/vmware-tanzu/sonobuoy/pkg/plugin/driver/utils.IsPodFailing(0xc0004e8a80, 0x16a5e60, 0xc000514500, 0xc0004e8a80)
/go/src/github.com/vmware-tanzu/sonobuoy/pkg/plugin/driver/utils/utils.go:71 +0x3b1
github.com/vmware-tanzu/sonobuoy/pkg/plugin/driver/job.(*Plugin).monitorOnce(0xc0000fa000, 0x16a5e60, 0xc000514500, 0x0, 0x0, 0x0, 0xc0003e8600, 0x0)
/go/src/github.com/vmware-tanzu/sonobuoy/pkg/plugin/driver/job/job.go:219 +0x8d
github.com/vmware-tanzu/sonobuoy/pkg/plugin/driver/job.(*Plugin).Monitor(0xc0000fa000, 0x16744e0, 0xc000129ec0, 0x16a5e60, 0xc000514500, 0xc000284840, 0x1, 0x1, 0xc000129e00)
/go/src/github.com/vmware-tanzu/sonobuoy/pkg/plugin/driver/job/job.go:195 +0x190
created by github.com/vmware-tanzu/sonobuoy/pkg/plugin/aggregation.(*Aggregator).RunAndMonitorPlugin
/go/src/github.com/vmware-tanzu/sonobuoy/pkg/plugin/aggregation/run.go:233 +0x227

What this PR does / why we need it:

Which issue(s) this PR fixes

  • Fixes #

Special notes for your reviewer:

Release note:

release-note

We found a crash when ran sonobuoy in serverless kubernetes cluster, see below error log.

In serverless kubernetes cluster, pod may need 10s to start after creation, before container start, pod.Status.StartTime is nil.

NAME                                READY   STATUS    RESTARTS   AGE
sonobuoy                            0/1     Error     0          4h57m
sonobuoy-e2e-job-61031ae7baac48e1   2/2     Running   0          4h57m

time="2020-04-20T02:49:23Z" level=info msg="Starting aggregation server" address=0.0.0.0 port=8080
time="2020-04-20T02:49:23Z" level=info msg="Starting annotation update routine"
time="2020-04-20T02:49:23Z" level=info msg="Running plugin" plugin=e2e
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x1010651]
goroutine 121 [running]:
github.com/vmware-tanzu/sonobuoy/pkg/plugin/driver/utils.IsPodFailing(0xc0004e8a80, 0x16a5e60, 0xc000514500, 0xc0004e8a80)
	/go/src/github.com/vmware-tanzu/sonobuoy/pkg/plugin/driver/utils/utils.go:71 +0x3b1
github.com/vmware-tanzu/sonobuoy/pkg/plugin/driver/job.(*Plugin).monitorOnce(0xc0000fa000, 0x16a5e60, 0xc000514500, 0x0, 0x0, 0x0, 0xc0003e8600, 0x0)
	/go/src/github.com/vmware-tanzu/sonobuoy/pkg/plugin/driver/job/job.go:219 +0x8d
github.com/vmware-tanzu/sonobuoy/pkg/plugin/driver/job.(*Plugin).Monitor(0xc0000fa000, 0x16744e0, 0xc000129ec0, 0x16a5e60, 0xc000514500, 0xc000284840, 0x1, 0x1, 0xc000129e00)
	/go/src/github.com/vmware-tanzu/sonobuoy/pkg/plugin/driver/job/job.go:195 +0x190
created by github.com/vmware-tanzu/sonobuoy/pkg/plugin/aggregation.(*Aggregator).RunAndMonitorPlugin
	/go/src/github.com/vmware-tanzu/sonobuoy/pkg/plugin/aggregation/run.go:233 +0x227

Signed-off-by: xianwei.zw <xianwei.zw@alibaba-inc.com>
@zubron
Copy link
Contributor

zubron commented Apr 24, 2020

Thanks for this PR, @jovizhangwei! I'd like to include a test with this change so I will push that to your branch before merging and hopefully get a release out with this change either today or Monday.

Signed-off-by: Bridget McErlean <bmcerlean@vmware.com>
Copy link
Contributor

@zubron zubron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@zubron zubron merged commit b1016cc into vmware-tanzu:master Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants