-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
bug: route 404 after upgrade to 3.2.2 #9951
Comments
I change the log level to info, and after create the route/service, the changes have been watched and the config_etcd print the event; But still 404; I did not see any additional logs regarding what happened after the event was received.
|
Same error occurs to me. |
@wklken Hi, I can't reproduce this issue, here is my reproduction step, please help me check the difference with your description.
|
try using a etcd cluster with auth enabled @jiangfucheng |
I follow this project https://github.com/guessi/docker-compose-etcd to start an etcd cluster in my local env, and enable auth, but still can't reproduce this issue. |
I run the apisix in k8s, the etcd address is a service(bitnami etcd helm chart) deployment:
role: traditional
role_traditional:
config_provider: etcd
etcd:
host:
- "http://apigateway-etcd:2379"
timeout: 120
prefix: /gateway-apisix
user: root
password: xxxx and, maybe you should change the |
I use route+service too, maybe this is the cause. |
after register the route+service, got 404
the modifiedIndex is and the log,
and I add another route+service, 404;
there are no logs between 437868 to 437886 How the apisix know the |
@jiangfucheng can you please raise the level of this bug? Version 3.2.2/3.4.0/3.4.1 may all be affected(if it's related to #9456), especially if deploy or upgrade in a production environment. |
@monkeyDluffy6017 @kingluo Hi, could you help take a look at this issue, I don't have enough time to process this issue in a timely manner. |
@Sn0rt Could you help to check? |
got. I will try to reproduce this . @wklken @qihaiyan can you help me check the reproduce step ? I can't reproduce your case follow the step as below. check out 3.2.1check out the 3.2.1 tag and ~/w/apisix> git co 3.2.1
HEAD is now at f81a386d feat: release apisix 3.2.1 (#9559)
~/w/apisix> make deps
Wrote
variables.OPENSSL_LIBDIR = "/opt/homebrew/opt/openresty-openssl111/lib"
to
/Users/guohao/.luarocks/config-5.1.lua
Wrote
variables.OPENSSL_INCDIR = "/opt/homebrew/opt/openresty-openssl111/include"
to
/Users/guohao/.luarocks/config-5.1.lua
apisix master-0 depends on lua-resty-ctxdump 0.1-0 (0.1-0 installed)
apisix master-0 depends on api7-lua-resty-dns-client 7.0.1 (7.0.1-0 installed)
apisix master-0 depends on lua-resty-template 2.0 (2.0-1 installed)
apisix master-0 depends on lua-resty-etcd 1.10.4 (1.10.4-0 installed)
apisix master-0 depends on api7-lua-resty-http 0.2.0 (0.2.0-0 installed)
apisix master-0 depends on lua-resty-balancer 0.04 (0.04-0 installed)
apisix master-0 depends on lua-resty-ngxvar 0.5.2 (0.5.2-0 installed)
apisix master-0 depends on lua-resty-jit-uuid 0.0.7 (0.0.7-2 installed)
apisix master-0 depends on lua-resty-healthcheck-api7 2.2.2 (2.2.2-0 installed)
apisix master-0 depends on api7-lua-resty-jwt 0.2.4 (0.2.4-0 installed)
apisix master-0 depends on lua-resty-hmac-ffi 0.05 (0.05-0 installed)
apisix master-0 depends on lua-resty-cookie 0.1.0 (0.1.0-2 installed)
apisix master-0 depends on lua-resty-session 3.10 (3.10-1 installed)
apisix master-0 depends on opentracing-openresty 0.1 (0.1-0 installed)
apisix master-0 depends on lua-resty-radixtree 2.8.2 (2.8.2-0 installed)
apisix master-0 depends on lua-protobuf 0.4.1 (0.4.1-1 installed)
apisix master-0 depends on lua-resty-openidc 1.7.5 (1.7.5-1 installed)
apisix master-0 depends on luafilesystem 1.7.0-2 (1.7.0-2 installed)
apisix master-0 depends on api7-lua-tinyyaml 0.4.2 (0.4.2-0 installed)
apisix master-0 depends on nginx-lua-prometheus 0.20220527 (0.20220527-1 installed)
apisix master-0 depends on jsonschema 0.9.8 (0.9.8-0 installed)
apisix master-0 depends on lua-resty-ipmatcher 0.6.1 (0.6.1-0 installed)
apisix master-0 depends on lua-resty-kafka 0.20-0 (0.20-0 installed)
apisix master-0 depends on lua-resty-logger-socket 2.0.1-0 (2.0.1-0 installed)
apisix master-0 depends on skywalking-nginx-lua 0.6.0 (0.6.0-0 installed)
apisix master-0 depends on base64 1.5-2 (1.5-2 installed)
apisix master-0 depends on binaryheap 0.4 (0.4-1 installed)
apisix master-0 depends on api7-dkjson 0.1.1 (0.1.1-0 installed)
apisix master-0 depends on resty-redis-cluster 1.02-4 (1.02-4 installed)
apisix master-0 depends on lua-resty-expr 1.3.2 (1.3.2-0 installed)
apisix master-0 depends on graphql 0.0.2 (0.0.2-1 installed)
apisix master-0 depends on argparse 0.7.1-1 (0.7.1-1 installed)
apisix master-0 depends on luasocket 3.1.0-1 (3.1.0-1 installed)
apisix master-0 depends on luasec 0.9-1 (0.9-1 installed)
apisix master-0 depends on lua-resty-consul 0.3-2 (0.3-2 installed)
apisix master-0 depends on penlight 1.9.2-1 (1.9.2-1 installed)
apisix master-0 depends on ext-plugin-proto 0.6.0 (0.6.0-0 installed)
apisix master-0 depends on casbin 1.41.5 (1.41.5-1 installed)
apisix master-0 depends on api7-snowflake 2.0-1 (2.0-1 installed)
apisix master-0 depends on inspect 3.1.1 (3.1.1-0 installed)
apisix master-0 depends on lualdap 1.2.6-1 (1.2.6-1 installed)
apisix master-0 depends on lua-resty-rocketmq 0.3.0-0 (0.3.0-0 installed)
apisix master-0 depends on opentelemetry-lua 0.2-3 (0.2-3 installed)
apisix master-0 depends on net-url 0.9-1 (0.9-1 installed)
apisix master-0 depends on xml2lua 1.5-2 (1.5-2 installed)
apisix master-0 depends on nanoid 0.1-1 (0.1-1 installed)
apisix master-0 depends on lua-resty-mediador 0.1.2-1 (0.1.2-1 installed)
apisix master-0 depends on lua-resty-ldap 0.1.0-0 (0.1.0-0 installed)
Stopping after installing dependencies for apisix master-0 register service and routertest the router for confirm the router is empty. ~/w/apisix> curl http://localhost:9080/anything -v
* processing: http://localhost:9080/anything
* Trying [::1]:9080...
* Connected to localhost (::1) port 9080
> GET /anything HTTP/1.1
> Host: localhost:9080
> User-Agent: curl/8.2.1
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Date: Thu, 03 Aug 2023 07:40:02 GMT
< Content-Type: text/plain; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Server: APISIX/3.2.1
<
{"error_msg":"404 Route Not Found"}
* Connection #0 to host localhost left intact create the service and router ~/w/apisix> curl http://127.0.0.1:9180/apisix/admin/services/200 \
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
{"key":"/apisix/services/200","value":{"id":"200","upstream":{"type":"roundrobin","nodes":{"httpbin.org:80":1},"hash_on":"vars","pass_host":"pass","scheme":"http"},"create_time":1691048414,"update_time":1691048414}} now create the router ~/w/apisix> curl http://127.0.0.1:9180/apisix/admin/routes/100 \
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"methods": ["GET"],
"uri": "/anything",
"service_id": "200"
}'
{"key":"/apisix/routes/100","value":{"priority":0,"service_id":"200","methods":["GET"],"id":"100","uri":"/anything","status":1,"create_time":1691048440,"update_time":1691048440}} test the router ~/w/apisix> curl http://localhost:9080/anything -v
* processing: http://localhost:9080/anything
* Trying [::1]:9080...
* Connected to localhost (::1) port 9080
> GET /anything HTTP/1.1
> Host: localhost:9080
> User-Agent: curl/8.2.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Content-Length: 382
< Connection: keep-alive
< Date: Thu, 03 Aug 2023 07:40:47 GMT
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Credentials: true
< Server: APISIX/3.2.1
<
{
"args": {},
"data": "",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Host": "localhost",
"User-Agent": "curl/8.2.1",
"X-Amzn-Trace-Id": "Root=1-64cb59fb-1f3fe0963bb8d3a73c33e05c",
"X-Forwarded-Host": "localhost"
},
"json": null,
"method": "GET",
"origin": "::1, 220.246.124.214",
"url": "http://localhost/anything"
}
* Connection #0 to host localhost left intact switch to 3.2.2now checkout the tag 3.2.2 ~/w/apisix> git co 3.2.2
Previous HEAD position was f81a386d feat: release apisix 3.2.1 (#9559)
HEAD is now at 77704832 feat: release APISIX 3.2.2 (#9723)
~/w/apisix> make deps
Wrote
variables.OPENSSL_LIBDIR = "/opt/homebrew/opt/openresty-openssl111/lib"
to
/Users/guohao/.luarocks/config-5.1.lua
Wrote
variables.OPENSSL_INCDIR = "/opt/homebrew/opt/openresty-openssl111/include"
to
/Users/guohao/.luarocks/config-5.1.lua
Missing dependencies for apisix master-0:
api7-lua-resty-jwt 0.2.5 (not installed)
apisix master-0 depends on lua-resty-ctxdump 0.1-0 (0.1-0 installed)
apisix master-0 depends on api7-lua-resty-dns-client 7.0.1 (7.0.1-0 installed)
apisix master-0 depends on lua-resty-template 2.0 (2.0-1 installed)
apisix master-0 depends on lua-resty-etcd 1.10.4 (1.10.4-0 installed)
apisix master-0 depends on api7-lua-resty-http 0.2.0 (0.2.0-0 installed)
apisix master-0 depends on lua-resty-balancer 0.04 (0.04-0 installed)
apisix master-0 depends on lua-resty-ngxvar 0.5.2 (0.5.2-0 installed)
apisix master-0 depends on lua-resty-jit-uuid 0.0.7 (0.0.7-2 installed)
apisix master-0 depends on lua-resty-healthcheck-api7 2.2.2 (2.2.2-0 installed)
apisix master-0 depends on api7-lua-resty-jwt 0.2.5 (not installed)
Installing https://luarocks.org/api7-lua-resty-jwt-0.2.5-0.src.rock
api7-lua-resty-jwt 0.2.5-0 depends on lua >= 5.1 (5.1-1 provided by VM)
api7-lua-resty-jwt 0.2.5-0 depends on lua-resty-openssl >= 0.6.8 (0.8.22-1 installed)
api7-lua-resty-jwt 0.2.5-0 is now installed in /Users/guohao/workspace/apisix/deps (license: Apache License Version 2)
Checking stability of dependencies in the absence of
api7-lua-resty-jwt 0.2.4-0...
Removing api7-lua-resty-jwt 0.2.4-0...
Removal successful.
apisix master-0 depends on lua-resty-hmac-ffi 0.05 (0.05-0 installed)
apisix master-0 depends on lua-resty-cookie 0.1.0 (0.1.0-2 installed)
apisix master-0 depends on lua-resty-session 3.10 (3.10-1 installed)
apisix master-0 depends on opentracing-openresty 0.1 (0.1-0 installed)
apisix master-0 depends on lua-resty-radixtree 2.8.2 (2.8.2-0 installed)
apisix master-0 depends on lua-protobuf 0.4.1 (0.4.1-1 installed)
apisix master-0 depends on lua-resty-openidc 1.7.5 (1.7.5-1 installed)
apisix master-0 depends on luafilesystem 1.7.0-2 (1.7.0-2 installed)
apisix master-0 depends on api7-lua-tinyyaml 0.4.2 (0.4.2-0 installed)
apisix master-0 depends on nginx-lua-prometheus 0.20220527 (0.20220527-1 installed)
apisix master-0 depends on jsonschema 0.9.8 (0.9.8-0 installed)
apisix master-0 depends on lua-resty-ipmatcher 0.6.1 (0.6.1-0 installed)
apisix master-0 depends on lua-resty-kafka 0.20-0 (0.20-0 installed)
apisix master-0 depends on lua-resty-logger-socket 2.0.1-0 (2.0.1-0 installed)
apisix master-0 depends on skywalking-nginx-lua 0.6.0 (0.6.0-0 installed)
apisix master-0 depends on base64 1.5-2 (1.5-2 installed)
apisix master-0 depends on binaryheap 0.4 (0.4-1 installed)
apisix master-0 depends on api7-dkjson 0.1.1 (0.1.1-0 installed)
apisix master-0 depends on resty-redis-cluster 1.02-4 (1.02-4 installed)
apisix master-0 depends on lua-resty-expr 1.3.2 (1.3.2-0 installed)
apisix master-0 depends on graphql 0.0.2 (0.0.2-1 installed)
apisix master-0 depends on argparse 0.7.1-1 (0.7.1-1 installed)
apisix master-0 depends on luasocket 3.1.0-1 (3.1.0-1 installed)
apisix master-0 depends on luasec 0.9-1 (0.9-1 installed)
apisix master-0 depends on lua-resty-consul 0.3-2 (0.3-2 installed)
apisix master-0 depends on penlight 1.9.2-1 (1.9.2-1 installed)
apisix master-0 depends on ext-plugin-proto 0.6.0 (0.6.0-0 installed)
apisix master-0 depends on casbin 1.41.5 (1.41.5-1 installed)
apisix master-0 depends on api7-snowflake 2.0-1 (2.0-1 installed)
apisix master-0 depends on inspect 3.1.1 (3.1.1-0 installed)
apisix master-0 depends on lualdap 1.2.6-1 (1.2.6-1 installed)
apisix master-0 depends on lua-resty-rocketmq 0.3.0-0 (0.3.0-0 installed)
apisix master-0 depends on opentelemetry-lua 0.2-3 (0.2-3 installed)
apisix master-0 depends on net-url 0.9-1 (0.9-1 installed)
apisix master-0 depends on xml2lua 1.5-2 (1.5-2 installed)
apisix master-0 depends on nanoid 0.1-1 (0.1-1 installed)
apisix master-0 depends on lua-resty-mediador 0.1.2-1 (0.1.2-1 installed)
apisix master-0 depends on lua-resty-ldap 0.1.0-0 (0.1.0-0 installed)
Stopping after installing dependencies for apisix master-0
re-load the APISIX ~/w/apisix> make reload
[ info ] reload -> [ Start ]
/Users/guohao/workspace/apisix/bin/apisix reload
/usr/local/openresty//luajit/bin/luajit ./apisix/cli/apisix.lua reload
[ info ] reload -> [ Done ] test the router ~/w/apisix> curl http://localhost:9080/anything -v
* processing: http://localhost:9080/anything
* Trying [::1]:9080...
* Connected to localhost (::1) port 9080
> GET /anything HTTP/1.1
> Host: localhost:9080
> User-Agent: curl/8.2.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Content-Length: 382
< Connection: keep-alive
< Date: Thu, 03 Aug 2023 07:41:12 GMT
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Credentials: true
< Server: APISIX/3.2.2
<
{
"args": {},
"data": "",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Host": "localhost",
"User-Agent": "curl/8.2.1",
"X-Amzn-Trace-Id": "Root=1-64cb5a14-4f21c4e612b9f52b646cf3d5",
"X-Forwarded-Host": "localhost"
},
"json": null,
"method": "GET",
"origin": "::1, 220.246.124.214",
"url": "http://localhost/anything"
}
* Connection #0 to host localhost left intact |
@Sn0rt create the route and service on the version 3.2.2
|
ok. I will update the reproduce step. ok. the bug has been reproduced. check out 3.2.2check the code from tag 3.2.2 ~/w/apisix> git co 3.2.2
HEAD is now at 77704832 feat: release APISIX 3.2.2 (#9723)
~/w/apisix> make deps
Wrote
variables.OPENSSL_LIBDIR = "/opt/homebrew/opt/openresty-openssl111/lib"
to
/Users/guohao/.luarocks/config-5.1.lua
Wrote
variables.OPENSSL_INCDIR = "/opt/homebrew/opt/openresty-openssl111/include"
to
/Users/guohao/.luarocks/config-5.1.lua
apisix master-0 depends on lua-resty-ctxdump 0.1-0 (0.1-0 installed)
apisix master-0 depends on api7-lua-resty-dns-client 7.0.1 (7.0.1-0 installed)
apisix master-0 depends on lua-resty-template 2.0 (2.0-1 installed)
apisix master-0 depends on lua-resty-etcd 1.10.4 (1.10.4-0 installed)
apisix master-0 depends on api7-lua-resty-http 0.2.0 (0.2.0-0 installed)
apisix master-0 depends on lua-resty-balancer 0.04 (0.04-0 installed)
apisix master-0 depends on lua-resty-ngxvar 0.5.2 (0.5.2-0 installed)
apisix master-0 depends on lua-resty-jit-uuid 0.0.7 (0.0.7-2 installed)
apisix master-0 depends on lua-resty-healthcheck-api7 2.2.2 (2.2.2-0 installed)
apisix master-0 depends on api7-lua-resty-jwt 0.2.5 (0.2.5-0 installed)
apisix master-0 depends on lua-resty-hmac-ffi 0.05 (0.05-0 installed)
apisix master-0 depends on lua-resty-cookie 0.1.0 (0.1.0-2 installed)
apisix master-0 depends on lua-resty-session 3.10 (3.10-1 installed)
apisix master-0 depends on opentracing-openresty 0.1 (0.1-0 installed)
apisix master-0 depends on lua-resty-radixtree 2.8.2 (2.8.2-0 installed)
apisix master-0 depends on lua-protobuf 0.4.1 (0.4.1-1 installed)
apisix master-0 depends on lua-resty-openidc 1.7.5 (1.7.5-1 installed)
apisix master-0 depends on luafilesystem 1.7.0-2 (1.7.0-2 installed)
apisix master-0 depends on api7-lua-tinyyaml 0.4.2 (0.4.2-0 installed)
apisix master-0 depends on nginx-lua-prometheus 0.20220527 (0.20220527-1 installed)
apisix master-0 depends on jsonschema 0.9.8 (0.9.8-0 installed)
apisix master-0 depends on lua-resty-ipmatcher 0.6.1 (0.6.1-0 installed)
apisix master-0 depends on lua-resty-kafka 0.20-0 (0.20-0 installed)
apisix master-0 depends on lua-resty-logger-socket 2.0.1-0 (2.0.1-0 installed)
apisix master-0 depends on skywalking-nginx-lua 0.6.0 (0.6.0-0 installed)
apisix master-0 depends on base64 1.5-2 (1.5-2 installed)
apisix master-0 depends on binaryheap 0.4 (0.4-1 installed)
apisix master-0 depends on api7-dkjson 0.1.1 (0.1.1-0 installed)
apisix master-0 depends on resty-redis-cluster 1.02-4 (1.02-4 installed)
apisix master-0 depends on lua-resty-expr 1.3.2 (1.3.2-0 installed)
apisix master-0 depends on graphql 0.0.2 (0.0.2-1 installed)
apisix master-0 depends on argparse 0.7.1-1 (0.7.1-1 installed)
apisix master-0 depends on luasocket 3.1.0-1 (3.1.0-1 installed)
apisix master-0 depends on luasec 0.9-1 (0.9-1 installed)
apisix master-0 depends on lua-resty-consul 0.3-2 (0.3-2 installed)
apisix master-0 depends on penlight 1.9.2-1 (1.9.2-1 installed)
apisix master-0 depends on ext-plugin-proto 0.6.0 (0.6.0-0 installed)
apisix master-0 depends on casbin 1.41.5 (1.41.5-1 installed)
apisix master-0 depends on api7-snowflake 2.0-1 (2.0-1 installed)
apisix master-0 depends on inspect 3.1.1 (3.1.1-0 installed)
apisix master-0 depends on lualdap 1.2.6-1 (1.2.6-1 installed)
apisix master-0 depends on lua-resty-rocketmq 0.3.0-0 (0.3.0-0 installed)
apisix master-0 depends on opentelemetry-lua 0.2-3 (0.2-3 installed)
apisix master-0 depends on net-url 0.9-1 (0.9-1 installed)
apisix master-0 depends on xml2lua 1.5-2 (1.5-2 installed)
apisix master-0 depends on nanoid 0.1-1 (0.1-1 installed)
apisix master-0 depends on lua-resty-mediador 0.1.2-1 (0.1.2-1 installed)
apisix master-0 depends on lua-resty-ldap 0.1.0-0 (0.1.0-0 installed)
Stopping after installing dependencies for apisix master-0
~/w/apisix> make reload
[ info ] reload -> [ Start ]
/Users/guohao/workspace/apisix/bin/apisix reload
/usr/local/openresty//luajit/bin/luajit ./apisix/cli/apisix.lua reload
[ info ] reload -> [ Done ] test the router not be installed ~/w/apisix> curl http://localhost:9080/anything -v
* processing: http://localhost:9080/anything
* Trying [::1]:9080...
* Connected to localhost (::1) port 9080
> GET /anything HTTP/1.1
> Host: localhost:9080
> User-Agent: curl/8.2.1
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Date: Thu, 03 Aug 2023 08:13:49 GMT
< Content-Type: text/plain; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Server: APISIX/3.2.2
<
{"error_msg":"404 Route Not Found"}
* Connection #0 to host localhost left intact create service and routercreate a service and router ~/w/apisix> curl http://127.0.0.1:9180/apisix/admin/services/200 \
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"upstream": {
"type": "roundrobin",
"nodes": {
"httpbin.org:80": 1
}
}
}'
{"value":{"create_time":1691050434,"upstream":{"nodes":{"httpbin.org:80":1},"type":"roundrobin","hash_on":"vars","scheme":"http","pass_host":"pass"},"update_time":1691050434,"id":"200"},"key":"/apisix/services/200"}
~/w/apisix> curl http://127.0.0.1:9180/apisix/admin/routes/100 \
-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"methods": ["GET"],
"uri": "/anything",
"service_id": "200"
}'
{"value":{"uri":"/anything","create_time":1691050439,"priority":0,"id":"100","methods":["GET"],"service_id":"200","update_time":1691050439,"status":1},"key":"/apisix/routes/100"} and test the router. ~/w/apisix> curl http://localhost:9080/anything -v
* processing: http://localhost:9080/anything
* Trying [::1]:9080...
* Connected to localhost (::1) port 9080
> GET /anything HTTP/1.1
> Host: localhost:9080
> User-Agent: curl/8.2.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Content-Length: 382
< Connection: keep-alive
< Date: Thu, 03 Aug 2023 08:14:28 GMT
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Credentials: true
< Server: APISIX/3.2.2
<
{
"args": {},
"data": "",
"files": {},
"form": {},
"headers": {
"Accept": "*/*",
"Host": "localhost",
"User-Agent": "curl/8.2.1",
"X-Amzn-Trace-Id": "Root=1-64cb61e0-5e4919de62e639d160823fde",
"X-Forwarded-Host": "localhost"
},
"json": null,
"method": "GET",
"origin": "::1, 220.246.124.214",
"url": "http://localhost/anything"
}
* Connection #0 to host localhost left intact Now it works. check out 3.2.1check out the tag 3.2.1 and ~/w/apisix> git co 3.2.1
Previous HEAD position was 77704832 feat: release APISIX 3.2.2 (#9723)
HEAD is now at f81a386d feat: release apisix 3.2.1 (#9559)
~/w/apisix> make deps
Wrote
variables.OPENSSL_LIBDIR = "/opt/homebrew/opt/openresty-openssl111/lib"
to
/Users/guohao/.luarocks/config-5.1.lua
Wrote
variables.OPENSSL_INCDIR = "/opt/homebrew/opt/openresty-openssl111/include"
to
/Users/guohao/.luarocks/config-5.1.lua
Missing dependencies for apisix master-0:
api7-lua-resty-jwt 0.2.4 (not installed)
apisix master-0 depends on lua-resty-ctxdump 0.1-0 (0.1-0 installed)
apisix master-0 depends on api7-lua-resty-dns-client 7.0.1 (7.0.1-0 installed)
apisix master-0 depends on lua-resty-template 2.0 (2.0-1 installed)
apisix master-0 depends on lua-resty-etcd 1.10.4 (1.10.4-0 installed)
apisix master-0 depends on api7-lua-resty-http 0.2.0 (0.2.0-0 installed)
apisix master-0 depends on lua-resty-balancer 0.04 (0.04-0 installed)
apisix master-0 depends on lua-resty-ngxvar 0.5.2 (0.5.2-0 installed)
apisix master-0 depends on lua-resty-jit-uuid 0.0.7 (0.0.7-2 installed)
apisix master-0 depends on lua-resty-healthcheck-api7 2.2.2 (2.2.2-0 installed)
apisix master-0 depends on api7-lua-resty-jwt 0.2.4 (not installed)
Installing https://luarocks.org/api7-lua-resty-jwt-0.2.4-0.src.rock
api7-lua-resty-jwt 0.2.4-0 depends on lua >= 5.1 (5.1-1 provided by VM)
api7-lua-resty-jwt 0.2.4-0 depends on lua-resty-openssl >= 0.6.8 (0.8.22-1 installed)
api7-lua-resty-jwt 0.2.4-0 is now installed in /Users/guohao/workspace/apisix/deps (license: Apache License Version 2)
Checking stability of dependencies in the absence of
api7-lua-resty-jwt 0.2.5-0...
Removing api7-lua-resty-jwt 0.2.5-0...
Removal successful.
apisix master-0 depends on lua-resty-hmac-ffi 0.05 (0.05-0 installed)
apisix master-0 depends on lua-resty-cookie 0.1.0 (0.1.0-2 installed)
apisix master-0 depends on lua-resty-session 3.10 (3.10-1 installed)
apisix master-0 depends on opentracing-openresty 0.1 (0.1-0 installed)
apisix master-0 depends on lua-resty-radixtree 2.8.2 (2.8.2-0 installed)
apisix master-0 depends on lua-protobuf 0.4.1 (0.4.1-1 installed)
apisix master-0 depends on lua-resty-openidc 1.7.5 (1.7.5-1 installed)
apisix master-0 depends on luafilesystem 1.7.0-2 (1.7.0-2 installed)
apisix master-0 depends on api7-lua-tinyyaml 0.4.2 (0.4.2-0 installed)
apisix master-0 depends on nginx-lua-prometheus 0.20220527 (0.20220527-1 installed)
apisix master-0 depends on jsonschema 0.9.8 (0.9.8-0 installed)
apisix master-0 depends on lua-resty-ipmatcher 0.6.1 (0.6.1-0 installed)
apisix master-0 depends on lua-resty-kafka 0.20-0 (0.20-0 installed)
apisix master-0 depends on lua-resty-logger-socket 2.0.1-0 (2.0.1-0 installed)
apisix master-0 depends on skywalking-nginx-lua 0.6.0 (0.6.0-0 installed)
apisix master-0 depends on base64 1.5-2 (1.5-2 installed)
apisix master-0 depends on binaryheap 0.4 (0.4-1 installed)
apisix master-0 depends on api7-dkjson 0.1.1 (0.1.1-0 installed)
apisix master-0 depends on resty-redis-cluster 1.02-4 (1.02-4 installed)
apisix master-0 depends on lua-resty-expr 1.3.2 (1.3.2-0 installed)
apisix master-0 depends on graphql 0.0.2 (0.0.2-1 installed)
apisix master-0 depends on argparse 0.7.1-1 (0.7.1-1 installed)
apisix master-0 depends on luasocket 3.1.0-1 (3.1.0-1 installed)
apisix master-0 depends on luasec 0.9-1 (0.9-1 installed)
apisix master-0 depends on lua-resty-consul 0.3-2 (0.3-2 installed)
apisix master-0 depends on penlight 1.9.2-1 (1.9.2-1 installed)
apisix master-0 depends on ext-plugin-proto 0.6.0 (0.6.0-0 installed)
apisix master-0 depends on casbin 1.41.5 (1.41.5-1 installed)
apisix master-0 depends on api7-snowflake 2.0-1 (2.0-1 installed)
apisix master-0 depends on inspect 3.1.1 (3.1.1-0 installed)
apisix master-0 depends on lualdap 1.2.6-1 (1.2.6-1 installed)
apisix master-0 depends on lua-resty-rocketmq 0.3.0-0 (0.3.0-0 installed)
apisix master-0 depends on opentelemetry-lua 0.2-3 (0.2-3 installed)
apisix master-0 depends on net-url 0.9-1 (0.9-1 installed)
apisix master-0 depends on xml2lua 1.5-2 (1.5-2 installed)
apisix master-0 depends on nanoid 0.1-1 (0.1-1 installed)
apisix master-0 depends on lua-resty-mediador 0.1.2-1 (0.1.2-1 installed)
apisix master-0 depends on lua-resty-ldap 0.1.0-0 (0.1.0-0 installed)
Stopping after installing dependencies for apisix master-0
~/w/apisix> make reload
[ info ] reload -> [ Start ]
/Users/guohao/workspace/apisix/bin/apisix reload
/usr/local/openresty//luajit/bin/luajit ./apisix/cli/apisix.lua reload
[ info ] reload -> [ Done ] test the router ~/w/apisix> curl http://localhost:9080/anything -v
* processing: http://localhost:9080/anything
* Trying [::1]:9080...
* Connected to localhost (::1) port 9080
> GET /anything HTTP/1.1
> Host: localhost:9080
> User-Agent: curl/8.2.1
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Date: Thu, 03 Aug 2023 08:14:56 GMT
< Content-Type: text/plain; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Server: APISIX/3.2.1
<
{"error_msg":"404 Route Not Found"}
* Connection #0 to host localhost left intact check the etcd~/w/apisix> etcdctl get /apisix/routes/100
/apisix/routes/100
{"uri":"/anything","service_id":"200","priority":0,"id":"100","create_time":1691050439,"methods":["GET"],"update_time":1691050439,"status":1}
~/w/apisix> etcdctl get /apisix/services/200
/apisix/services/200
{"create_time":1691050434,"upstream":{"nodes":{"httpbin.org:80":1},"type":"roundrobin","hash_on":"vars","scheme":"http","pass_host":"pass"},"update_time":1691050434,"id":"200"} |
check the etcd~/w/apisix> etcdctl get /apisix/routes/100
/apisix/routes/100
{"uri":"/anything","service_id":"200","priority":0,"id":"100","create_time":1691050439,"methods":["GET"],"update_time":1691050439,"status":1}
~/w/apisix> etcdctl get /apisix/services/200
/apisix/services/200
{"create_time":1691050434,"upstream":{"nodes":{"httpbin.org:80":1},"type":"roundrobin","hash_on":"vars","scheme":"http","pass_host":"pass"},"update_time":1691050434,"id":"200"} format the result {
"uri": "/anything",
"service_id": "200",
"priority": 0,
"id": "100",
"create_time": 1691050439,
"methods": [
"GET"
],
"update_time": 1691050439,
"status": 1
} the {
"create_time": 1691050434,
"upstream": {
"nodes": {
"httpbin.org:80": 1
},
"type": "roundrobin",
"hash_on": "vars",
"scheme": "http",
"pass_host": "pass"
},
"update_time": 1691050434,
"id": "200"
} |
@Sn0rt I am not sure your reproduce step is correct my step is:
the 3.2.1 is ok(we deployed on production for a long time), only the 3.2.2 has the |
So can you simplify the environment to reproduce? I'm checking my steps to reproduce. I don't quite understand what you describe, it is best to provide certain steps to reproduce.
Can you explain what this means? |
@Sn0rt I have reproduce it via docker-compose; the key is change the the steps:
version: "3"
services:
apisix:
# image: "apache/apisix:${APISIX_DOCKER_TAG}"
image: "apache/apisix:3.2.2-centos"
restart: always
volumes:
- ./apisix_conf/master/config.yaml:/usr/local/apisix/conf/config.yaml:ro
depends_on:
- etcd
ports:
- "9180:9180/tcp"
- "9080:9080/tcp"
- "9091:9091/tcp"
- "9443:9443/tcp"
networks:
- apisix
etcd:
image: bitnami/etcd:3.5.7
# user: root
# restart: always
volumes:
- ../example/etcd_data:/bitnami/etcd_data
# volumes:
# - etcd_data:/bitnami/etcd
environment:
ETCD_DATA_DIR: /etcd_data
ETCD_ENABLE_V2: "true"
ALLOW_NONE_AUTHENTICATION: "yes"
ETCD_ADVERTISE_CLIENT_URLS: "http://0.0.0.0:2379"
ETCD_LISTEN_CLIENT_URLS: "http://0.0.0.0:2379"
ports:
- "2379:2379/tcp"
networks:
- apisix
networks:
apisix:
driver: bridge
if you start from the beginning, change the |
@wklken It's not supposed to change prefix at the runtime, even if followed by |
@kingluo when we change the prefix in change the prefix in config.yaml, then docker-compose up, put a route and service, the
|
@wklken |
https://github.com/apache/apisix/blob/f99cf546d4a514f73870073cf3e3bfeb598a5777/apisix/core/config_etcd.lua#L395C30-L395C30 ref: https://www.lua.org/manual/5.1/manual.html#pdf-string.find |
sorry for the confusing words in the reproduce steps, I have changed it to |
@jiangfucheng I have checked, if we remove the |
@jiangfucheng Excellent work! |
@jiangfucheng |
Current Behavior
register route and service into etcd, the changes not been watched and got 404
Expected Behavior
apisix watch the changes in time, the url should not be 404
Error Logs
I have create route/service 4 times, delete the instance and redo
only 1 time got an error log. another 3 times got no error log(still 404)
apisix reload
Steps to Reproduce
apisix reload
, call the url, 200;got an error log
maybe this feature cause the error: #9456
Environment
apisix version
): 3.2.2uname -a
):openresty -V
ornginx -V
): nginx version: openresty/1.21.4.1curl http://127.0.0.1:9090/v1/server_info
): 2.5.4luarocks --version
):The text was updated successfully, but these errors were encountered: