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

Nil pointer error when a SecurityPolicy refers to a UDS Backend #4999

Closed
zhaohuabing opened this issue Jan 3, 2025 · 0 comments · Fixed by #5000
Closed

Nil pointer error when a SecurityPolicy refers to a UDS Backend #4999

zhaohuabing opened this issue Jan 3, 2025 · 0 comments · Fixed by #5000
Labels
kind/bug Something isn't working

Comments

@zhaohuabing
Copy link
Member

apiVersion: gateway.envoyproxy.io/v1alpha1
kind: Backend
metadata:
  name: ext-auth-svc
spec:
  endpoints:
  - unix:
      path: /var/run/envoy-uds/ext-auth.sock
---

apiVersion: gateway.envoyproxy.io/v1alpha1
kind: SecurityPolicy
metadata:
  name: ext-auth-poc
spec:
  extAuth:
    failOpen: false
    http:
      backendRefs:
      - group: gateway.envoyproxy.io
        kind: Backend
        name: ext-auth-svc
      headersToBackend:
      - x-current-user
    recomputeRoute: true
  targetRefs:
  - group: gateway.networking.k8s.io
    kind: HTTPRoute
    name: ext-auth-poc
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x2768705]

goroutine 305 [running]:
github.com/envoyproxy/gateway/internal/gatewayapi.backendRefAuthority(0xc0011169c0?, 0xc002a781e8, 0x7?)
	/home/runner/work/gateway/gateway/internal/gatewayapi/securitypolicy.go:960 +0x185
github.com/envoyproxy/gateway/internal/gatewayapi.(*Translator).buildExtAuth(0x78f5d88?, 0xc0010c9380, 0xc002e28c88, 0xc003199140?)
	/home/runner/work/gateway/gateway/internal/gatewayapi/securitypolicy.go:908 +0x3b6
github.com/envoyproxy/gateway/internal/gatewayapi.(*Translator).translateSecurityPolicyForRoute(0xc002a798f8, 0xc0010c9380, {0x78f5d88, 0xc002ca6bc0}, 0xc002e28c88, 0xc000ad7290)
	/home/runner/work/gateway/gateway/internal/gatewayapi/securitypolicy.go:373 +0x677
github.com/envoyproxy/gateway/internal/gatewayapi.(*Translator).ProcessSecurityPolicies(0xc002a798f8, {0xc0000cd598, 0x1, 0x1}, {0xc00333e428, 0x1, 0x1}, {0xc003199570, 0x1, 0x1}, ...)
	/home/runner/work/gateway/gateway/internal/gatewayapi/securitypolicy.go:150 +0x1931
github.com/envoyproxy/gateway/internal/gatewayapi.(*Translator).Translate(0xc002a798f8, 0xc002e28c88)
	/home/runner/work/gateway/gateway/internal/gatewayapi/translator.go:217 +0xaa5
github.com/envoyproxy/gateway/internal/gatewayapi/runner.(*Runner).subscribeAndTranslate.func1({{0xc000135e30?, 0x0?}, 0x2?, 0xc0031a65b8?}, 0xc001039490)
	/home/runner/work/gateway/gateway/internal/gatewayapi/runner/runner.go:167 +0x42c
github.com/envoyproxy/gateway/internal/message.HandleSubscription[...]({{0x3254be7, 0xb?}, {0x3266e8a?, 0x12?}}, 0xc0010351f0?, 0xc002a79f98)
	/home/runner/work/gateway/gateway/internal/message/watchutil.go:76 +0x1118
github.com/envoyproxy/gateway/internal/gatewayapi/runner.(*Runner).subscribeAndTranslate(0xc002315200, {0x78babb0?, 0xc001202000?})
	/home/runner/work/gateway/gateway/internal/gatewayapi/runner/runner.go:119 +0x7e
created by github.com/envoyproxy/gateway/internal/gatewayapi/runner.(*Runner).Start in goroutine 137
	/home/runner/work/gateway/gateway/internal/gatewayapi/runner/runner.go:85 +0x2a5
@zhaohuabing zhaohuabing added triage kind/bug Something isn't working and removed triage labels Jan 3, 2025
@zhaohuabing zhaohuabing changed the title Nil pointer error when a SecurityPolicy refers to a UDS backend Nil pointer error when a SecurityPolicy refers to a UDS Backend Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant