Yangzcy423911 opened a new issue #3266:
URL: https://github.com/apache/apisix/issues/3266


   ### Issue description
   
   ### Environment
   
   * apisix version (cmd: `apisix version`): 2.2
   * OS: (cmd: `uname -a`)
   * OpenResty / Nginx version: (cmd: `nginx -V` or `openresty -V`)
   openresty -V
   Tengine version: Tengine/2.3.2
   nginx version: nginx/1.17.3
   built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
   built with OpenSSL 1.0.2k-fips  26 Jan 2017
   TLS SNI support enabled
   ### Minimal test code / Steps to reproduce the issue
   
   1.  in router config monitor
   about router
   {
       "node": {
           "value": {
               "update_time": 1610508245,
               "methods": [
                   "GET",
                   "HEAD",
                   "POST",
                   "PUT",
                   "DELETE",
                   "OPTIONS",
                   "PATCH"
               ],
               "upstream": {
                   "pass_host": "pass",
                   "type": "roundrobin",
                   "nodes": [
                       {
                           "host": "wx.test.com",
                           "port": 80,
                           "weight": 1
                       }
                   ],
                   "timeout": {
                       "connect": 6000,
                       "send": 6000,
                       "read": 6000
                   }
               },
               "id": "337065930544645006",
               "hosts": [
                   "wx.test.con"
               ],
               "name": "test123",
               "status": 1,
               "uris": [
                   "/*"
               ],
               "plugins": {
                   "prometheus": {
                       "disable": false
                   },
                   "redirect": {
                       "http_to_https": true
                   },
                   "request-id": {
                       "disable": false,
                       "include_in_response": true
                   }
               },
               "create_time": 1610436550,
               "desc": "测试",
               "vars": {}
           },
           "key": "/uat-apisix/routes/337065930544645006"
       },
       "count": "1",
       "action": "get"
   }
   2.  apisix error log
   2021/01/13 11:27:32 [error] 17251#17251: *13691570 lua entry thread aborted: 
runtime error: /usr/share/lua/5.1/apisix/core/etcd.lua:92: attempt to index 
field 'header' (a nil value)
   stack traceback:
   coroutine 0:
           /usr/share/lua/5.1/apisix/core/etcd.lua: in function 'get_format'
           /usr/share/lua/5.1/apisix/core/config_etcd.lua:75: in function 
'getkey'
           /usr/share/lua/5.1/apisix/plugins/prometheus/exporter.lua:310: in 
function 'handler'
           /usr/share/lua/5.1/apisix/api_router.lua:124: in function 'handler'
           /usr/local/apisix//deps/share/lua/5.1/resty/radixtree.lua:713: in 
function 'dispatch'
           /usr/share/lua/5.1/apisix/api_router.lua:159: in function 'match'
           /usr/share/lua/5.1/apisix/init.lua:381: in function 
'http_access_phase'
           access_by_lua(nginx.conf:251):2: in main chunk, client: 192.168.1.1, 
server: , request: "GET /apisix/prometheus/metrics HTTP/1.1", host: 
"192.168.1.1"
   
   


----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to