Until recently I've been using the AlloyDB proxy as described in the documentation to connect to my AlloyDB instance using DBeaver from my local machine with no issues.
A few days ago however I started to get a "The connection attempt failed" message in DBeaver. Looking at the proxy logs I see the following:
name@mac alloydb_auth_proxy % ./alloydb-auth-proxy projects/<project-id>/locations/<location>/clusters/<cluster-name>/instances/<instance> --public-ip
2025/03/05 16:50:14 Authorizing with Application Default Credentials
2025/03/05 16:50:14 [<project>.<cluster-name>.<instance>] Listening on 127.0.0.1:5432
2025/03/05 16:50:14 The proxy has started successfully and is ready for new connections!
2025/03/05 16:52:14 [<project>.<cluster-name>.<instance>] accepted connection from 127.0.0.1:49738
2025/03/05 16:52:44 [<project>.<cluster-name>.<instance>] failed to connect to instance: Dial error: failed to dial (instance URI = "<project>/<location>/<cluster-name>/<instance>"): dial tcp <instance public IP>:5433: i/o timeout
The public IP is correct, but for some reason it seems to be trying to connect to the 5433 port when it should be using 5432. I've confirmed the DB connection information is correct as I can connect from a deployed container. I've tried reinstalling the proxy, re-authenticating, and restarting with no success.
Any help would be appreciated.
In case it's relevant I'm on a Mac running Sequoia 15.3.1.
Until recently I've been using the AlloyDB proxy as described in the documentation to connect to my AlloyDB instance using DBeaver from my local machine with no issues.
A few days ago however I started to get a "The connection attempt failed" message in DBeaver. Looking at the proxy logs I see the following:
name@mac alloydb_auth_proxy % ./alloydb-auth-proxy projects/<project-id>/locations/<location>/clusters/<cluster-name>/instances/<instance> --public-ip
2025/03/05 16:50:14 Authorizing with Application Default Credentials
2025/03/05 16:50:14 [<project>.<cluster-name>.<instance>] Listening on 127.0.0.1:5432
2025/03/05 16:50:14 The proxy has started successfully and is ready for new connections!
2025/03/05 16:52:14 [<project>.<cluster-name>.<instance>] accepted connection from 127.0.0.1:49738
2025/03/05 16:52:44 [<project>.<cluster-name>.<instance>] failed to connect to instance: Dial error: failed to dial (instance URI = "<project>/<location>/<cluster-name>/<instance>"): dial tcp <instance public IP>:5433: i/o timeout
The public IP is correct, but for some reason it seems to be trying to connect to the 5433 port when it should be using 5432. I've confirmed the DB connection information is correct as I can connect from a deployed container. I've tried reinstalling the proxy, re-authenticating, and restarting with no success.
Any help would be appreciated.
In case it's relevant I'm on a Mac running Sequoia 15.3.1.
I agree with Puteri. As also stated here in this documentation that’s expected.
AlloyDB instances accept connections on two TCP ports:
Port 5432, the default PostgreSQL port that applications use to connect directly to the instance.
Port 5433, which connectors, including AlloyDB Auth Proxy use to connect to the instance.
If you have an outbound firewall policy, make sure it allows connections to port 5433 on the target AlloyDB instance.