-
Notifications
You must be signed in to change notification settings - Fork 769
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
Response parsing breaks with 'grpc-encoding: gzip' #561
Comments
I have the same issue ... I had to hack the akka server to override grpc-accept-enconding so the server doesn't gzip the content |
@seroperson thanks for the pointers. Per this the grpc web client implements the grpc-web protocol spec described in that document, which says nothing about not using the |
This cost me some hours. Here is a solution, a bit of code to get others started that run into this issue with Akka HTTP: val service = NetworkWorkersHandler(new NetworkWorkersService())
val handler: HttpRequest => Future[HttpResponse] = { request =>
val withoutEncoding = request.copy(headers = request.headers.filterNot(_.name == "grpc-accept-encoding"))
service(withoutEncoding)
}
val binding = Http().bindAndHandleAsync(
handler,
interface = "127.0.0.1",
port = 8000,
connectionContext = HttpConnectionContext(),
) |
I am getting this exact same problem with a python server when I use a |
A workaround is to remove the |
But I am using python grpc server with envoy. And not akka. |
Oh sorry, I remembered this as an akka-related issue and didn't see the repo in the notification. I guess the solution may be similar, the implementation different. |
now my grpc serice server set context->set_compression_algorithm(GRPC_COMPRESS_GZIP); |
@akan , @seroperson's comment above explains how. |
@stanley-cheung I came here from #713, and was looking to enable the What's the status of this issue and its resolution? |
@stanley-cheung We are also facing similar issue with gzip compression not supported by grpc-web. Issue #1000 Any plans you could share on this gzip support being added in the near future? Or any other suggestions in terms of other compression that grpc-web supports or ways to mitigate the issue? |
@stanley-cheung Is there a proposed solution for compressing the response payloads? This is critical for our application running via grpc-web. Adding the envoy.gzip plugin doesn't seem to help according to: envoyproxy/envoy#6632 |
success: for { invalid byte frame or broken is byte The cut size is incorrect |
I've encountered the same issue, using a Python gRPC server and gRPC-Web as the client, envoy as the proxy. Is there any new progress on this? Any help would be greatly appreciated. @stanley-cheung |
When the gRPC response is gzipped (indicated by the
grpc-encoding: gzip
response header), the grpc-web stream parser fails with this error (including the first few bytes for reference):And the grpc-web filter in Envoy unfortunately automatically adds this request header when proxying to the gRPC server:
grpc-accept-encoding:identity,deflate,gzip
, which in the case of akka-grpc at least causes the server to gzip. The envoy source code has a comment stating that this header 'is required for gRPC'.When I hacked akka-grpc to ignore the above header and not gzip, the response is properly parsed.
I'm a backend engr., but if someone can give me some pointers I could take a stab at fixing this.
The text was updated successfully, but these errors were encountered: