0

I currently have a gRPC server running on a google cloud run instance that built and deployed successfully. When I run and connect my client to it locally, it works fine. However, when I deploy it to google cloud run and attempt to connect to the resulting URL it gives me an InactiveRpcError and a "DNS Resolution failed for service" report. Nothing appears wrong on the google cloud console, but none of the requests are showing up either. What is happening here?

jazaniac
  • 145
  • 1
  • 12
  • Edit your question and show how you are calling/connecting to that endpoint that is reporting the errors. You might be specifying the URL incorrectly. If possible use grpcurl to show the client connection and errors: https://github.com/fullstorydev/grpcurl – John Hanley Mar 02 '21 at 01:18
  • Please note that you have to remove the https:// prefix from the Cloud Run service URL and use the 443 port instead of 8080. Please let me know if after connecting as mentioned before, you still face the same issue. – Nibrass H Mar 02 '21 at 11:34

1 Answers1

1

If you are connecting from a secure channel to your GRPC server, you will need to specify the Cloud Run service URL without https://and by specifying the port 443 as following:

with grpc.secure_channel(
        '<app-url>-uc.a.run.app:443',
        grpc.ssl_channel_credentials(),
) as channel:
    stub = my_service_pb2_grpc.MyServiceStub(channel)
    request = my_service_pb2.MyEndpointRequest(
        test='hello'
    )
    response = stub.MyEndpoint(request)
    print(response)
Nibrass H
  • 2,403
  • 1
  • 8
  • 14