-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error messages with newlines cause PROTOCOL_ERROR #576
Comments
|
@bradfitz Can you take a look? This seems introduced by the http2.MetaHeadersFrame change. I tried to append a "\n" at the end of the error desc at https://github.com/grpc/grpc-go/blob/master/test/end2end_test.go#L97 and ran TestFailedEmptyUnary test case. It hangs there. Before the change of http2.MetaHeadersFrame, it seems work fine. |
|
The http2.MetaHeadersFrame change exposed an existing problem but it is not the problem itself. The http2 spec is very clear: http://httpwg.org/specs/rfc7540.html#rfc.section.10.3
grpc & grpc-go should not be putting user's raw error messages without escaping into header fields. The grpc wire protocol says: http://www.grpc.io/docs/guides/wire.html
I think grpc-go might not handle the I'm happy to implement this if you'd like, @iamqizhao, or you can if you want to. Let me know. |
|
Thanks, Brad. Yeah, I have planned to add the error/status encoding/processing in. But in my experiments (as I mentioned in my first reply), the client hangs forever instead of returning any error. Can you take a look? |
|
Re 606, saying this is expected behavior - is it? I think grpc should be able to handle errors with newlines, without the end user caring about the transport - can't it just be escaped? @iamqizhao |
|
@peter-edge, I believe there's already an open bug for transparent base64 escaping. If you can't find it, please open one. (I'm on a poor connection) |
|
I could use a good grpc bug to get into, lemme see what I can do :) but tomorrow, I am on Europe time |
|
And I'm currently on Australia time. If we're distributed across the globe we'll have good code review latency with somebody always awake. :-) |
|
+1 for GOOG :) |
|
@peter-edge @enisoc are you still seeing this issue? |
|
I never found out the status of the fix. I just stripped all the newlines from my error messages. |
|
This should be fixed by #610 |
I just updated my project from gRPC 0.12 to 0.13, and did a
go get -u google.golang.org/grpcand regenerated my protos. My tests started failing with errors like this:It turns out it's because some of the error messages I return from streaming RPCs contain
\n. If I remove the\ncharacters, the problem goes away.I haven't made a reduced test case, but you can try taking any streaming RPC and adding
return fmt.Errorf("error with\nnewline")on the server implementation.The text was updated successfully, but these errors were encountered: