Looking for an experienced GCP developer to help troubleshoot a Python-based Cloud Run service that times out when attempting to connect to a Cloud SQL (MySQL) instance using the google-cloud-sql-connector.
Environment Details – Both the Cloud Run service and Cloud SQL instance are located in northamerica-northeast2 and the Cloud SQL instance is using a Public IP
Issue: The connection code works flawlessly when run from Google Colab, but it hangs at the connector.connect() step when deployed to Cloud Run (or as a Cloud Function).
Troubleshooting Done:
1. IAM roles verified (Cloud SQL Client assigned)
2. Cloud SQL Admin API is enabled
3. Correct DB credentials and instance connection name confirmed
4. Authorized Networks set to 0.0.0.0/0 for testing
5. Increased CPU, memory, and timeout settings for the Cloud Run service
6. Tried refresh_strategy=”lazy” with the connector
7. Ensured all dependencies are up to date (google-cloud-sql-connector[pymysql], SQLAlchemy)
8. Deployed a minimal example (still hangs at the same step)
I need someone who can jump in quickly and walk through the setup with me to identify what’s going wrong. I suspect it may be a simple configuration or networking issue that I’m overlooking.