0

I made an .NET 6.0 app that makes grpc requests. It works perfectly fine on my machine, but doesn't work on another. I get this error in logs:

Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: Requesting HTTP version 2.0 with version policy RequestVersionOrHigher while unable to establish HTTP/2 connection.", DebugException="System.Net.Http.HttpRequestException: Requesting HTTP version 2.0 with version policy RequestVersionOrHigher while unable to establish HTTP/2 connection.

Is it some weird local network stuff or some .NET issue on that computer or what?

How to check if HTTP 2.0 works in that environment?

  • Do you have network appliances such as firewalls, load balancers, routers etc between your client and your server? If so, you'll need to make sure all of those support HTTP 2.0. How you do that varies from vendor to vendor and model to model. – mason Aug 03 '22 at 17:21
  • @mason there might be. Unfrotunatly the target computer is beyond my influence. Thats why I am asking for a way to check if HTTP 2.0 works in that environment. – Matthew Kruglikov Aug 03 '22 at 17:37
  • Did you check [this question](https://stackoverflow.com/questions/66500195/net-5-grpc-client-call-throws-exception-requesting-http-version-2-0-with-versi)? – mason Aug 03 '22 at 17:41
  • Maybe try http://www.http2demo.io/ or https://http2.akamai.com/demo – Charlieface Aug 03 '22 at 17:44
  • @mason yes I've seen the soltution, but I want to be sure that that is the case before changing my app. And there is no way of checking http provided – Matthew Kruglikov Aug 03 '22 at 17:49
  • @Charlieface thanks. So those wont work if the client network is unable doing HTTP 2, right? – Matthew Kruglikov Aug 03 '22 at 17:51
  • So it would seem – Charlieface Aug 03 '22 at 17:51
  • @MatthewKruglikov Don't avoid changing the app....change the app, see if that resolves it. If it does, great. If not, undo it. Trying things is how you narrow down the problem. – mason Aug 03 '22 at 17:54
  • Try searching google for the error message "Requesting HTTP version 2.0 with version policy RequestVersionOrHigher while HTTP/2 is not enabled", it might give you useful tips. I got e.g. https://stackoverflow.com/questions/66500195/net-5-grpc-client-call-throws-exception-requesting-http-version-2-0-with-versi – Jan Tattermusch Aug 16 '22 at 13:13
  • @JanTattermusch I've done that and I've read that before posting this question. You haven't read the whole discussion and the question itself. But thank you for effort. – Matthew Kruglikov Aug 17 '22 at 14:10

2 Answers2

0

Finally found that it hadn't been working, 'cuz target machine had windows 7. Updating to 10 fixed the problem.

  • 1
    Good decision; and if you _really_ need to support Windows 7 until it finally completely goes out of support in 2023, you can still use the Grpc.Core packages. There was another similar question/problem to this here on SO mentioning this in an answer but I can no longer find it. – Ray Aug 17 '22 at 17:22
0

Not sure if this fixes the issue in all situations, but I have been trying to make Google.Cloud.Speech.V1 work after updating, and this fixed it, in case someone gets here through the same issue ‒ somewhere you probably create a SpeechClient:

var speechClient = new SpeechClientBuilder
{
    ...
}.Build();

All it needs is one line:

var speechClient = new SpeechClientBuilder
{
    GrpcAdapter = Google.Api.Gax.Grpc.GrpcCoreAdapter.Instance,
    ...
}.Build();
IS4
  • 11,945
  • 2
  • 47
  • 86