Firstsawyou opened a new issue #2310:
URL: https://github.com/apache/apisix/issues/2310
### Issue description
Before the `etcd` service is closed, the `apisix` request is normal. After
the `etcd` service is turned off and turned on again, the `apisix` request
reports 404 ({"error_msg":"failed to match any routes"}).
### Environment
* apisix version (cmd: `apisix version`): 1.5
* OS: centos 7
### Minimal test code / Steps to reproduce the issue
1.Add route and configure upstream information
curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY:
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"methods": ["GET"],
"uri": "/index.html",
"upstream": {
"type": "roundrobin",
"nodes": {
"127.0.0.1:9081": 1
}
},
"desc": "upstream node"
}'
2. Access to 'route' is normal
3.Turn off the etcd service and turn it on again
4.Exception in accessing 'route' again
### What's the actual result? (including assertion message & call stack if
applicable)
curl -i http://127.0.0.1:9080/index.html
HTTP/1.1 404 Not Found
Date: Fri, 25 Sep 2020 03:36:10 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Server: APISIX/1.5
{"error_msg":"failed to match any routes"}
error log:
2020/09/25 10:37:07 [error] 16527#16527: *28 lua entry thread aborted:
runtime error: ...r_service-id_route-id/apisix/apisix/core/config_etcd.lua:421:
attempt to concatenate local 'err' (a nil value)
stack traceback:
coroutine 0:
...r_service-id_route-id/apisix/apisix/core/config_etcd.lua: in
function <...r_service-id_route-id/apisix/apisix/core/config_etcd.lua:414>,
context: ngx.timer
2020/09/25 10:37:07 [error] 16527#16527: *30 lua entry thread aborted:
runtime error: ...r_service-id_route-id/apisix/apisix/core/config_etcd.lua:421:
attempt to concatenate local 'err' (a nil value)
stack traceback:
coroutine 0:
...r_service-id_route-id/apisix/apisix/core/config_etcd.lua: in
function <...r_service-id_route-id/apisix/apisix/core/config_etcd.lua:414>,
context: ngx.timer
### What's the expected result?
curl -i http://127.0.0.1:9080/index.html
HTTP/1.1 200
......
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]