-
Notifications
You must be signed in to change notification settings - Fork 491
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
grpcurl fails with "context deadline exceeded" after 10s if using plaintext when server expects TLS #387
Comments
I doubt that. That's actually how you get any error to bubble up. Otherwise, you never get any sort of feedback from The issue here is where it fails. In The issue here is actually that the connections are setup just fine -- all a plaintext connection cares about is getting the TCP connection. The other direction (using TLS in the client to a server that does not expect it) fails more cleanly because the error does bubble up from dialing because the connections cannot be established because the TLS handshake fails. So the actual error is happening inside the gRPC runtime when it tries to send the HTTP/2 preface to the server. In this case, the server is expecting a TLS handshake, but doesn't receive one. So the server immediately closes the connection. We're providing a A fix is possible, but it isn't simple. The custom dialer in |
The presence of a custom dialer does make things more unique here. In the past, I've just used the default dialer and matched against the returned error message, but I presume the custom dialer must remain as-is for other reasons. |
The custom dialer is actually only here to provide decent error messages. The "context deadline exceeded" error is what is coming from the |
Yeah, sorry, I misspoke -- in the past I've matched against the RPC call error, rather than the dial error, for this situation. Whether an error is from dialing versus calling an RPC has always been confusing to me, and I suspect it's not even something stable across grpc-go versions. |
we often ran into this problem with grpc-go clients, and the newer |
When attempting to use grpcurl to access a service deployed on an EC2 instance through a load balancer and target, using the following command: can anyone help me to resolve this ? |
This answer saved my day, thank you. |
Bottom line up front, here's how you reproduce this issue:
For context,
grpcb.in:9001
wants TLS;-plaintext
is the problem. But the fact that grpcurl hangs for 10 seconds, and does not produce an informative error, is the subject of this GitHub issue. I suspect the issue may be use ofgrpc.WithBlock()
prevents an error from bubbling up, but I assume there's a good reason for the use of that dialopt for some other purpose.The text was updated successfully, but these errors were encountered: