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 2022/04/14 16:57:18 UTC
[GitHub] [apisix] aixichen opened a new issue, #6848: bug: http-logger 和grpc-transcode 同时使用BUG
aixichen opened a new issue, #6848:
URL: https://github.com/apache/apisix/issues/6848
### Current Behavior
http-logger 开启 include_resp_body = true 记录返回body
同时
使用 grpc-transcode
接口返回数据错错误 表现为返回 proto 定义的默认值
### Expected Behavior
正常解析grpc
### Error Logs
_No response_
### Steps to Reproduce
1.开启插件 http-logger 开启 include_resp_body = true 记录返回body
2.编写一个grpc 服务通过 grpc-transcode解析
3. 请求后返回默认值
4. 插件 http-logger 设置 include_resp_body = false 请求返回正常
详细步骤,代码:https://github.com/aixichen/apisix_bug/blob/master/README.md
### Environment
- APISIX version (run `apisix version`):2.13.0
- Operating system (run `uname -a`):root
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] spacewander closed issue #6848: bug: http-logger 和grpc-transcode 同时使用BUG
Posted by GitBox <gi...@apache.org>.
spacewander closed issue #6848: bug: http-logger 和grpc-transcode 同时使用BUG
URL: https://github.com/apache/apisix/issues/6848
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tzssangglass commented on issue #6848: bug: http-logger 和grpc-transcode 同时使用BUG
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #6848:
URL: https://github.com/apache/apisix/issues/6848#issuecomment-1099839185
And, you need to describe the replication steps in this issue (so that the issue is more complete).
You will also need to supplement the `http-logger` configuration.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tzssangglass commented on issue #6848: bug: http-logger 和grpc-transcode 同时使用BUG
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #6848:
URL: https://github.com/apache/apisix/issues/6848#issuecomment-1099838596
I was not able to reproduce your problem with the following test cases:
```
BEGIN {
if ($ENV{TEST_NGINX_CHECK_LEAK}) {
$SkipReason = "unavailable for the hup tests";
} else {
$ENV{TEST_NGINX_USE_HUP} = 1;
undef $ENV{TEST_NGINX_USE_STAP};
}
}
use t::APISIX 'no_plan';
repeat_each(1);
no_long_string();
no_shuffle();
no_root_location();
log_level('debug');
run_tests;
__DATA__
=== TEST 1: set proto(id: 1)
--- config
location /t {
content_by_lua_block {
local t = require("lib.test_admin").test
local code, body = t('/apisix/admin/proto/1',
ngx.HTTP_PUT,
[[{
"content" : "syntax = \"proto3\";
package helloworld;
service Greeter {
rpc SayHello (HelloRequest) returns (HelloReply) {}
rpc Plus (PlusRequest) returns (PlusReply) {}
rpc SayHelloAfterDelay (HelloRequest) returns (HelloReply) {}
}
message HelloRequest {
string name = 1;
}
message HelloReply {
string message = 1;
}
message PlusRequest {
int64 a = 1;
int64 b = 2;
}
message PlusReply {
int64 result = 1;
}"
}]]
)
if code >= 300 then
ngx.status = code
end
ngx.say(body)
}
}
--- request
GET /t
--- response_body
passed
--- no_error_log
[error]
=== TEST 2: set routes(with http-logger)
--- config
location /t {
content_by_lua_block {
local t = require("lib.test_admin").test
local code, body = t('/apisix/admin/routes/1',
ngx.HTTP_PUT,
[[{
"methods": ["GET"],
"uri": "/grpc_plus",
"plugins": {
"grpc-transcode": {
"proto_id": "1",
"service": "helloworld.Greeter",
"method": "Plus",
"pb_option":["int64_as_string", "enum_as_name"]
},
"http-logger": {
"uri": "http://127.0.0.1:1980/log",
"batch_max_size": 1,
"include_resp_body": true
}
},
"upstream": {
"scheme": "grpc",
"type": "roundrobin",
"nodes": {
"127.0.0.1:50051": 1
}
}
}]]
)
if code >= 300 then
ngx.status = code
end
ngx.say(body)
}
}
--- request
GET /t
--- response_body
passed
--- no_error_log
[error]
=== TEST 3: hit route
--- request
GET /grpc_plus?a=1&b=2
--- response_body eval
qr/\{"result":3\}/
--- no_error_log
[error]
```
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tzssangglass commented on issue #6848: bug: http-logger 和grpc-transcode 同时使用BUG
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #6848:
URL: https://github.com/apache/apisix/issues/6848#issuecomment-1099846921
ok, I know, use `http-logger` on `global_rule`, reproduced it.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org