water1st opened a new issue #4206: URL: https://github.com/apache/apisix/issues/4206
### Issue description ### Environment * apisix version (cmd: `apisix version`):2.5 * OS (cmd: `uname -a`):Linux 7c30c8872c4e 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux * OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`): * etcd version, if have (cmd: run `curl http://127.0.0.1:9090/v1/server_info` to get the info from server-info API): 3.4.9 * apisix-dashboard docker image version: apache/apisix-dashboard:latest * apisix docker image version: apache/apisix:latest * luarocks version, if the issue is about installation (cmd: `luarocks --version`): ### Minimal test code / Steps to reproduce the issue 1.run this command ``` $ curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d ' { "uri": "/*", "upstream": { "service_name": "http://127.0.0.1:8500/v1/kv/upstreams/webpages/", "type": "roundrobin", "discovery_type": "consul_kv" } }' ``` ### What's the actual result? (including assertion message & call stack if applicable) response ``` HTTP/1.1 500 Internal Server Error Server: openresty Date: Sat, 08 May 2021 10:04:25 GMT Content-Type: text/html; charset=utf-8 Content-Length: 174 Connection: close Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true Access-Control-Expose-Headers: * Access-Control-Max-Age: 3600 <html> <head><title>500 Internal Server Error</title></head> <body> <center><h1>500 Internal Server Error</h1></center> <hr><center>openresty</center> </body> </html> ``` logs ``` /usr/local/apisix/apisix/init.lua: in function 'http_admin' content_by_lua(nginx.conf:193):2: in main chunk, client: 172.22.0.1, server: _, request: "PUT /apisix/admin/routes/1 HTTP/1.1", host: "127.0.0.1:9080" 2021/05/08 09:58:41 [error] 50#50: *40948 lua entry thread aborted: runtime error: /usr/local/apisix/apisix/init.lua:686: attempt to index upvalue 'router' (a nil value) stack traceback: coroutine 0: /usr/local/apisix/apisix/init.lua: in function 'http_admin' content_by_lua(nginx.conf:193):2: in main chunk, client: 172.22.0.1, server: _, request: "PUT /apisix/admin/routes/1 HTTP/1.1", host: "127.0.0.1:9080" 2021/05/08 10:04:25 [error] 49#49: *58056 lua entry thread aborted: runtime error: /usr/local/apisix/apisix/init.lua:686: attempt to index upvalue 'router' (a nil value) stack traceback: coroutine 0: /usr/local/apisix/apisix/init.lua: in function 'http_admin' content_by_lua(nginx.conf:193):2: in main chunk, client: 172.22.0.1, server: _, request: "PUT /apisix/admin/routes/1 HTTP/1.1", host: "127.0.0.1:9080" ``` -- 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]
