-
Notifications
You must be signed in to change notification settings - Fork 459
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
Panic when undefined route shares a prefix with a defined route #855
Comments
Hello @mila-rodriguez-netapp , Have you been able to reproduce this behavior in a clean environment without plugins? I just copy/pasted your example, added a default backend and I was unable to reproduce this behavior. Could you provide more input? The issue you refer to, does not panic in 2.5
Curls:
|
Same here, my friends.
|
Hey, you are facing a problem as described in the issues #779, #325, #386, #423 and #632 related to routing conflicts leading to errors when using automated processes to generate configuration files with multiple endpoints. This is indeed a known issue with the router package used internally by KrakenD. We have communicated with the maintainers of the router package about this problem twice (gin-gonic/gin#2959). Initially, there was an attempt to fix it, but unfortunately, that effort did not fully resolve the issue. We are waiting for the package maintainers' response to find a permanent solution. In the meantime, the workaround you've discovered —disabling the automatic redirect— remains the only method to prevent these panics. This situation occurs when a 404 response is expected for a request to a path that overlaps with several patterns but matches none of them. |
I've created a new issue in the gin project (gin-gonic/gin#3972), hoping to get some attention because it looks like the old one is getting none since it's already closed and marked as fixed |
Hi @alombarte I encountered the above and |
Environment info:
Describe the bug
My gateway has a number of routes that share a prefix -- eg.
/accounts/{id}/widgets
,/accounts/{id}/gizmos
, etc. These endpoints all route as expected. But if a request is received for a non-existent endpoint that uses the common prefix, this causes krakend to panic.The panic is handled and logged -- the service does not crash -- but no response is sent to the caller.
Your configuration file:
The backends really don't matter here, we never get there in this example.
Commands used
krakend run -c /etc/krakend/krakend.json
Test commands:
Expected behavior
I would expect a query against a undefined endpoint to resolve consistently (502, 404, not particularly choosy as long as it's consistent) and not panic.
In my current version of Krakend, the expected behavior is a 404:
instead of:
... which is what happens due to the panic.
Logs
Additional context
I'm actually running a custom plugin so my stack trace might look weird (had to remove the bits specific to my company's application due to policy.) However since #779 looks suspiciously like the same thing I'm seeing, I'm quite certain this hasn't anything to do with any custom code.
Due to the nature of my application, I can't use
"disable_redirect_fixed_path": true
, which I understand from #779 may be a workaround.The text was updated successfully, but these errors were encountered: