-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
help request: router dispatch not working as expected #7449
Comments
@juzhiyuan 我发送了一些邮件到您的邮箱,并提供了一些日志截图,想要咨询一下apisix对于复杂路由的匹配规则是怎样的,是否和nginx一样,又是如何使用的呢 |
Also, could you please paste the screenshot and descriptions into this issue? Then more team members could check. 🙏 NOTE: Don't forget to erase sensitive content. |
我降低版本到2.13.1就没有这样的问题了,所以是否是最近几个版本更改了路由的匹配规则导致的呢?看到其他的issue中也有提到这样的现象 |
Could you please paste those issues here? Then I will cc maintainers to check the difference. |
Please provide the minimum reproducible steps |
开会的时候描述过过程了,我不知道还可以怎么描述,是否检查一下版本更新的diff内容更好呢?对比一下2.13.1和之后的版本的路由这边的代码差别,现象是如果只有一个路由,不会出现404的情况,如果出现多个路由,就会无法路由到正确的环境地址 |
ok, just give me a route for the problem, I will try it on 2.13.1 and the latest version. |
我认为这是一个普遍的问题,当你拥有多个请求前缀相似的路由的情况下,新版本的apisix不能很好的转发,你可以模拟这样的场景来进行验证 |
we have some test cases to cover, see: https://github.com/apache/apisix/blob/master/t/router/radixtree-uri-sanity.t#L256-L306 So I need you to give the exact replication scenario, otherwise I won't verify it blindly. |
@1renwuruiming Again, because your screenshot has some sensitive information, so I can't paste them here instead of you directly. Also, all people here are volunteers who love this community, and if you can't provide enough information, it's hard to help you resolve this issue. |
@juzhiyuan 我需要将后台服务的地址提供给您吗? |
我以什么样的方式来提供route比较合适呢? |
The form of route stored in etcd, text form, desensitized. And the verification process. |
好的,我整理一下给您 |
@tzssangglass 如何从etcd导出数据呢?我尝试了多种方式仍旧没有成功导出 |
you can use |
[{ |
@tzssangglass 我从etcd导出了json数据,并脱敏了相关的信息,请看一下这样的路由提供方式是否有用,感谢 |
ok, I will check this issue and #7136 together. |
My recurrence process is as follows: apisix version 2.13.1apisix-base version: nginx version: openresty/1.21.4.1
use openresty mock upstream, config like:
and test
As you can see, the route matching here follows the style of Nginx.
here 404 status was returned by upstream, why? because the request URI was changed by apisix version 2.13.2apisix-base version: nginx version: openresty/1.21.4.1 Repeat the above process, and get consistent results. possible errorsAPISIX route matching differs from Nginx's locationYour routing configuration is as follows:
According to the above test cases, if the request is
this means that APISIX cannot match the request, it does not match ref: https://github.com/apache/apisix/blob/master/docs/en/latest/terminology/route.md proxy-rewriteYou need to verify whether it is the 404 Route Not Found returned by APISIX or the 404 returned by the upstream. You should know exactly which route the request will be caught by and how the request URI will be modified by proxy-rewrite. reproduce your caseYou can describe what you think the routing chaos looks like, based on my reproduction case modification above. |
And for reproducibility, you can test by providing just one route describing the difference between 2.13.1 and 2.13.2 in the same scenario (same route configuration, same upstream), which will allow us to pinpoint the problem faster. |
Or you think that if two routes routeA and routeB exist at the same time, and the same request is matched by routeA at 2.13.1 and by routeB at 2.13.2, then you can set up two routes. |
如果是upstream的路由不存在,那么为什么会时好时坏呢?在没有修改过apisix的route的情况下,如果上游路由地址不对,那应该始终是404,不是么 |
First, we should know what mainly changed between 2.13.1 and 2.13.2? And in my test case, my route setting is simple, only I still believe that the simple test case can't find out the problem of this case. |
During the upgrade processing, we don't change any routes config, all the errors should not lead by the route config. Maybe some performance problem exists? |
我将会重试2.14.1版本时的路由跳转问题,2.13.2版本我未曾进行过验证 |
here is the commit history: https://github.com/apache/apisix/commits/release/2.13
in APISIX,
So can you give steps that can be reproduced and accurately describe the anomaly as I have given? I need to reproduce it in my environment in order to locate it. |
I also tried it in 2.14.1 and the conclusion is the same. |
So can you give details of the steps that can reproduce this phenomenon? |
你得测试验证高并发场景下的 case,比如对一个 route 做 ab benchmark。 |
Do not post pictures, use text. |
我在请求并发不高的情况下可以轻而易举的复现出这个问题,当然,apisix的版本是2.14.1 |
2022/07/15 01:42:56 [error] 45#45: *118 lua entry thread aborted: runtime error: /usr/local/apisix/apisix/init.lua:362: attempt to index upvalue 'local_conf' (a nil value) stack traceback:coroutine 0: |
Then give a detailed step by step that I can reproduce, based on 2.14.1 |
我将重新安装2.14.1版本的apisix,并重试这个问题,如果我找到了系统的复现过程,我将会提供出来 |
Please submit another issue for this and give the steps to reproduce it, especially in detail, until then you can look at: #3830 It may have more to do with the way you switch versions. |
好的,那么大概清楚了,谢谢 |
This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the [email protected] list. Thank you for your contributions. |
This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time. |
Description
nginx存在多种路由的匹配规则,apisix是否存在同样的方式,如果存在,是如何使用的呢
Environment
apisix version
):uname -a
):openresty -V
ornginx -V
):curl http://127.0.0.1:9090/v1/server_info
):luarocks --version
):The text was updated successfully, but these errors were encountered: