{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/60610","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/60610/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/60610/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/60610/events","html_url":"https://github.com/kubernetes/kubernetes/issues/60610","id":301262124,"number":60610,"title":"v1.8.6 cluster apiserver panic","user":{"login":"zjj2wry","id":18045633,"avatar_url":"https://avatars2.githubusercontent.com/u/18045633?v=4","gravatar_id":"","url":"https://api.github.com/users/zjj2wry","html_url":"https://github.com/zjj2wry","followers_url":"https://api.github.com/users/zjj2wry/followers","following_url":"https://api.github.com/users/zjj2wry/following{/other_user}","gists_url":"https://api.github.com/users/zjj2wry/gists{/gist_id}","starred_url":"https://api.github.com/users/zjj2wry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zjj2wry/subscriptions","organizations_url":"https://api.github.com/users/zjj2wry/orgs","repos_url":"https://api.github.com/users/zjj2wry/repos","events_url":"https://api.github.com/users/zjj2wry/events{/privacy}","received_events_url":"https://api.github.com/users/zjj2wry/received_events","type":"User","site_admin":false},"labels":[{"id":680704582,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/area/audit","name":"area/audit","color":"0052cc","default":false},{"id":105146071,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/kind/bug","name":"kind/bug","color":"e11d21","default":false},{"id":173493835,"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/api-machinery","name":"sig/api-machinery","color":"d2b48c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2018-03-01T03:05:33Z","updated_at":"2018-03-05T21:19:41Z","closed_at":null,"author_association":"MEMBER","body":"<!-- This form is for bug reports and feature requests ONLY! \r\n\r\nIf you're looking for help check [Stack Overflow](https://stackoverflow.com/questions/tagged/kubernetes) and the [troubleshooting guide](https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/).\r\n-->\r\n\r\n**Is this a BUG REPORT or FEATURE REQUEST?**:\r\n\r\n> Uncomment only one, leave it on its own line: \r\n>\r\n/kind bug\r\n> /kind feature\r\n\r\n\r\n**What happened**:\r\nI have a v1.8.6 cluster panic twice, I doubt where to pass an nil context.\r\n```golang\r\n// AuditEventFrom returns the audit event struct on the ctx\r\nfunc AuditEventFrom(ctx Context) *audit.Event {\r\n\tev, _ := ctx.Value(auditKey).(*audit.Event)\r\n\treturn ev\r\n}\r\n```\r\napiserver log:\r\n```\r\nI0228 15:56:35.083908       1 trace.go:76] Trace[24533386]: \"Update /apis/loadbalance.caicloud.io/v1alpha2/namespaces/kube-system/loadbalancers/de\" (started: 2018-02-28 15:55:35.062227089 +0000 UTC) (total time: 1m0.021612612s):\r\nTrace[24533386]: [1m0.021612612s] [1m0.021612612s] END\r\npanic: runtime error: invalid memory address or nil pointer dereference\r\n[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x11a06bf]\r\n\r\ngoroutine 18221499 [running]:\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/request.AuditEventFrom(0x0, 0x0, 0xc4261ce7c0)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/request/context.go:158 +0x2f\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/handlers/responsewriters.WriteObjectNegotiated(0x0, 0x0, 0x9af2f00, 0xc4261ce7c0, 0xc42acc3d40, 0x17, 0xc424b09bb8, 0x8, 0x7fc37ef10658, 0xc431155950, ...)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/handlers/responsewriters/writers.go:108 +0xab\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/handlers/responsewriters.ErrorNegotiated(0x0, 0x0, 0x9ac6540, 0xc431fc8dc0, 0x9af2f00, 0xc4261ce7c0, 0xc42acc3d40, 0x17, 0xc424b09bb8, 0x8, ...)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/handlers/responsewriters/writers.go:132 +0x16b\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/handlers.(*RequestScope).err(0xc431ebc000, 0x9ac6540, 0xc431fc8dc0, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/handlers/rest.go:80 +0x10e\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/handlers.UpdateResource.func1(0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/handlers/rest.go:865 +0x1578\r\nk8s.io/kubernetes/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver.(*crdHandler).ServeHTTP(0xc420c22600, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go:219 +0xf1b\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/mux.(*pathHandler).ServeHTTP(0xc4240e1c80, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/mux/pathrecorder.go:248 +0x3dd\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/mux.(*PathRecorderMux).ServeHTTP(0xc420909c70, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/mux/pathrecorder.go:234 +0x72\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server.director.ServeHTTP(0x48e7a9a, 0x17, 0xc4210d9200, 0xc420909c70, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/handler.go:161 +0x301\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server.(*director).ServeHTTP(0xc420b6e820, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t<autogenerated>:69 +0x86\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/mux.(*pathHandler).ServeHTTP(0xc4252fde00, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/mux/pathrecorder.go:254 +0x26e\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/mux.(*PathRecorderMux).ServeHTTP(0xc4208fa8c0, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/mux/pathrecorder.go:234 +0x72\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server.director.ServeHTTP(0x48b77c4, 0xe, 0xc4210a2750, 0xc4208fa8c0, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/handler.go:161 +0x301\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server.(*director).ServeHTTP(0xc420acecc0, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t<autogenerated>:69 +0x86\r\nk8s.io/kubernetes/vendor/k8s.io/kube-aggregator/pkg/apiserver.(*proxyHandler).ServeHTTP(0xc42bed0b00, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/kube-aggregator/pkg/apiserver/handler_proxy.go:91 +0x122\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/mux.(*pathHandler).ServeHTTP(0xc42bfc82c0, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/mux/pathrecorder.go:248 +0x3dd\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/mux.(*PathRecorderMux).ServeHTTP(0xc4215e1650, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/mux/pathrecorder.go:234 +0x72\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server.director.ServeHTTP(0x48bc002, 0xf, 0xc426ae14d0, 0xc4215e1650, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/handler.go:161 +0x301\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server.(*director).ServeHTTP(0xc42422b500, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t<autogenerated>:69 +0x86\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/filters.WithAuthorization.func1(0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/filters/authorization.go:51 +0x37a\r\nnet/http.HandlerFunc.ServeHTTP(0xc421e39f90, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/usr/local/go/src/net/http/server.go:1942 +0x44\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters.WithMaxInFlightLimit.func1(0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters/maxinflight.go:98 +0x5a0\r\nnet/http.HandlerFunc.ServeHTTP(0xc4240e1dc0, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/usr/local/go/src/net/http/server.go:1942 +0x44\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/filters.WithImpersonation.func1(0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/filters/impersonation.go:49 +0x21b2\r\nnet/http.HandlerFunc.ServeHTTP(0xc421c7a690, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/usr/local/go/src/net/http/server.go:1942 +0x44\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/filters.WithAuthentication.func1(0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/filters/authentication.go:79 +0x2b0\r\nnet/http.HandlerFunc.ServeHTTP(0xc421c7a6e0, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/usr/local/go/src/net/http/server.go:1942 +0x44\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/request.WithRequestContext.func1(0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/request/requestcontext.go:110 +0xef\r\nnet/http.HandlerFunc.ServeHTTP(0xc42422b520, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/usr/local/go/src/net/http/server.go:1942 +0x44\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters.WithCORS.func1(0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters/cors.go:75 +0x189\r\nnet/http.HandlerFunc.ServeHTTP(0xc4239bcae0, 0x7fc37ef10658, 0xc431155950, 0xc42e13b600)\r\n\t/usr/local/go/src/net/http/server.go:1942 +0x44\r\nk8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters.(*timeoutHandler).ServeHTTP.func1(0xc42422b5a0, 0x9af6700, 0xc431155950, 0xc42e13b600, 0xc436ed9200)\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters/timeout.go:106 +0x8d\r\ncreated by k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters.(*timeoutHandler).ServeHTTP\r\n\t/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/filters/timeout.go:108 +0x1ca\r\n```\r\n\r\ncc @sttts \r\n**What you expected to happen**:\r\n\r\n**How to reproduce it (as minimally and precisely as possible)**:\r\n\r\n\r\n**Anything else we need to know?**:\r\n\r\n**Environment**:\r\n- Kubernetes version (use `kubectl version`):\r\n```\r\nClient Version: version.Info{Major:\"1\", Minor:\"8\", GitVersion:\"v1.8.6\", GitCommit:\"6260bb08c46c31eea6cb538b34a9ceb3e406689c\", GitTreeState:\"clean\", BuildDate:\"2017-12-21T06:34:11Z\", GoVersion:\"go1.8.3\", Compiler:\"gc\", Platform:\"linux/amd64\"}\r\nServer Version: version.Info{Major:\"1\", Minor:\"8\", GitVersion:\"v1.8.6\", GitCommit:\"6260bb08c46c31eea6cb538b34a9ceb3e406689c\", GitTreeState:\"clean\", BuildDate:\"2017-12-21T06:23:29Z\", GoVersion:\"go1.8.3\", Compiler:\"gc\", Platform:\"linux/amd64\"}\r\n```\r\n- Cloud provider or hardware configuration:\r\n- OS (e.g. from /etc/os-release):\r\n- Kernel (e.g. `uname -a`):\r\n- Install tools:\r\n- Others:\r\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/370569574","html_url":"https://github.com/kubernetes/kubernetes/issues/60610#issuecomment-370569574","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/60610","id":370569574,"user":{"login":"jennybuckley","id":31416425,"avatar_url":"https://avatars2.githubusercontent.com/u/31416425?v=4","gravatar_id":"","url":"https://api.github.com/users/jennybuckley","html_url":"https://github.com/jennybuckley","followers_url":"https://api.github.com/users/jennybuckley/followers","following_url":"https://api.github.com/users/jennybuckley/following{/other_user}","gists_url":"https://api.github.com/users/jennybuckley/gists{/gist_id}","starred_url":"https://api.github.com/users/jennybuckley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jennybuckley/subscriptions","organizations_url":"https://api.github.com/users/jennybuckley/orgs","repos_url":"https://api.github.com/users/jennybuckley/repos","events_url":"https://api.github.com/users/jennybuckley/events{/privacy}","received_events_url":"https://api.github.com/users/jennybuckley/received_events","type":"User","site_admin":false},"created_at":"2018-03-05T21:19:41Z","updated_at":"2018-03-05T21:19:41Z","author_association":"CONTRIBUTOR","body":"/cc @tallclair "}}
{"actor":{"display_login":"jennybuckley"}}