gRPC deployment unexpected HTTP/1

44 Views Asked by At

I'm very new to gRPC and am trying to deploy a gRPC to our infrastructure to see if we can support it. I have deployed this application: https://hub.docker.com/r/grpc/java-example-hostname/tags

When the pod starts, it shows that it is listening to port 50051, then when I try to make an call to the service using this command : docker run fullstorydev/grpcurl testgrpc.{url}:443 list

This causes the application to return this message:

**Mar 15, 2024 4:00:18 PM io.grpc.netty.shaded.io.grpc.netty.NettyServerTransport notifyTerminated
INFO: Transport failed
io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2Exception: Unexpected HTTP/1.x request: POST /grpc.reflection.v1.ServerReflection/ServerReflectionInfo **

Is this an error with my infrastructure not supporting HTTP/2, can I assume that this application is running properly in my infrastructure? I am not sure if I need to deploy a client and a server, or if this image is able to create all what is needed for a functioning gRCP application.

I've also tried to connect to the URL through my browser and this returns a different error:

net/http: HTTP/1.x transport connection broken: malformed HTTP status code "\x00\x00\x00\x04\b\x00\x00\x00\x00\x00\x00\x0f\x00\x01\x00\x00+\a\x00\x00\x00\x00\x00\x7f\xff\xff\xff\x00\x00\x00\x01Unexpected"

I wasn't able to test using postman because I couldn't generate the proto file

Also, when I check the URL with https://tools.keycdn.com/http2-test it says http/2 protocol is supported.

Thank you all so much for any help you are able to offer!!!

1

There are 1 best solutions below

0
tamerturksoy On

I think I ran into the same issue, set up an HTTP/2 endpoint without TLS. It may be necessary to set http2 as the listening protocol in C#. It can be set as follows.

options.ListenLocalhost(*PORT*, listenOptions =>
{
    listenOptions.Protocols = HttpProtocols.Http2;
});