Skip to content

Conversation

@AlinsRan
Copy link
Contributor

@AlinsRan AlinsRan commented Oct 11, 2025

Type of change:

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches
  • Documentation
  • Refactor
  • Chore
  • CI/CD or Tests

What this PR does / why we need it:

The RewriteConfig plugin will be shared by multiple filters, resulting in headers not being initialized and causing panic.

{"controller": "httproute", "controllerGroup": "gateway.networking.k8s.io", "controllerKind": "HTTPRoute", "HTTPRoute": {"name":"rewrite-host","namespace":"gateway-conformance-infra"}, "namespace": "gateway-conformance-infra", "name": "rewrite-host", "reconcileID": "7f56d988-738f-4f3c-b697-dc8c8c8119bd", "panic": "runtime error: invalid memory address or nil pointer dereference", "panicGoValue": "\"invalid memory address or nil pointer dereference\"", "stacktrace": "goroutine 998 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic({0x254dcf8, 0xc000ef3ad0}, {0x1e93ea0, 0x378c500})
    /Users/rong/go/pkg/mod/k8s.io/[email protected]/pkg/util/runtime/runtime.go:107 +0xbc
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Reconcile.func1()
    /Users/rong/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:108 +0x112
panic({0x1e93ea0?, 0x378c500?})
    /usr/local/Cellar/go/1.24.5/libexec/src/runtime/panic.go:792 +0x132
github.com/apache/apisix-ingress-controller/internal/adc/translator.(*Translator).fillPluginFromHTTPRequestHeaderFilter(0x8?, 0xc000e3a690, 0xc0001ca050)
    /Users/rong/workspace/apisix-ingress-controller/internal/adc/translator/httproute.go:194 +0x232
github.com/apache/apisix-ingress-controller/internal/adc/translator.(*Translator).fillPluginsFromHTTPRouteFilters(0xc00000f488, 0xc000e3a690, {0xc0011a60e0, 0x19}, {0xc0009f18c0?, 0xc00063fe88?, 0xc00063fe88?}, {0xc000459dc0, 0x1, 0x1}, ...)
    /Users/rong/workspace/apisix-ingress-controller/internal/adc/translator/httproute.go:51 +0x451
github.com/apache/apisix-ingress-controller/internal/adc/translator.(*Translator).TranslateHTTPRoute(0xc00000f488, 0xc000e12240, 0xc000da9980)
    /Users/rong/workspace/apisix-ingress-controller/internal/adc/translator/httproute.go:638 +0x978
github.com/apache/apisix-ingress-controller/internal/provider/apisix.(*apisixProvider).Update(0xc000749e60, {0xc0007d81e0?, 0x19?}, 0xc000e12240, {0x25769e8, 0xc000da9680})
    /Users/rong/workspace/apisix-ingress-controller/internal/provider/apisix/provider.go:111 +0xe97
github.com/apache/apisix-ingress-controller/internal/controller.(*HTTPRouteReconciler).Reconcile(0xc0004a3110, {0x254dcf8, 0xc000ef3ad0}, {{{0xc001098f80?, 0x21c9778?}, {0xc000d723c0?, 0x100?}}})
    /Users/rong/workspace/apisix-ingress-controller/internal/controller/httproute_controller.go:254 +0x15bb
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Reconcile(0xc000ef3a40?, {0x254dcf8?, 0xc000ef3ad0?}, {{{0xc001098f80?, 0x0?}, {0xc000d723c0?, 0x0?}}})
    /Users/rong/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:119 +0xbf
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler(0x25716c0, {0x254dd30, 0xc0005e4910}, {{{0xc001098f80, 0x19}, {0xc000d723c0, 0xc}}}, 0x0)
    /Users/rong/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:334 +0x3ad
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem(0x25716c0, {0x254dd30, 0xc0005e4910})
    /Users/rong/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:294 +0x21b
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.2()
    /Users/rong/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:255 +0x85
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2 in goroutine 358
    /Users/rong/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:251 +0x6b5
"}

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

Copy link
Contributor

@ronething ronething left a comment

Choose a reason for hiding this comment

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

lgtm

@AlinsRan AlinsRan merged commit f6db456 into apache:master Oct 11, 2025
28 of 29 checks passed
@AlinsRan AlinsRan deleted the fix/HTTPRouteRewriteHost branch October 11, 2025 06:30
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.

3 participants