5

I have Node.js grpc server and Node.js grpc client. My grpc server is insecure server, and I already tested my grpc server using my client in local.

But I deployed to kube using nginx ingress controller and network load balancer then I got error.

{
  "error": "14 UNAVAILABLE: Trying to connect an http1.x server"
}

The odd thing is when I using grpcurl, then I could get success result.

I am using this script.

$ grpcurl -insecure -proto my.proto grpc.example.com my.grpc.package/service

Is it problem because of my server? Or my client is incorrect?

ㄴㅇㅇ
  • 67
  • 2
  • 4
  • 8
  • 1
    "Trying to connect an http1.x server" would be because the server responds with an HTTP/1 protocol response, which grpc clients don't support. There is a gRPC core library test that illustrates how this error intended to happen in such a case: https://github.com/grpc/grpc/blob/5a419c65b02b069f4c92623678743a3ddddc53cb/test/core/end2end/bad_server_response_test.cc#L345. – apolcyn Jan 15 '20 at 19:07
  • Are both grpccurl and the grpc.js client going to the same endpoint? – apolcyn Jan 15 '20 at 19:08

1 Answers1

5

Usually that msg is result of using the wrong port.

In my case the service was :

NAME           TYPE         CLUSTER-IP   EXTERNAL-IP   PORT(S)             AGE

foo-name      ClusterIP     10.0.8.132   <none>        5556/TCP,5557/TCP   123d

I was forwarding my port to 5556 and I got the same error msg.

I changed my port to forward from 5557 and it worked fine.

Rabhi salim
  • 486
  • 5
  • 17