`nc: connect to db.internal port 5432 (tcp) failed: Connection refused`, yet PostgreSQL is running.
BeginnerTroubleshootingConnectivity: refused, timed out, no route
Answer
Likely causes → listen_addresses = 'localhost' in postgresql.conf, Postgres listening on a different port, or you resolved to a different host than you think.
Diagnose →
sudo ss -ltnp | grep postgres
sudo -u postgres psql -c 'show listen_addresses; show port;'
getent hosts db.internal
Fix → Set listen_addresses = '*' (or the private IP), restart, then allow the client in pg_hba.conf. Note that a pg_hba.conf miss gives no pg_hba.conf entry for host, not "refused".
Prevent → Template DB configs and verify from an app host after every change.
More on Connectivity: refused, timed out, no route
`curl: (7) Failed to connect to 10.0.2.15 port 8080: Connection refused`Beginner`curl: (28) Failed to connect to api.internal port 443 after 130001 ms: Connection timed out`Beginner`ssh: connect to host 10.1.4.20 port 22: No route to host`BeginnerService works with `curl localhost:3000` on the box but times out from other hosts.Beginner`ping` works but `curl` to port 80 on the same host times out.Beginner`curl` to a public site works, but `ping 8.8.8.8` shows 100% packet loss.Beginner