@shaun after following the above instructions when i ran the below command it gave me an error:
psql "sslmode=require host=<db-app-name>.fly.dev dbname=<db-name> user=<user-name>"
psql: error: connection to server at "<db-app-name>.fly.dev" (<IPv4 address>), port 5432 failed: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
and by running fly info -a <db-app-name>, i get:
App
Name = <db-app-name>
Owner = <owner>
Platform = machines
Hostname = <db-app-name>.fly.dev
Services
PROTOCOL PORTS FORCE HTTPS
TCP 80 => 8080 [HTTP] True
443 => 8080 [TLS,HTTP] False
TCP 5432 => 5432 [PG_TLS] False
IP Addresses
TYPE ADDRESS REGION CREATED AT
v4 <IPv4 address> global 2022-11-21T07:01:30Z
v6 <IPv6 address> global 2022-11-21T07:00:45Z
There’s no reason psql wouldn’t work or at least, it shouldn’t exit with the error you got. Try the psql command again please.
You should at least see:
Password for user <user-name>:
More than one of us are able to connect (but we can’t auth because we don’t have the username / password for you database, that’s fine). We get to the password prompt, which indicates it can connect just fine.
Can you also provide a traceroute to <db-app-name>.fly.dev please?
traceroute to <db-app-name>.fly.dev (<IPv4 Address>), 64 hops max, 52 byte packets
1 10.10.20.1 (10.10.20.1) 3.858 ms 4.684 ms 2.139 ms
2 103.73.101.33 (103.73.101.33) 4.282 ms 19.852 ms 23.075 ms
3 59.103.231.138 (59.103.231.138) 6.216 ms 4.870 ms 4.001 ms
4 10.253.8.18 (10.253.8.18) 4.528 ms 3.726 ms 3.700 ms
5 10.253.4.36 (10.253.4.36) 22.576 ms 23.374 ms 20.874 ms
6 10.253.4.24 (10.253.4.24) 27.661 ms
10.253.4.2 (10.253.4.2) 22.877 ms *
7 * * *