apisix icon indicating copy to clipboard operation
apisix copied to clipboard

bug: Route url

Open ziyou434 opened this issue 5 years ago • 5 comments

Issue description

when I set url: "/index.html" ,there is nothing wrong. But I set url: "foo/index.html" or "foo/bar/index.html", it will give me {"error_msg":"failed to match any routes"}. Is it controled by route's rules , or it's a bug?

Environment

  • apisix version (cmd: apisix version): 2.1
  • OS: centos7

ziyou434 avatar Dec 08 '20 03:12 ziyou434

What are your steps? In my environment, APISIX does not have this problem, but the dashboard will prompt that this setting is not allowed.

idbeta avatar Dec 08 '20 05:12 idbeta

What are your steps? In my environment, APISIX does not have this problem, but the dashboard will prompt that this setting is not allowed.

curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
    "uri": "/v1/receipt/verify",
    "upstream": {
        "type": "roundrobin",
        "nodes": {
            "192.168.199.1:8080": 1
        }
    }
}'

curl http://127.0.0.1:9080/v1/receipt/verify

It will get a mistake.

ziyou434 avatar Dec 08 '20 06:12 ziyou434

curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
    "uri": "/v1/receipt/verify",
    "upstream": {
        "type": "roundrobin",
        "nodes": {
            "192.168.199.1:8080": 1
        }
    }
}'

curl http://127.0.0.1:9080/v1/receipt/verify

It will get a mistake.

do you mean "uri": "v1/receipt/verify" ? because if I use /v1/receipt/verify, my environment (2.1) cannot reproduce the problem

idbeta avatar Dec 08 '20 08:12 idbeta

curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
    "uri": "/v1/receipt/verify",
    "upstream": {
        "type": "roundrobin",
        "nodes": {
            "192.168.199.1:8080": 1
        }
    }
}'

curl http://127.0.0.1:9080/v1/receipt/verify

It will get a mistake.

do you mean "uri": "v1/receipt/verify" ? because if I use /v1/receipt/verify, my environment (2.1) cannot reproduce the problem

I found that the connection between etcd and apisix may not be stable. This happens sometimes during routing and forwarding. curl http://127.0.0.1:9080/apisix/admin/routes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' sometimes get Connection Refused ,It's about a quarter chance of going wrong.

ziyou434 avatar Dec 08 '20 08:12 ziyou434

I found that the connection between etcd and apisix may not be stable. This happens sometimes during routing and forwarding. curl http://127.0.0.1:9080/apisix/admin/routes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' sometimes get Connection Refused ,It's about a quarter chance of going wrong.

I get your point. The unstable environment causes APISIX to be unstable. Now there is a PR doing this test. I hope this problem can be solved.

idbeta avatar Dec 08 '20 09:12 idbeta