You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/11 08:47:20 UTC
[GitHub] [apisix] idbeta opened a new issue #2707: bug: Enable http-logger plugin in the route will cause an error log
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:
users@infra.apache.org
[GitHub] [apisix] spacewander commented on issue #2707: bug: Enable http-logger plugin in the route will cause an error log
Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2707:
URL: https://github.com/apache/apisix/issues/2707#issuecomment-725291411
You should use `http://127.0.0.1:9797/postendpoint?param=1`. BTW, we need to verify the input.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] idbeta closed issue #2707: bug: Enable http-logger plugin in the route will cause an error log
Posted by GitBox <gi...@apache.org>.
idbeta closed issue #2707:
URL: https://github.com/apache/apisix/issues/2707
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] idbeta commented on issue #2707: bug: Enable http-logger plugin in the route will cause an error log
Posted by GitBox <gi...@apache.org>.
idbeta commented on issue #2707:
URL: https://github.com/apache/apisix/issues/2707#issuecomment-726636262
The cause of the problem has been found, it is my environment problem, not the plug-in problem.
`127.0.0.1:9797/postendpoint?param=1` also can work for me now.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] spacewander edited a comment on issue #2707: bug: Enable http-logger plugin in the route will cause an error log
Posted by GitBox <gi...@apache.org>.
spacewander edited a comment on issue #2707:
URL: https://github.com/apache/apisix/issues/2707#issuecomment-725297933
@idbeta
I tried `http://127.0.0.1:9797/postendpoint?param=1` but it works well for me:
```bash
incubator-apisix (doc_disp*) 0
¥ curl 127.0.0.1:9080/test
<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>openresty</center>
</body>
</html>
incubator-apisix (doc_disp*) 0
¥ tail -f logs/error.log
2020/11/11 17:00:50 [warn] 88683#88683: *12 [lua] plugin.lua:178: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2020/11/11 17:00:50 [warn] 88678#88678: *11 [lua] plugin.lua:178: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2020/11/11 17:00:50 [warn] 88675#88675: *3 [lua] plugin.lua:178: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2020/11/11 17:00:50 [warn] 88682#88682: *10 [lua] plugin.lua:178: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2020/11/11 17:00:50 [warn] 88687#88687: *13 [lua] plugin.lua:130: load(): new plugins: {"redirect":true,"uri-blocker":true,"fault-injection":true,"proxy-mirror":true,"serverless-post-function":true,"zipkin":true,"batch-requests":true,"request-validation":true,"limit-count":true,"openid-connect":true,"prometheus":true,"limit-conn":true,"ip-restriction":true,"wolf-rbac":true,"basic-auth":true,"key-auth":true,"limit-req":true,"api-breaker":true,"hmac-auth":true,"request-id":true,"proxy-cache":true,"consumer-restriction":true,"tcp-logger":true,"cors":true,"referer-restriction":true,"echo":true,"proxy-rewrite":true,"grpc-transcode":true,"http-logger":true,"serverless-pre-function":true,"response-rewrite":true,"node-status":true,"authz-keycloak":true,"kafka-logger":true,"jwt-auth":true,"syslog":true,"udp-logger":true}, context: init_worker_by_lua*
2020/11/11 17:00:50 [warn] 88673#88673: *160 [lua] init.lua:262: sync_local_conf_to_etcd(): sync local conf to etcd, context: ngx.timer
2020/11/11 17:00:50 [warn] 88677#88677: *5 [lua] plugin.lua:178: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2020/11/11 17:00:50 [warn] 88680#88680: *7 [lua] plugin.lua:178: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2020/11/11 17:00:50 [warn] 88687#88687: *13 [lua] plugin.lua:178: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2020/11/11 17:01:55 [error] 88674#88674: *12041 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /test HTTP/1.1", upstream: "http://127.0.0.1:9797/test", host: "127.0.0.1:9080"
^C
```
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [apisix] idbeta commented on issue #2707: bug: Enable http-logger plugin in the route will cause an error log
Posted by GitBox <gi...@apache.org>.
idbeta commented on issue #2707:
URL: https://github.com/apache/apisix/issues/2707#issuecomment-725294006
@spacewander https://github.com/apache/apisix/blob/master/doc/plugins/http-logger.md the documentation is `127.0.0.1:9797/postendpoint?param=1`, and the problem still exists even I used `http://127.0.0.1:9797/postendpoint?param=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:
users@infra.apache.org
[GitHub] [apisix] spacewander commented on issue #2707: bug: Enable http-logger plugin in the route will cause an error log
Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2707:
URL: https://github.com/apache/apisix/issues/2707#issuecomment-725297933
@idbeta
I tried `http://127.0.0.1:9797/postendpoint?param=1` but it work well for me:
```bash
incubator-apisix (doc_disp*) 0
¥ curl 127.0.0.1:9080/test
<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>openresty</center>
</body>
</html>
incubator-apisix (doc_disp*) 0
¥ tail -f logs/error.log
2020/11/11 17:00:50 [warn] 88683#88683: *12 [lua] plugin.lua:178: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2020/11/11 17:00:50 [warn] 88678#88678: *11 [lua] plugin.lua:178: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2020/11/11 17:00:50 [warn] 88675#88675: *3 [lua] plugin.lua:178: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2020/11/11 17:00:50 [warn] 88682#88682: *10 [lua] plugin.lua:178: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2020/11/11 17:00:50 [warn] 88687#88687: *13 [lua] plugin.lua:130: load(): new plugins: {"redirect":true,"uri-blocker":true,"fault-injection":true,"proxy-mirror":true,"serverless-post-function":true,"zipkin":true,"batch-requests":true,"request-validation":true,"limit-count":true,"openid-connect":true,"prometheus":true,"limit-conn":true,"ip-restriction":true,"wolf-rbac":true,"basic-auth":true,"key-auth":true,"limit-req":true,"api-breaker":true,"hmac-auth":true,"request-id":true,"proxy-cache":true,"consumer-restriction":true,"tcp-logger":true,"cors":true,"referer-restriction":true,"echo":true,"proxy-rewrite":true,"grpc-transcode":true,"http-logger":true,"serverless-pre-function":true,"response-rewrite":true,"node-status":true,"authz-keycloak":true,"kafka-logger":true,"jwt-auth":true,"syslog":true,"udp-logger":true}, context: init_worker_by_lua*
2020/11/11 17:00:50 [warn] 88673#88673: *160 [lua] init.lua:262: sync_local_conf_to_etcd(): sync local conf to etcd, context: ngx.timer
2020/11/11 17:00:50 [warn] 88677#88677: *5 [lua] plugin.lua:178: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2020/11/11 17:00:50 [warn] 88680#88680: *7 [lua] plugin.lua:178: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2020/11/11 17:00:50 [warn] 88687#88687: *13 [lua] plugin.lua:178: load_stream(): new plugins: {"mqtt-proxy":true}, context: init_worker_by_lua*
2020/11/11 17:01:55 [error] 88674#88674: *12041 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /test HTTP/1.1", upstream: "http://127.0.0.1:9797/test", host: "127.0.0.1:9080"
^C
```
----------------------------------------------------------------
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:
users@infra.apache.org