Skip to content
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

stream terminated by RST_STREAM with error code: PROTOCOL_ERROR #4960

Closed
restevez-chs opened this issue Nov 6, 2021 · 3 comments
Closed

Comments

@restevez-chs
Copy link

restevez-chs commented Nov 6, 2021

What version of gRPC are you using?

v1.42.0

What version of Go are you using (go version)?

go version go1.17.2 darwin/amd64

What operating system (Linux, Windows, …) and version?

Mac OS 10.15.7

What did you do?

I have a working API written in Go using grpc and grpc-gateway. When I upgraded to [email protected], I expected the API to continue to work.

  • Ran go get -u google.golang.org/[email protected]
  • Previous version google.golang.org/grpc v1.41.0

What did you expect to see?

When I upgraded to [email protected], I expected the API to continue to work.

What did you see instead?

I see this error in the response body

stream terminated by RST_STREAM with error code: PROTOCOL_ERROR

With debug enabled, I see this output in the service logs

2021/11/05 17:16:00 ERROR: [transport] transport: http2Server.operateHeaders parsed a :connection header which makes a request malformed as per the HTTP/2 spec

From my research, these are the changes causing breakage:

I have been able to confirm with a Postman request that the error goes away -- and my API request is successful -- if the Connection request header is not present.

However, I am unable to quickly resolve with my Ruby-based Cucumber step definitions where I am using HTTPParty for the API requests. I have also tried net/http. Both of these libraries send a default Connection request header, which at the moment I have been unable to remove.

In summary, the stated changes are causing a breakage which is unexpected for a minor version -- the PR feedback indicates there was a concern during the PR review too. I'm new to Go and GRPC, so any extra feedback would be great.

Thank you.

@restevez-chs
Copy link
Author

Update: on my side of things, I was able to resolve using the header filter mechanism with the grpc-gateway. Their docs describe the approach.

TL;DR - the header filter is used to remove the Connection header.

I still think the breakage in the minor version is questionable, but after more reading, I understand that the change was made to enforce the rule that the Connection header is not to be used with HTTP/2:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection

I look forward to any extra comments and feedback you have. Thank you.

bcessa added a commit to bryk-io/pkg that referenced this issue Nov 9, 2021
gRPC recently adjusted the logic for the xDS Configured HTTP Filter,
as per A41. Right now this is dropping streams that includes the
'Connection' header as part of its metadata.

More information about the change is available here:
grpc/grpc-go#4803

This is a known issue currently being tracked here:
grpc/grpc-go#4960
bcessa added a commit to algorandfoundation/did-algo that referenced this issue Nov 9, 2021
gRPC recently adjusted the logic for the xDS Configured HTTP Filter,
as per A41. Right now this is dropping streams that includes the
'Connection' header as part of its metadata.

More information about the change is available here:
grpc/grpc-go#4803

This is a known issue currently being tracked here:
grpc/grpc-go#4960
@dfawley
Copy link
Member

dfawley commented Nov 10, 2021

Correct. This is part of the HTTP/2 spec that we were not following before, so this would be considered a bug fix. Specifically:

https://httpwg.org/specs/rfc7540.html#rfc.section.8.1.2.2

An endpoint MUST NOT generate an HTTP/2 message containing connection-specific header fields; any message containing connection-specific header fields MUST be treated as malformed

@restevez-chs
Copy link
Author

thanks @dfawley

iamralch added a commit to phogolabs/plex that referenced this issue Dec 30, 2021
For more information have a look at the following issue:

grpc/grpc-go#4960
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants