-
Notifications
You must be signed in to change notification settings - Fork 770
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
grpc-status is not returned when making unary call #1050
Comments
I am having the exact same issue and did some testing. All gPRC servers (regardless of implementation language) should either return a response without an error or an error without a response. Both envoy and improbable-eng proxy send the gRPC errors to the browser via headers with an empty payload and 200 response code. The current js client implementation makes a mistake and assumes an empty response is an incomplete response. In my testing, I was attempting to return Here is some sample js code:
This is what I get back in the browser:
So when the gRPC server errors out, the proxy returns 200, empty body, and two special headers. The js code above prints The generated js/ts code looks fine, however the library fails to extract the error codes from the headers and always assumes an empty payload is an incomplete payload. So my guess there is something that got introduced recently in the javascript library but I am yet to find it. I would appreciate some help fixing or debugging this. |
I was able to fix this issue actually. The issue I was having was that the grpc headers in the response from envoy were being filtered out and thus the grpc web client was unable to parse the response correctly. |
@LukeLaScala, what headers were filtered out? Which headers are important to correctly parsing a failed response? |
@LukeLaScala, thanks a lot for the hint, I was able to pin-point the issue; please see #1101 (comment) for all the details. @chengyaxue, do you mind testing again with the changes suggested in #1101 (comment) ? Just need to add |
Hi @stefannegrea, we've recently found out the root cause. It's because our server added header |
We had a similar issue where gRPC error responses always would result in "incomplete response" on the client. Envoy would remove the "grpc-status" and "grpc-message" headers even though they were added to"expose_headers" in the envoy.yaml config. We tried all solutions mentioned here and in #1101 and #951. What finally solved it was having envoy to remove the content-length header as per the comment in this issue (see the PR). |
Thank you for sharing this hint. |
I've build a grpc server and exposed the server by envoy-proxy. I found that when grpc server throws GrpcStatusException, grpc-web always gets error saying
incomplete response
if making unary calls. I was able to get grpc-status on 'status' event if I invoke stream APIs. Please advise how to debug this issue. Thanks!Version
I generated protobut file by running
protoc -I. proto/myservice.proto \ --js_out=import_style=commonjs:src --grpc-web_out=import_style=commonjs,mode=grpcweb:src
JS Code
output
envoy.yaml
The text was updated successfully, but these errors were encountered: