1

dial tcp:5433 timeout on the auth proxy end when trying connect local private IP address of the AlloyDB instance i/o timeout

failed to connect to instance: Dial error: failed to dial (instance URI = "projects/myproject/locations/us-central1/clusters/mycluster/instances/myprimary"): dial tcp 10.205.117.5:5433: i/o timeout

  • Where are you running the proxy from? GCE instance? Cloud shell? Please also post the full command you use to run the proxy. – Gabe Weiss Jul 16 '22 at 21:42
  • - Auth proxy ./alloydb-auth-proxy \\"projects/my-project/locations/us-east4/clusters/my-cluster/instances/my-cluster" \\--credentials-file “credentials.json" Authorizing with Application Default Credentials [\projects/my-project/locations/us-east4/clusters/my-cluster/instances/my-cluster] Listening on 127.0.0.1:5432 The proxy has started successfully and is ready for new connections! accepted connection from 127.0.0.1:55242 Dial error: failed to dial (instance URI = “my-project/us-east4/my-cluster/my-cluster"): dial tcp 10.205.113.2:5433: i/o timeout – Diego Cumbicus Jul 17 '22 at 15:26
  • Alex posted what I suspect is the correct answer. You have quotes around the project URI and it's not needed there. Try without the quotes. – Gabe Weiss Jul 18 '22 at 16:08
  • The error persists, it is not solved. The error is in port 5433 i/o timeout. I have enabled both the outgoing and incoming ports of my instance but I can't connect. Where do I enable this port 5433 – Diego Cumbicus Jul 19 '22 at 01:26
  • Where are you running the auth proxy from? Also, Alex's question from below. If you're running from GCE, is your GCE instance on the same network as the AlloyDB instance? – Gabe Weiss Jul 19 '22 at 03:56
  • I access from my local machine using the credentials and auth proxy doesn't work there, any way to solve it. However when using GCE instance it worked fine. Thanks to all for the help. – Diego Cumbicus Jul 19 '22 at 06:32

2 Answers2

1
./alloydb-auth-proxy projects/<projects_name>/locations/<instance_location>/clusters/<cluster_name>/instances/<instance_name> --credentials-file <path_to_key> --port 5432 --address 0.0.0.0

I was having the same issue, it is because of the " between the uri. now i fix it by running command above

tomerpacific
  • 4,704
  • 13
  • 34
  • 52
Alex chai
  • 21
  • 4
1

From the comments:

The problem is accessing from local won't work. AlloyDB currently doesn't implement a Public IP connection, so the only way to connect to it is from within the same VPC (cloud network) as the AlloyDB cluster itself. That's why connecting from a GCE instance on the same network works while connecting from the local machine does not.

Gabe Weiss
  • 3,134
  • 1
  • 12
  • 15
  • So, the only option as of now, to use alloydb, is to connect through a Compute Engine VM ? – dotslash Aug 05 '22 at 13:21
  • From outside GCP, yes. If you've got services that are running in the same network/VPC as the cluster that works fine to directly connect. So you can do something like use Cloud VPN to connect your local network to the Cloud VPC, but that can get costly, and there's an added latency hit. So it just depends on your requirements. – Gabe Weiss Aug 06 '22 at 02:06