2

Preface

I've just finished the Getting Started with Endpoints for Cloud Run tutorial for the second time. When I first tried running this tutorial with my own Cloud Run app, I got either a 413 Request too large or 504 Upstream request timeout error. Thinking that I may have taken too large a leap trying to deploy Endpoints on my Cloud Run service, I started the tutorial over using only the tutorial code, i.e., creating a Cloud Run service with the Cloud Run quickstart and using the given YAML in the Endpoints tutorial. Unfortunately, again, after running through all the commands, enabling services, and deploying Endpoints, I get either 413 Request too large or 504 Upstream request timeout.

Issue

Following the Getting Started with Endpoints for Cloud Run, I get either a 413 Request too large or 504 Upstream request timeout error. I feel like I must be missing something major, as I can't find any other comments or documentation on this issue. Has anyone run into this issue before or does anyone have advice as to how I can debug the issue?

What I've Tried So Far

Beyond restarting the tutorial with the Cloud Run tutorial image, I've looked at the logs and seen that one request creates many error logs within milliseconds of each other. To be clear, the Cloud Run service is functioning, as I've tested both my own and Google's service without the Endpoints layer. I didn't have any issues accessing the services then.

Let me know what else I can provide, and thanks in advance for any help.

JRagone
  • 60
  • 1
  • 11
  • I'm trying to reproduce your issue, did you use the [image indicated in the tutorial](https://cloud.google.com/run/docs/quickstarts/prebuilt-deploy) or a custom one? If so, could you include the Dockerfile or git example? – Juancki Aug 04 '20 at 08:03

1 Answers1

1

I was able to reproduce your issue.

In order to work with Cloud Endpoints with Cloud Run you need at least two services deployed:

  1. Your destination service (hello), a dummy service can be created from the Quickstart.
  2. The endpoint service (gateway), which will be the one redirecting the requests.

In this case you probably had HOST to wrongly be gateway-HASH-uc.a.run.app:

...
host: HOST
...
x-google-backend:
  address: https://gateway-HASH-uc.a.run.app

The Host is the 2nd service, and the x-google-backend is the 1st service.

To fix the issue you have to deploy another service and redo the tutorial.

Juancki
  • 1,793
  • 1
  • 14
  • 21
  • 1
    This is exactly right! I misunderstood and pointed the backend service address to the proxy. I'll also add here the [thread](https://groups.google.com/g/google-cloud-endpoints/c/xsrSkpCRmII) I opened in the Google Cloud Endpoints Group regarding this. I meant to answer this question today, but I think you beat me to it by timezones Sorry if this took a while to figure out, but this is a great answer that perfectly explains what I missed in my own understanding! – JRagone Aug 04 '20 at 14:35