Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

GRPC Service on Cloud run

Hi,

I have two services written in Java.

Service A is a grpc Server (Java) and is deployed on cloud run. Ingress control set to All, and  Authentication set to Allow unauthenticated invocations . 

Service B is a rest API service (Java) that serves the client with http api Request. Internal all http requests will talk to the grpc server (Service A) and return the data. This service has similar configurations. ie Ingress Control - set to ALL and Authentication set to Allow unauthenticated invocations

The client is able to call the rest API service from service B , but the serviceB is not able to connect with grpc server (Service A).

After going through a couple of posts, I enabled "Use HTTP/2 end-to-end" from the Networking tab in both the services.

Now the client is not able to call the rest API service from Service B. I am receiving error " 

upstream connect error or disconnect/reset before headers. reset reason: connection termination

How should I proceed now so that the Service B can connect with the Service A(Grpc Server) plus the service B can support http requests for the clients.

Any document / guidelines is highly appreciated.

Thanks in advance

Regards

Srinivasan


GRPC Service on Cloud run

1 4 834
4 REPLIES 4

Just another observation on my side.

The same services Service A and Service B when deployed on a GCE VM instances, they work fine and have no issues. 
So wondering if this is pertaining to cloud run deployments . 

Regards

Srinivasan

Hello @srinimk,

You can do the following troubleshooting options:

  1. Before using HTTP/2, make sure that your Cloud Run service can handle requests in HTTP/2 cleartext (h2c) format. Cloud Run automatically terminates TLS. To confirm that your service supports h2c  requests, use the following cURL command:
    curl -i --http2-prior-knowledge http://localhost: PORT
  2. Take a look at this Stackoverflow post as you might have the same problem. 
  3. If the above options don't work, you can contact Google Cloud Support to further look into your case. Let me know if it helped, thanks!

 

Hi Marramirez,

Thank you for your reply.

Tried the curl command and the response was 

HTTP/2 415 
content-type: text/plain; charset=utf-8
grpc-status: 13
grpc-message: Content-Type is missing from the request

Also, regarding your suggestion of Point 2 stack overflow. Yes I did looked into it earlier and it was not the case.

Regards

Srinivasan

Hi Marramirez,

Thank you for your reply.

Tried the curl command and the response was 

HTTP/2 415 
content-type: text/plain; charset=utf-8
grpc-status: 13
grpc-message: Content-Type is missing from the request

Also, regarding your suggestion of Point 2 stack overflow. Yes I did looked into it earlier and it was not the case.

Regards

Srinivasan

Top Solution Authors