Unable to run Cloud Run locally (using Docker) | C2C Community
Question

Unable to run Cloud Run locally (using Docker)

  • 22 January 2024
  • 3 replies
  • 27 views

Userlevel 1
Badge +2

Hello,

I am trying to use Cloud Code to run a Cloud Run container locally, but it is failing with the following error:

 - deployment/dorothy-backend: container cloud-sql-proxy is waiting to start: gcr.io/cloudsql-docker/gce-proxy:1.16 can't be pulled
- pod/dorothy-backend-b4bd74bdc-rjglt: container cloud-sql-proxy is waiting to start: gcr.io/cloudsql-docker/gce-proxy:1.16 can't be pulled
- deployment/dorothy-backend failed. Error: container cloud-sql-proxy is waiting to start: gcr.io/cloudsql-docker/gce-proxy:1.16 can't be pulled.

Does anyone have any thoughts? I’m not explicitly trying to build the Cloud SQL container in my Dockerfile, but I do have the connected Cloud SQL instance listed as a `cloudSqlInstances` in the `launch.json` file.


3 replies

Userlevel 7
Badge +15

@davidressler 

The machine you are trying to run it has access to the internet?

Userlevel 7
Badge +35

Hello @davidressler,

Thank you for joining C2C. The error message indicates that Docker is trying to pull the image gcr.io/cloudsql-docker/gce-proxy:1.16 from the Google Container Registry (GCR) but is unable to do so. There could be several reasons for this:

Network issues:

Firewall: Make sure your firewall is not blocking access to the GCR. You can verify this by trying to access the image via the gcloud container images describe gcr.io/cloudsql-docker/gce-proxy:1.16 command. If it fails with a network error, your firewall might be the culprit.


DNS:

Check if your DNS server can resolve the hostname gcr.io. If not, update your DNS settings to point to a valid DNS server.


Authentication issues:

Credentials: Make sure you are authenticated with the correct Google Cloud account that has access to the GCR. You can verify this by running gcloud auth list and checking if the listed account has access to the cloudsql-docker project.


Tokens:

Your access token might be expired. Try running gcloud auth revoke https://gcr.io to revoke any existing tokens and then gcloud auth login to log in again.


Image issues:

Image availability: Your requested image might not be publicly available anymore. You can check the Cloud SQL documentation for information on available proxy images and versions.
Image name typo: Double-check the image name for any typos or inaccuracies.

Also, you can check the following link for the further troubleshooting.

https://docs.docker.com/desktop/troubleshoot/topics/

https://cloud.google.com/sql/docs/sqlserver/connect-docker


https://docs.docker.com/engine/reference/commandline/pull/

Google Cloud SQL Docker Proxy documentation:

https://cloud.google.com/sql/docs/mysql


https://cloud.google.com/contact

 

Userlevel 1
Badge +2

Hello @davidressler,

Thank you for joining C2C. The error message indicates that Docker is trying to pull the image gcr.io/cloudsql-docker/gce-proxy:1.16 from the Google Container Registry (GCR) but is unable to do so. There could be several reasons for this:

Network issues:

Firewall: Make sure your firewall is not blocking access to the GCR. You can verify this by trying to access the image via the gcloud container images describe gcr.io/cloudsql-docker/gce-proxy:1.16 command. If it fails with a network error, your firewall might be the culprit.


DNS:

Check if your DNS server can resolve the hostname gcr.io. If not, update your DNS settings to point to a valid DNS server.


Authentication issues:

Credentials: Make sure you are authenticated with the correct Google Cloud account that has access to the GCR. You can verify this by running gcloud auth list and checking if the listed account has access to the cloudsql-docker project.


Tokens:

Your access token might be expired. Try running gcloud auth revoke https://gcr.io to revoke any existing tokens and then gcloud auth login to log in again.


Image issues:

Image availability: Your requested image might not be publicly available anymore. You can check the Cloud SQL documentation for information on available proxy images and versions.
Image name typo: Double-check the image name for any typos or inaccuracies.

Also, you can check the following link for the further troubleshooting.

https://docs.docker.com/desktop/troubleshoot/topics/

https://cloud.google.com/sql/docs/sqlserver/connect-docker


https://docs.docker.com/engine/reference/commandline/pull/

Google Cloud SQL Docker Proxy documentation:

https://cloud.google.com/sql/docs/mysql


https://cloud.google.com/contact

 

This seemed to work! Or at least introduce a new error: 

```

Error retrieving logs for pod ...: exit status 1.

```

 

And the errors are as following:

```

E0123 12:42:31.919820   41536 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refusedE0123 12:42:31.921948   41536 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refusedE0123 12:42:31.923305   41536 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refusedE0123 12:42:31.923788   41536 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refusedThe connection to the server localhost:8080 was refused - did you specify the right host or port?

```

Reply