-
Notifications
You must be signed in to change notification settings - Fork 26
plugin.gatewayAPI: panic: runtime error: slice bounds out of range [:2:1] #95
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
Comments
We are affected by this issue also
|
we also have this issue, are there any updates?
|
For those affected by this issue could you elaborate a bit on WHEN it happens? Just when starting a rollout? Upgrading the controller? Scaling back? Doing something else? |
I found that this can be caused by entries in the argo-gatewayapi-configmap ConfigMap in your namespace. Check the httpManagedRoutes key to see if there is any stale data relating to the managedRoutes. If you can just delete the ConfigMap and let Argo recreate it on the next deployment. |
The best way to make this happen is removing the rule in the HTTPRoute that the configmap has marked as managed. It does not seem to be able to understand how to handle the situation where the rule it tries to delete is no longer present (and no other rule at that index exists). This invites a pretty nasty situation where a rollout in that constant retry loop might end up deleting a rule that it shouldn't. Either way, one easy way to get into this situation is by using ArgoCD since the added rules put the object Out of Sync if you don't ignoreDIfferences correctly. This means any sync event on that route DURING an active canary can remove the rules that the plugin expects to exist and remove itself. I've noticed that if I disable autosync on my application running a canary where header routes are added, I do not experience this issue. I've also now configured the following on my argocd application and expect these to stay silent
|
Checklist:
Describe the bug
To Reproduce
Version
v1.7.2 argo-rollouts
v0.4.0 rollouts-plugin-trafficrouter-gatewayapi
Logs
time="2024-12-19T12:17:15Z" level=info msg="Found 1 TrafficRouting Reconcilers" namespace=demo rollout=demo
time="2024-12-19T12:17:15Z" level=info msg="Reconciling TrafficRouting with type 'GatewayAPI'" namespace=demo rollout=demo
2024-12-19T12:17:15.863Z [DEBUG] plugin.gatewayAPI: time="2024-12-19T12:17:15Z" level=info msg="[RemoveManagedRoutes] plugin "argoproj-labs/gatewayAPI" controls HTTPRoutes: [demo]" plugin=trafficrouter
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: panic: runtime error: slice bounds out of range [:2:1]
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI:
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: goroutine 40 [running]:
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: slices.Delete...
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: /opt/hostedtoolcache/go/1.22.6/x64/src/slices/slices.go:219
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: github.com/argoproj-labs/rollouts-plugin-trafficrouter-gatewayapi/pkg/plugin.removeManagedHTTPRouteEntry(0xc000747380, {0xc0003bedc0, 0x1, 0x4}, {0xc00036f060, 0xf}, {0xc00036f63c, 0x4})
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: /home/runner/work/rollouts-plugin-trafficrouter-gatewayapi/rollouts-plugin-trafficrouter-gatewayapi/pkg/plugin/httproute.go:393 +0x4f1
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: github.com/argoproj-labs/rollouts-plugin-trafficrouter-gatewayapi/pkg/plugin.(*RpcPlugin).removeHTTPManagedRoutes(0xc00046a500, {0xc00075e040, 0x1, 0x0?}, 0xc0005bda20)
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: /home/runner/work/rollouts-plugin-trafficrouter-gatewayapi/rollouts-plugin-trafficrouter-gatewayapi/pkg/plugin/httproute.go:296 +0x597
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: github.com/argoproj-labs/rollouts-plugin-trafficrouter-gatewayapi/pkg/plugin.(*RpcPlugin).RemoveManagedRoutes.func1({{0xc00036f63c?, 0xc0004b39d0?}, 0x4?})
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: /home/runner/work/rollouts-plugin-trafficrouter-gatewayapi/rollouts-plugin-trafficrouter-gatewayapi/pkg/plugin/plugin.go:153 +0x65
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: github.com/argoproj-labs/rollouts-plugin-trafficrouter-gatewayapi/pkg/plugin.forEachGatewayAPIRoute[...]({0xc0007279b0?, 0xc0006876d0?, 0x2?}, 0xc0005716e0?)
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: /home/runner/work/rollouts-plugin-trafficrouter-gatewayapi/rollouts-plugin-trafficrouter-gatewayapi/pkg/plugin/plugin.go:276 +0x56
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: github.com/argoproj-labs/rollouts-plugin-trafficrouter-gatewayapi/pkg/plugin.(*RpcPlugin).RemoveManagedRoutes(0xc00046a500, 0xc000711108)
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: /home/runner/work/rollouts-plugin-trafficrouter-gatewayapi/rollouts-plugin-trafficrouter-gatewayapi/pkg/plugin/plugin.go:148 +0x1a5
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: github.com/argoproj/argo-rollouts/rollout/trafficrouting/plugin/rpc.(*TrafficRouterRPCServer).RemoveManagedRoutes(0x1?, {0x1875500?, 0xc000711108?}, 0xc00075e090)
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: /home/runner/go/pkg/mod/github.com/argoproj/[email protected]/rollout/trafficrouting/plugin/rpc/rpc.go:255 +0x3f
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: reflect.Value.call({0xc00053c5a0?, 0xc0004f0030?, 0x13?}, {0x1c4e6db, 0x4}, {0xc0004ebef8, 0x3, 0x3?})
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: /opt/hostedtoolcache/go/1.22.6/x64/src/reflect/value.go:596 +0xca6
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: reflect.Value.Call({0xc00053c5a0?, 0xc0004f0030?, 0x0?}, {0xc000505ef8?, 0x0?, 0x0?})
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: /opt/hostedtoolcache/go/1.22.6/x64/src/reflect/value.go:380 +0xb9
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: net/rpc.(*service).call(0xc0002fc0c0, 0xc0002fc080, 0xc0002240a0, 0xc0002240d0, 0xc0004ee200, 0xc0002da0c0, {0x198bb40?, 0xc0002e46c0?, 0x0?}, {0x19ee700, ...}, ...)
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: /opt/hostedtoolcache/go/1.22.6/x64/src/net/rpc/server.go:381 +0x20e
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: created by net/rpc.(*Server).ServeCodec in goroutine 38
2024-12-19T12:17:15.888Z [DEBUG] plugin.gatewayAPI: /opt/hostedtoolcache/go/1.22.6/x64/src/net/rpc/server.go:478 +0x3d7
2024-12-19T12:17:15.890Z [ERROR] plugin: plugin process exited: plugin=/home/argo-rollouts/plugin-bin/argoproj-labs/gatewayAPI id=146609 error="exit status 2"
time="2024-12-19T12:17:15Z" level=error msg="roCtx.reconcile err failed to remove managed routes via plugin: RemoveManagedRoutes rpc call error: unexpected EOF" generation=2 namespace=demo resourceVersion=30188502 rollout=demo
time="2024-12-19T12:17:15Z" level=info msg="Reconciliation completed" generation=2 namespace=demo resourceVersion=30188502 rollout=demo time_ms=87.60934099999999
time="2024-12-19T12:17:15Z" level=error msg="rollout syncHandler error: failed to remove managed routes via plugin: RemoveManagedRoutes rpc call error: unexpected EOF" namespace=demo rollout=demo
time="2024-12-19T12:17:15Z" level=info msg="rollout syncHandler queue retries: 19 : key "demo/demo"" namespace=demo rollout=demo
time="2024-12-19T12:17:15Z" level=error msg="failed to remove managed routes via plugin: RemoveManagedRoutes rpc call error: unexpected EOF" error=""
The text was updated successfully, but these errors were encountered: