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

ERROR Error: The stream is broken @0/0. Error: invalid frame byte. #713

Closed
RDevR99 opened this issue Jan 23, 2020 · 5 comments
Closed

ERROR Error: The stream is broken @0/0. Error: invalid frame byte. #713

RDevR99 opened this issue Jan 23, 2020 · 5 comments

Comments

@RDevR99
Copy link

RDevR99 commented Jan 23, 2020

I am using nodejs server and angular frontend. Things work fine without encryption. However, when I put the snippet below in the server for encrypting payload....
image

The size of the payload decreases (10 -> 4 kb) but...

I get this error while logging the response:
image

What could be the reason behind this?

@stanley-cheung
Copy link
Collaborator

Probably same issue as #561

@RDevR99
Copy link
Author

RDevR99 commented Jan 23, 2020

Thanks, Stanley... however I did check that issue but it's for some Akka server and is focused on gzip not working. Not applicable to this scenario as not even compression level 1 is being parsed. Is there any additional config needed to be done on the client-side?

@bclinkinbeard
Copy link

I'm having the same issue, where enabling compression breaks grpc-web. I have an existing call that succeeds when compression is not enabled, and I receive the following response headers.

access-control-allow-origin: http://localhost:3000
access-control-expose-headers: grpc-status,grpc-message
content-type: application/grpc-web+proto
date: Wed, 15 Apr 2020 20:45:23 GMT
grpc-accept-encoding: gzip
grpc-encoding: identity
server: envoy
transfer-encoding: chunked
x-envoy-upstream-service-time: 618

If I enable compression in my gRPC server by calling call.setCompression("gzip"); in a ServerInterceptor, I get the following response headers and the parsing throws the error reported by OP.

access-control-allow-origin: http://localhost:3000
access-control-expose-headers: grpc-status,grpc-message
content-type: application/grpc-web+proto
date: Wed, 15 Apr 2020 20:50:44 GMT
grpc-accept-encoding: gzip
grpc-encoding: gzip
server: envoy
transfer-encoding: chunked
x-envoy-upstream-service-time: 624

Based on https://github.com/grpc/grpc-web/blob/master/BROWSER-FEATURES.md#compression, I would have expected a Content-Encoding: gzip header in the response, but it's not there. Could that cause the Uncaught Error: The stream is broken @0/0. Error: invalid frame byte. error?

I'm also curious if the text wire format needs to be used when compressing, based on #87. Ultimately, I'm not sure how compression is even supposed to work with grpc-web. Is there specific configuration required at the proxy level?

Thanks a bunch for any help or direction you can offer @stanley-cheung.

@stanley-cheung
Copy link
Collaborator

There are several issues like this - I am folding this into #561. We will look into this soon.

@anupkrish24
Copy link

@bclinkinbeard Did you end up figuring this out? I tried adding the Content-Encoding: gzip in the Envoy proxy but I'm getting a "(failed) net::ERR_CONTENT_DECODING_FAILED" in my response. Thanks!

borissmidt pushed a commit to borissmidt/grpc-web that referenced this issue Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants