-
Notifications
You must be signed in to change notification settings - Fork 768
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.Net >= 2.44.0 does not pick up HTTPS_PROXY environment variable #1832
Comments
@odin568 Try replacing TestGrpcNetClient(
GrpcChannel.ForAddress("https://pubsub.googleapis.com",
new GrpcChannelOptions { HttpHandler = new SocketsHttpHandler() }),
"GrpcNetClient_SocketHttpHandler"); Using We'll look into whether there is a way to make this work with |
@jtattermusch as FYI @odin568 I'm taking the liberty to reply here as I know you are out on vacation. @rafikiassumani-msft We tried that in googleapis/google-cloud-dotnet#8834 (comment) and it does work. The problem is that @odin568 is not using Grpc.Net.Client directly, but throught the Google .NET client libraries which are the ones relying on Grpc.Net.Client. In Google .NET client libraries we offer a way to configure the underlying GrpcChannel, but now we would be asking users to bypass Google .NET client libraries defaults so they can bypass Grpc.Net.Client defaults, and that seems a bit too much for something that in the end is a regression from Grcp.Net.Client 2.43.0 to Grcp.Net.Client 2.44.0. And similar will happen for anyone building libraries on top of Grpc.Net.Client. Maybe a quick fix, at least to get the default channel working, would be to use grpc-dotnet/src/Shared/HttpHandlerFactory.cs Lines 27 to 38 in a3717a3
Note that regardless, there would still be an issue with |
@rafikiassumani-msft @JamesNK do we know what causing the |
Thanks all for investigation and fixes. Glad issue was found even though it is a special case hard to reproduce in different environmnents. |
What version of gRPC and what language are you using?
Issue detected initally with 2.46.0 but started with 2.44.0. Behavior was fine until 2.43.0 (tested from 2.38.0 on)
What operating system (Linux, Windows,...) and version?
Linux container - original Microsoft ASP.NET runtime container (latest)
What runtime / compiler are you using (e.g. .NET Core SDK version
dotnet --info
)What did you do?
Issue came up when I upgraded Google.Cloud.PubSub.V1 from 2.10.0 to 3.0.0.
This came with a change to replace the default Grpc.Core implementation with Grpc.Net.
Thereby I first got connection issues as the
grpc_proxy
environment variable is of course not used anymore.I then changed it to
HTTPS_PROXY
(andHTTP_PROXY
) and expected it to work but anyhow it was just stuck/hanging until the task was forcably canceled.I then found a related issue in the google-cloud-dotnet repository here: googleapis/google-cloud-dotnet#8834
The discussions here are quite lengthy as we tried out many many variants until we came to the point to see that the issue seems to be in Grpc.Net and that the environment variable was properly taken into account until 2.43.0 and ignored with 2.44.0 on.
Interestingly, folks at the google repo were not able to reproduce it, it worked on their side but there is somebody else reporting the same problem. So it seems to be a special case in some configuration - where we don't know the original reason for it.
Our testcode was mainly this at the end:
What did you expect to see?
With the above code, I would like to see that the code returns with the failure that this method/service of course does not exist instantly more or less.
What did you see instead?
Instead it "hangs" with 2.44.0 onwards as it does not take the proxy into consideration specified by environment variable.
For details see the linked ticket googleapis/google-cloud-dotnet#8834
I am also happy to continue support here, just need to tell that I am off for vacation later on until 22nd of August.
I hope the so far specified information help already, otherwise, please don't close this issue and I will provide more information that you need after that time. Thank you very much!
Anything else we should know about your project / environment?
I run application in k8s environment in corporate environment which requires proxy to reach internet.
The text was updated successfully, but these errors were encountered: