cloud-sql-proxy icon indicating copy to clipboard operation
cloud-sql-proxy copied to clipboard

Proxy with only private ip

Open elonyavist opened this issue 6 months ago • 3 comments

Question

Hi and thanks for your tool.

I'd like to receive an answer regarding my "issue". I configured a Cloud Sql instance (mysql 8.4.4) with a private IP.

Using this command from my local machine:

./cloud-sql-proxy -p 3306 xxxprojectxxx:europe-west6:xxxinstancexxx --private-ip

I receive correctly:

2025/04/26 18:06:26 Authorizing with Application Default Credentials

2025/04/26 18:06:26 [xxxprojectxxx:europe-west6:xxxinstancexxx] Listening on 127.0.0.1:3306

2025/04/26 18:06:26 The proxy has started successfully and is ready for new connections!

But when I try to connect to the instance I receive:

2025/04/26 18:07:35 [xxxprojectxxx:europe-west6:xxxinstancexxx] Accepted connection from 127.0.0.1:55431

2025/04/26 18:08:05 [xxxprojectxxx:europe-west6:xxxinstancexxx] failed to connect to instance: Dial error: failed to dial (connection name = "xxxprojectxxx:europe-west6:xxxinstancexxx"): dial tcp xxx.xx.xx.x:3307: i/o timeout

Do you know if there is an issue with the proxy or maybe I'm missing something?

It is a little bit strange that I see port xxx.xx.xx.x:3307 since my Cloud Sql instance is running on 3306.

NB: If I activate the public IP it works without issue.

Cloud Sql Proxy versione: cloud-sql-proxy version 2.15.2+darwin.arm64

Thanks in advance.

Code


Additional Details

No response

elonyavist avatar Apr 26 '25 17:04 elonyavist