-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
"no router to route request" (regex_priority is nil) #4254
Comments
@mars Thanks for the report! I can provide a patch asap. |
@mars Btw, a Route's default |
PR is #4255 - feel free to apply the patch on your end and verify that it solves the issue for you. Thanks again! |
Amazing! Thank you @thibaultcha I will build Kong on that PR and reply here with results. My requests that set |
If Routes have `regex_priority` properties mixed between numbers and nil (e.g. one Route was created with a default `regex_priority`, the other was created with a purposefully NULL `regex_priority`, the comparison in the router rebuild sorting of Routes would error out, because we are comparing one Route's `nil` value against another Route's `number`. Fix #4254
Using the PR's "fix/router-rebuild-no-regex-priority" branch I built Kong and while the 500 error is gone, it no longer matches requests for the route at all: {"message":"no Route matched with those values"} This route used to work, but have yet to discover why it's not matching now: resource "kong_route" "wasabi_hostname" {
protocols = ["https"]
paths = ["/wasabi"]
strip_path = true
service_id = "${kong_service.wasabi.id}"
} Will continue debugging tomorrow. |
If Routes have `regex_priority` properties mixed between numbers and nil (e.g. one Route was created with a default `regex_priority`, the other was created with a purposefully NULL `regex_priority`, the comparison in the router rebuild sorting of Routes would error out, because we are comparing one Route's `nil` value against another Route's `number`. Fix #4254
Now that the fix has been merged to master, I built Kong from master and now see that this is fixed ✅ 💯 Thank you for the fast action @thibaultcha 🤗 |
FYI for those running Kong EE: I discovered that this bug is still present in some of the route-building logic in the latest enterprise edition (0.35-3). I've submitted a support ticket about this. |
For Kong version 1.0.0-1.0.2 configured with a Route with null/nil
regex_priority
, Kong throws a 500 error when receiving any request, logging the error (formatted for readability):Looking at Kong source location referenced in that error:
So it seems to be routing code comparing route priorities.
I check the Postgres database to see what the route contains for that field:
The field is null.
So, it seems like at least one of these solutions would be good for Kong:
nil
(treat like0
)0
"regex_priority": null
The text was updated successfully, but these errors were encountered: