Postgres connection via Wireguard + TablePlus error: could not translate host name

I was having an issue that is similar to the one posted recently and fixed by @jerome - Postgres connection issue: host was not found in DNS

Unfortunately the thread is now closed so I’m reopening this one instead.

The error I’m getting in TablePlus is:

could not translate host name "club-db.internal" to address: nodename nor servname provided, or not known

The connection was working fine just earlier today.

1 Like

This is getting worse now since the app no longer able to resolve the DNS as well so the site is completely down.

Restarting the pg instance returns an error:

$ fly pg restart -a club-db
Error: no active leader found

Ping fails too:

$ fly ping club-db.internal
Error: look up club-db.internal: lookup club-db.internal on [fdaa:0:3f24::3]:53: no such host

Managed to resolve this by restarting the machine with:

fly machine restart <id> -a club-db

Still baffled how this is happening quite randomly but I’m glad at least the solution worked.

Hey, glad you sorted it out! For context, it looks like your app is running on a shared-cpu-1x single node cluster. Apps running single instances automatically shut down if there are no open connections in the last hour and usually starts up again if something tries to connect to it.

There’s a chance that there might be be a setting in the machine running the postgres app that’s disabling autostart. You can try making the postgres app start up on its own by running a machine update and setting the autostart flag to true → fly machines update <machine_id> --autostart=true --app <app_name>

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.