You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mistake in a BackendTrafficPolicy causes all routes to return 404 #5147
Create a BackendTrafficPolicy as shown above. Nothing stops a developer setting baseInterval: 0s.
At first, nothing is wrong. Then, if you restart envoy proxies, you'll find ALL httproutes return 404s immediately. Logs show route_not_found for all requests but no mention of why or which resources causs this. Inspecting the raw envoy config via the admin portal, the dynamic_route_configs section is never generated (usually its populated).
To find the offending resource, we had to delete resources until discovering the problematic thing was this one BackendTrafficPolicy and this one value within it. Pretty scary to us. Questions:
What values should be allowed in baseInterval?
What validations can be done to stop misconfigurations like this?
Supposing there are other (perhaps future) resource misconfigs / validation issues, how can those be scoped to avoid breaking all routes?
How can a user identify the problematic resources, either in envoy-gateway or the envoy proxy? Here we had to guess and test
Note: If there are privacy concerns, sanitize the data prior to
sharing.
Environment:
Include the environment like gateway version, envoy version and so on.
More complex validations happen here and if any validation fails
A negative status is added to the Policy resource
A 500 Direct Response is attached to the targeted Route, implementing a fail closed state, so requests targeting this route will fail, and should be able to debug these faster
xDS Translation
We run Validate on the xDs Resource which executes the proto validations for the envoy proxy defined resources, if this fails it should be logged in envoy-gateway. We plan on bubbling this up as a status too in the future. It should have been caught here, because we didn't add the must be greater than 0s validation anywhere but it wasn't and the config was pushed to envoy proxy which failed the entire route config
@arkodg the validation is done in the ResourceVersionTable.AddXdsResource function, but Routes are added to the RouteConfiguration after tCtx.AddXdsResource(resourcev3.RouteType, xdsRouteCfg) is called. So the validations for RouteConfiguration are skipped.
I understand that filters are not needed here and maybe they are written incorrectly, I'm just making a report that the problem in one httproute affects all httroutes in the cluster.
Activity
arkodg commentedon Jan 25, 2025
looks like this one managed to escape all the checks, here's the error from the envoy proxy
We have 3 levels of validation
500Direct Response is attached to the targeted Route, implementing a fail closed state, so requests targeting this route will fail, and should be able to debug these fasterenvoy-gateway. We plan on bubbling this up as a status too in the future.It should have been caught here, because we didn't add the
must be greater than 0s validation anywherebut it wasn't and the config was pushed to envoy proxy which failed the entire route configarkodg commentedon Jan 25, 2025
@zhaohuabing any idea why the xDS validate didn't kick in ?
this issue can be fixed by adding a CEL validation for this case
zhaohuabing commentedon Jan 25, 2025
@arkodg the validation is done in the
ResourceVersionTable.AddXdsResourcefunction, but Routes are added to theRouteConfigurationaftertCtx.AddXdsResource(resourcev3.RouteType, xdsRouteCfg)is called. So the validations forRouteConfigurationare skipped.gateway/internal/xds/translator/translator.go
Lines 427 to 441 in 549fdde
This may happen in other xDS validation as well. I'm going to send a PR to fix it.
zhaohuabing commentedon Jan 25, 2025
Created #5148 to add missing validations. The CEL validation/Gateway API translator validation for
baseIntervalcan be addressed in a separate PR.fail validation if baseInterval is 0s (envoyproxy#5176)
fail validation if baseInterval is 0s (envoyproxy#5176)
[release/v1.3] release v1.3.0 cherry-pick from main (#5179)
vmcdxliii commentedon Jan 31, 2025
Same problem with all routes 404 when using filters
I understand that filters are not needed here and maybe they are written incorrectly, I'm just making a report that the problem in one httproute affects all httroutes in the cluster.