idbeta opened a new issue #2707:
URL: https://github.com/apache/apisix/issues/2707


   ### Issue description
   Enable http-logger plugin in the route will cause an error log.
   
   ### Environment
   
   * apisix version (cmd: `apisix version`): master
   * OS:
   
   ### Minimal test code / Steps to reproduce the issue
   1. set the route
   ```shell
   curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
         "plugins": {
               "http-logger": {
                   "uri": "127.0.0.1:9797/postendpoint?param=1"
               }
          },
         "upstream": {
              "type": "roundrobin",
              "nodes": {
                  "127.0.0.1:9797": 1
              }
         },
         "uri": "/test"
   }'
   ```
   2. request the route
   ```
   curl  127.0.0.1:9080/test
   ```
   3.
   ```
   $ cat error.log 
   2020/11/11 16:45:09 [error] 41367#2352668: *2007998 lua entry thread 
aborted: runtime error: 
/Users/idbeta/1106/apisix/apisix/plugins/http-logger.lua:103: bad argument #1 
to 'connect' (string expected, got nil)
   stack traceback:
   coroutine 0:
        [C]: in function 'connect'
        /Users/idbeta/1106/apisix/apisix/plugins/http-logger.lua:103: in 
function 'func'
        /Users/idbeta/1106/apisix/apisix/utils/batch-processor.lua:59: in 
function </Users/idbeta/1106/apisix/apisix/utils/batch-processor.lua:54>, 
context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   ```
   
   ### What's the actual result? (including assertion message & call stack if 
applicable)
   
   
   
   ### What's the expected result?
   


----------------------------------------------------------------
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]


Reply via email to