-
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
transport: check error returned by WriteField to catch illegal characters in metadata #1134
Comments
Are you setting deadlines on your RPCs, and are you attempting 100+ concurrent RPCs? If so, this may be a known issue fixed by #1124. Please give it a try. |
We still see this from time to time even with the patch. It's possibly less frequent but I can't be sure. |
Also I don't believe we are setting deadlines nor doing 100+ concurrent RPCs in our tests, where we most frequently see this bug. |
You are getting a RST_STREAM with error code 8. According to the spec you should get this when the call is canceled: https://github.com/grpc/grpc/blob/c2bc59b2b0de079c64a2e544354b699685ea2853/doc/PROTOCOL-HTTP2.md If there's a deadline set on the RPC it's unlikely but possible that the server sees this deadline and sends RST_STREAM(with error code 8) before the client does.
|
This started happening to me as well. I noticed that it seems related to setting a large value for a metadata value. The value happens to be a JWT token, so plain ASCII, but it seems that changing the metadata key to have the |
Turns out, it was an extra newline in one of the metadata values (which I was reading from a file, and the editor was helpfully adding a trailing newline at the end and not making it obvious). |
Thanks for the follow-up. It's unlikely the original issue was seen because of malformed metadata, because it sounds like it was happening sporadically. Is this still happening? If so, we could use some help in reproducing it (please see @MakMukhi's comment: #1134 (comment)). Thanks! |
Correct it's still happening sporadically. I don't think metadata is
related.
We are running through Lyft's envoy. We are not (knowingly) setting
deadlines. All calls are unary.
On Mon, Jun 19, 2017 at 1:58 PM dfawley ***@***.***> wrote:
Thanks for the follow-up.
It's unlikely the original issue was seen because of malformed metadata,
because it sounds like it was happening sporadically. Is this still
happening? If so, we could use some help in reproducing it (please see
@MakMukhi <https://github.com/makmukhi>'s comment: #1134 (comment)
<#1134 (comment)>).
Thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1134 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA42mLEaYZpS8Xrrwe3scc7eMRbFrWA4ks5sFuD6gaJpZM4MjV66>
.
--
(phone)
|
I can confirm we see it too in production from time to time. We end up being called with a canceled context. We initially thought it was due to the client context being canceled, but even with a test where the client call with a non cancelable context, the server-side context ends up canceled. We have seen it mostly on unary calls, sometimes on streams. |
@zllak Can you provide more information please?
|
|
@kahuang seems to have run into a similar issue here: grpc/grpc#11586 |
Instead of doing a JWT, I'm trying to use protobuf for a token. It's triggering this same issue while in the "authorization" metadata. I suspect it has to do with newlines in the encoded message. Switching the md key to "authorization-bin" seems to have fixed the issue. |
We think that checking the return value of WriteField on the client side (ref) may be able to surface these types of issues before attempting to send the RPC that contains illegal characters in metadata. |
We are seeing the same error, but in our case is rather stable for messages larger than 5 MB even with:
|
@raliste, Did you set the corresponding server options? https://godoc.org/google.golang.org/grpc#MaxRecvMsgSize |
I got nearly the same error about RST_STREAM with error code 2. It would be very helpful to get some hints what to look at. |
@sslavian812, it looks like you're working in Python, but this is the Go repo. Please be patient and someone should respond to your question on SO. If not, you can also email the grpc.io group to ask for help, or if you think it's a bug, file an issue against python in the main grpc repo. |
@egoldschmidt Have you found the root cause of your disconnects? |
For whatever it is worth, I am seeing this same error in Node.js and the stack overflow hint at |
Closing due to lack of activity. Also, if metadata was the cause, #4886 should fix the problem. |
We frequently see failed tests with the following error:
rpc error: code = Canceled desc = stream terminated by RST_STREAM with error code: 8
We don't see logs on the server or client that would indicate that the request failed due to app code. Is there any further explanation for why this type of error would emerge?
Environment:
0713829b980f4ddd276689a36235c5fcc82a21bf
The text was updated successfully, but these errors were encountered: