Skip to content

plugin.gatewayAPI: panic: runtime error: slice bounds out of range [:2:1] #95

@erikwoo

Description

@erikwoo

Checklist:

  • [*] I've included steps to reproduce the bug.
  • [*] I've included the version of argo rollouts.
  • [*] I've included the version of the gateway API plugin
  • [* ] I've included the name and version of the gateway API provider I am using
  • [*] I've included my Rollout Spec (anonymized if needed)

Describe the bug

To Reproduce

apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
  annotations:
    argocd.argoproj.io/sync-wave: '1'
  labels:
    gitops/apps.git: demo
  name: demo
  namespace: demo
spec:
  replicas: 1
  revisionHistoryLimit: 0
  selector:
    matchLabels:
      app: demo
  strategy:
    canary:
      analysis:
        args:
          - name: service
            value: demo
          - name: namespace
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
        startingStep: 0
        templates:
          - templateName: istio-success-rate
      antiAffinity:
        requiredDuringSchedulingIgnoredDuringExecution: {}
      canaryService: demo-canary
      maxSurge: 50%
      maxUnavailable: 0
      stableService: demo
      steps:
        - setCanaryScale:
            replicas: 1
        - setHeaderRoute:
            match:
              - headerName: cookie
                headerValue:
                  regex: company_id=.*(666|111)$
            name: route-by-cookie
        - pause:
            duration: 30m
      trafficRouting:
        managedRoutes:
          - name: route-by-cookie
        plugins:
          argoproj-labs/gatewayAPI:
            httpRoute: demo
            namespace: demo
  template:
    metadata:
      annotations:
        configmap-md5: ''
        descheduler.alpha.kubernetes.io/evictable: 'true'
      labels:
        app: demo
    spec:
      containers:
        - env:
            - name: NAMESPACE
              value: demo
            - name: APP
              value: demo
            - name: CLUSTER_TYPE
              value: test
          image: >-
            registry-vpc.cn-hangzhou.aliyuncs.com/gitops-tools/rollouts-demo:yellow
          imagePullPolicy: Always
          name: rollouts-demo
          ports:
            - containerPort: 8080
              protocol: TCP
      enableServiceLinks: false
      serviceAccountName: demo

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=""


Impacted by this bug? Give it a 👍. We prioritize the issues with the most 👍.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions