-
Notifications
You must be signed in to change notification settings - Fork 772
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
incomplete response when using mode=grpcwebtext #951
Comments
Can you give us more information please? There is not enough information to go on. |
I'm facing the same issue. I get an error in the response {code: 2, message: 'Incomplete response'}
master_process off;
daemon off;
worker_processes 1;
pid nginx.pid;
error_log stderr info;
env GRPC_VERBOSITY=DEBUG;
error_log /dev/stdout info;
events {
worker_connections 1024;
}
http {
access_log /dev/stdout;
client_max_body_size 0;
client_body_temp_path client_body_temp;
proxy_temp_path proxy_temp;
proxy_request_buffering off;
server {
listen 8080;
listen 8443 http2;
server_name localhost;
location / {
grpc_pass host.docker.internal:9090;
}
}
} I have added a line to print the incoming request to the method handler in the function doSayHello(call, callback) {
callback(null, {
message: 'Hello ! ' + call.request.name
});
console.log("Request: ", call.request)
} I see that there is no name in the request when the request is being logged. And, there are no errors on the server. It makes sense because if there was no name sent, then the server should just say hello without a name. ❯ node server.js
Request: { name: '' } The Chrome Dev tools shows that a payload is being sent for the request and I'm not sure if the payload contains a name, and a 200 status code is received, with a I used the gRPC Web Dev tools chrome extension, found here https://github.com/SafetyCulture/grpc-web-devtools and I see that the NoteAfter coming across this issue, I tried using |
With our case it happens even if I have our protos compiled as We can confirm however, that the message should be there, as other clients in more appropriate languages & stacks can understand the receive error; only js has problems ¯_(ツ)_/¯ |
@stanley-cheung I can grant you access to our stuff and guide you around if you'd need a repro-environment. This is how we do the rejection in the swift server for example (dumb down version of-course): func deAuthenticate(request: _21gram_Authentication_Token, context: StatusOnlyCallContext) -> EventLoopFuture<Google_Protobuf_Empty> {
let status = GRPCStatus(code: .permissionDenied, message: "Pay up buttercup.")
context.responseStatus = status
return context.eventLoop.makeFailedFuture(status)
} |
Would help if there's a simple reproducible test case that I can clone, launch a docker image or something and reproduce the error. Or is there a special situation that triggers this? |
@stanley-cheung I don't know if it's special or not; I don't think so. It shouldn't be. You know what? I'll look into creating such a package later today (GMT+1) and ping you once it's done. |
I'm also facing the same issue. I am able to query my APIs using BloomRPC with the web toggle on, and targetting the envoy port, but when querying them from the web client, I get Both client and server are using typescript exports, in case that matters. Server dependencies:
Proto generated using:
Client dependencies:
|
Okay seems like I was able to fix my issue. In case anyone is experiencing something similar, make sure you do specify the HTTP protocol in your client: // Works
const client = new VideoClient('http://localhost:9000');
// Doesn't work
const client = new VideoClient('localhost:9000'); Would it make sense to add some assertion to the constructor to avoid these kinds of issues? |
I'm facing the same issue. Running grpc-web 1.2.1 against an Istio 1.7.6 ingress gateway. In my case I create the clients without hostname: const client = new BookingServicePromiseClient('') The problem occurs in Safari 14.0.1. |
+1 here, facing the same issues with |
I can solve the issue |
Specifying |
I'm in the same boat, @LukeLaScala. Did you find any resolution? |
I was able to solve this with
Note, the exact behavior is that any generated client calls to
The call, above, for instance, would return a Promise but it would never resolve or eventually resolve an error that looks like: We are generating client code with
|
Im having the same issue as above, i have tried, both |
I faced the same issue, |
In case you see
This worked well for me using See the example configuration for Envoy: grpc-web/net/grpc/gateway/examples/echo/envoy.yaml Lines 30 to 36 in 6d1ee0d
cc @GoncaloHit |
Adding to my Envoy proxy
actually solved the issue for me, thanks a lot |
When using mode=grpcwebtext for client configuration, responses are giving an error:
{code: StatusCode.UNKNOWN, message: 'Incomplete response'}
The response is received by the client, but is truncated (e.g. string should be 'hello world' but is 'hello'). This error does not occur when using mode=grpcweb. I'm unsure if additional configuration is needed to use grpcwebtext, but following the grpc-web examples it does not seem like it.
It looks like this may be related to #903 and issue #881
The text was updated successfully, but these errors were encountered: