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

ProxyInjector crashes if service is for sidecar deleted #43

Open
rajeshneo opened this issue Mar 15, 2021 · 0 comments
Open

ProxyInjector crashes if service is for sidecar deleted #43

rajeshneo opened this issue Mar 15, 2021 · 0 comments

Comments

@rajeshneo
Copy link

Scenario

  • Deploy ProxyInjector
  • Deploy an application and service with ProxyInjector sidecar configuration
  • Delete the service deployed in step 2
  • ProxyInjector app is crashed with following trace

`time="2021-03-15T09:37:32Z" level=info msg="Updated resource... topui"
time="2021-03-15T09:37:32Z" level=error msg="Failed to get latest version of Service: services "topui" not found"
E0315 09:37:32.145170 1 runtime.go:78] Observed a panic: runtime.boundsError{x:0, y:0, signed:true, code:0x0} (runtime error: index out of range [0] with length 0)
goroutine 98 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic(0x1279240, 0xc00059d720)
/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20191004115801-a2eda9f80ab8/pkg/util/runtime/runtime.go:74 +0xa3
k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20191004115801-a2eda9f80ab8/pkg/util/runtime/runtime.go:48 +0x82
panic(0x1279240, 0xc00059d720)
/usr/local/go/src/runtime/panic.go:679 +0x1b2
github.com/stakater/ProxyInjector/internal/pkg/handler.updateService.func1(0xc000336420, 0xc00016e2e8)
/go/src/github.com/stakater/ProxyInjector/internal/pkg/handler/create.go:177 +0x2f3
k8s.io/client-go/util/retry.OnError.func1(0x0, 0x203000, 0x203000)
/go/pkg/mod/k8s.io/client-go@v0.0.0-20190918160344-1fbdaa4c8d90/util/retry/util.go:64 +0x3c
k8s.io/apimachinery/pkg/util/wait.ExponentialBackoff(0x989680, 0x3ff0000000000000, 0x3fb999999999999a, 0x5, 0x0, 0xc000453658, 0xc000336450, 0x30)
/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20191004115801-a2eda9f80ab8/pkg/util/wait/wait.go:292 +0x51
k8s.io/client-go/util/retry.OnError(0x989680, 0x3ff0000000000000, 0x3fb999999999999a, 0x5, 0x0, 0x13bf308, 0xc000453718, 0x468732, 0xa)
/go/pkg/mod/k8s.io/client-go@v0.0.0-20190918160344-1fbdaa4c8d90/util/retry/util.go:63 +0xa6
k8s.io/client-go/util/retry.RetryOnConflict(...)
/go/pkg/mod/k8s.io/client-go@v0.0.0-20190918160344-1fbdaa4c8d90/util/retry/util.go:83
github.com/stakater/ProxyInjector/internal/pkg/handler.updateService(0xc00064c640, 0xc000712960, 0x3, 0xc0007129e0, 0x5, 0xc0007129e8, 0x4)
/go/src/github.com/stakater/ProxyInjector/internal/pkg/handler/create.go:167 +0x130
github.com/stakater/ProxyInjector/internal/pkg/handler.ResourceCreatedHandler.Handle(0x130b2a0, 0xc00013d200, 0xc00010f5c0, 0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/go/src/github.com/stakater/ProxyInjector/internal/pkg/handler/create.go:118 +0xac4
github.com/stakater/ProxyInjector/internal/pkg/controller.(*Controller).processNextItem(0xc0003354a0, 0x0)
/go/src/github.com/stakater/ProxyInjector/internal/pkg/controller/controller.go:111 +0x179
github.com/stakater/ProxyInjector/internal/pkg/controller.(*Controller).runWorker(0xc0003354a0)
/go/src/github.com/stakater/ProxyInjector/internal/pkg/controller/controller.go:94 +0x2b
k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1(0xc00038a000)
/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20191004115801-a2eda9f80ab8/pkg/util/wait/wait.go:152 +0x5e
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc00038a000, 0x3b9aca00, 0x0, 0x1, 0xc0000fc600)
/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20191004115801-a2eda9f80ab8/pkg/util/wait/wait.go:153 +0xf8
k8s.io/apimachinery/pkg/util/wait.Until(0xc00038a000, 0x3b9aca00, 0xc0000fc600)
/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20191004115801-a2eda9f80ab8/pkg/util/wait/wait.go:88 +0x4d
created by github.com/stakater/ProxyInjector/internal/pkg/controller.(*Controller).Run
/go/src/github.com/stakater/ProxyInjector/internal/pkg/controller/controller.go:86 +0x1ff
panic: runtime error: index out of range [0] with length 0 [recovered]
panic: runtime error: index out of range [0] with length 0

goroutine 98 [running]:
k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20191004115801-a2eda9f80ab8/pkg/util/runtime/runtime.go:55 +0x105
panic(0x1279240, 0xc00059d720)
/usr/local/go/src/runtime/panic.go:679 +0x1b2
github.com/stakater/ProxyInjector/internal/pkg/handler.updateService.func1(0xc000336420, 0xc00016e2e8)
/go/src/github.com/stakater/ProxyInjector/internal/pkg/handler/create.go:177 +0x2f3
k8s.io/client-go/util/retry.OnError.func1(0x0, 0x203000, 0x203000)
/go/pkg/mod/k8s.io/client-go@v0.0.0-20190918160344-1fbdaa4c8d90/util/retry/util.go:64 +0x3c
k8s.io/apimachinery/pkg/util/wait.ExponentialBackoff(0x989680, 0x3ff0000000000000, 0x3fb999999999999a, 0x5, 0x0, 0xc000453658, 0xc000336450, 0x30)
/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20191004115801-a2eda9f80ab8/pkg/util/wait/wait.go:292 +0x51
k8s.io/client-go/util/retry.OnError(0x989680, 0x3ff0000000000000, 0x3fb999999999999a, 0x5, 0x0, 0x13bf308, 0xc000453718, 0x468732, 0xa)
/go/pkg/mod/k8s.io/client-go@v0.0.0-20190918160344-1fbdaa4c8d90/util/retry/util.go:63 +0xa6
k8s.io/client-go/util/retry.RetryOnConflict(...)
/go/pkg/mod/k8s.io/client-go@v0.0.0-20190918160344-1fbdaa4c8d90/util/retry/util.go:83
github.com/stakater/ProxyInjector/internal/pkg/handler.updateService(0xc00064c640, 0xc000712960, 0x3, 0xc0007129e0, 0x5, 0xc0007129e8, 0x4)
/go/src/github.com/stakater/ProxyInjector/internal/pkg/handler/create.go:167 +0x130
github.com/stakater/ProxyInjector/internal/pkg/handler.ResourceCreatedHandler.Handle(0x130b2a0, 0xc00013d200, 0xc00010f5c0, 0x22, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/go/src/github.com/stakater/ProxyInjector/internal/pkg/handler/create.go:118 +0xac4
github.com/stakater/ProxyInjector/internal/pkg/controller.(*Controller).processNextItem(0xc0003354a0, 0x0)
/go/src/github.com/stakater/ProxyInjector/internal/pkg/controller/controller.go:111 +0x179
github.com/stakater/ProxyInjector/internal/pkg/controller.(*Controller).runWorker(0xc0003354a0)
/go/src/github.com/stakater/ProxyInjector/internal/pkg/controller/controller.go:94 +0x2b
k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1(0xc00038a000)
/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20191004115801-a2eda9f80ab8/pkg/util/wait/wait.go:152 +0x5e
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc00038a000, 0x3b9aca00, 0x0, 0x1, 0xc0000fc600)
/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20191004115801-a2eda9f80ab8/pkg/util/wait/wait.go:153 +0xf8
k8s.io/apimachinery/pkg/util/wait.Until(0xc00038a000, 0x3b9aca00, 0xc0000fc600)
/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20191004115801-a2eda9f80ab8/pkg/util/wait/wait.go:88 +0x4d
created by github.com/stakater/ProxyInjector/internal/pkg/controller.(*Controller).Run
/go/src/github.com/stakater/ProxyInjector/internal/pkg/controller/controller.go:86 +0x1ff`

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

No branches or pull requests

1 participant