You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@brpc.apache.org by "icexin (via GitHub)" <gi...@apache.org> on 2025/09/29 10:18:37 UTC
[I] GRPC client error: connection closed before server preface received (brpc)
icexin opened a new issue, #3109:
URL: https://github.com/apache/brpc/issues/3109
**Describe the bug**
When using a GRPC client to call a brpc server with redis protocol enabled, the client will failed with `code = Unavailable desc = connection closed before server preface received`.
Introduced by #3024 , the Redis protocol check is too loose, and it parses the GRPC protocol as the Redis protocol.
**To Reproduce**
This is the code to reproduce the the issue.
``` c++
#include <brpc/server.h>
class RedisService : public brpc::RedisService {
};
int main(int argc, char* argv[]) {
google::ParseCommandLineFlags(&argc, &argv, true);
brpc::Server server;
brpc::ServerOptions options;
RedisService redis_service;
options.redis_service = &redis_service;
if (server.Start(7447, &options) != 0) {
LOG(ERROR) << "Failed to start dummy server";
return 1;
}
server.RunUntilAskedToQuit();
return 0;
}
```
**Expected behavior**
The GRPC client failed with `code = Unimplemented desc = [10.234.44.157:4003][E1002]Fail to find method on /service.method"
**Versions**
OS: ubuntu 20.04 kernel: 5.15.0
Compiler: clang-12
brpc: 1.14.1
protobuf: 27.3
**Additional context/screenshots**
--
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: issues-unsubscribe@brpc.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@brpc.apache.org
For additional commands, e-mail: issues-help@brpc.apache.org
Re: [I] GRPC client error: connection closed before server preface received (brpc)
Posted by "icexin (via GitHub)" <gi...@apache.org>.
icexin commented on issue #3109:
URL: https://github.com/apache/brpc/issues/3109#issuecomment-3393238016
The redis inline protocol needs to clearly specify which message headers are acceptable, because many protocols also start with plaintext letters.
--
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: issues-unsubscribe@brpc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@brpc.apache.org
For additional commands, e-mail: issues-help@brpc.apache.org
Re: [I] GRPC client error: connection closed before server preface received (brpc)
Posted by "chenBright (via GitHub)" <gi...@apache.org>.
chenBright commented on issue #3109:
URL: https://github.com/apache/brpc/issues/3109#issuecomment-3406175587
If the Redis inline protocol cannot clearly identify the protocol, we can treat the Redis inline protocol as a new protocol and put it at the end of ProtocolType, so that it will not affect the existing protocol.
--
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: issues-unsubscribe@brpc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@brpc.apache.org
For additional commands, e-mail: issues-help@brpc.apache.org
Re: [I] GRPC client error: connection closed before server preface received (brpc)
Posted by "icexin (via GitHub)" <gi...@apache.org>.
icexin commented on issue #3109:
URL: https://github.com/apache/brpc/issues/3109#issuecomment-3393083010
@thweetkomputer
--
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: issues-unsubscribe@brpc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@brpc.apache.org
For additional commands, e-mail: issues-help@brpc.apache.org
Re: [I] GRPC client error: connection closed before server preface received (brpc)
Posted by "thweetkomputer (via GitHub)" <gi...@apache.org>.
thweetkomputer commented on issue #3109:
URL: https://github.com/apache/brpc/issues/3109#issuecomment-3393094628
What does the grpc client send to brpc server?
--
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: issues-unsubscribe@brpc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@brpc.apache.org
For additional commands, e-mail: issues-help@brpc.apache.org
Re: [I] GRPC client error: connection closed before server preface received (brpc)
Posted by "icexin (via GitHub)" <gi...@apache.org>.
icexin commented on issue #3109:
URL: https://github.com/apache/brpc/issues/3109#issuecomment-3383889421
@wwbmmm
--
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: issues-unsubscribe@brpc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@brpc.apache.org
For additional commands, e-mail: issues-help@brpc.apache.org
Re: [I] GRPC client error: connection closed before server preface received (brpc)
Posted by "icexin (via GitHub)" <gi...@apache.org>.
icexin commented on issue #3109:
URL: https://github.com/apache/brpc/issues/3109#issuecomment-3383829894
有人关注这个issue吗?对于开启了brpc(grpc)和redis双协议的服务是一个比较致命的bug
--
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: issues-unsubscribe@brpc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@brpc.apache.org
For additional commands, e-mail: issues-help@brpc.apache.org
Re: [I] GRPC client error: connection closed before server preface received (brpc)
Posted by "thweetkomputer (via GitHub)" <gi...@apache.org>.
thweetkomputer commented on issue #3109:
URL: https://github.com/apache/brpc/issues/3109#issuecomment-3393095592
maybe can restrict brpc inline protocol only accept letters.
--
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: issues-unsubscribe@brpc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@brpc.apache.org
For additional commands, e-mail: issues-help@brpc.apache.org
Re: [I] GRPC client error: connection closed before server preface received (brpc)
Posted by "chenBright (via GitHub)" <gi...@apache.org>.
chenBright closed issue #3109: GRPC client error: connection closed before server preface received
URL: https://github.com/apache/brpc/issues/3109
--
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: issues-unsubscribe@brpc.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@brpc.apache.org
For additional commands, e-mail: issues-help@brpc.apache.org