Search code examples
google-cloud-platformgoogle-cloud-sqlcloud-sql-proxy

GCP Cloud SQL Proxy times out: connectex


So I have been using the cloud_sql_proxy for a while now for a local development environment and never had any issues (over a year). I tried to connect today, and it authenticates fine. Yet, connecting to the local port gives a connectex error:

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

  • I authenticate with a service account at a location specified in my environmental variables. I connect with the command cloud_sql_proxy -instances="XXXXX.XXXXX.XXXXX"=tcp:5432
  • Windows 10
  • The Cloud SQL instance works fine and communicates (over a similar proxy) with the production server.
  • I tried connecting with Django, get connectex error.
  • I tried to ping the local network, get connectex error.
  • I tried adding a firewall rule that allows all outbound traffic to port 3307

Any ideas what could've broken my proxy?


Solution

  • If the connection to the Cloud SQL proxy times out, it means the connection to the proxy itself didn't work. That means either the proxy is not listening, or that something it blocking the connection.

    I would suggest looking in the proxy logs to see if it reports any start up errors.