My app seems to be able to connect for the most part, but I’ve been unable to get manually connected to my postgres instance lately, and am stumped.
Here’s a few things I’ve tried:
fly postgres connect
Connecting to [ipaddress removed]... complete
psql: error: connection to server at "[dbapp removed].internal" ([ipaddress removed]), port 5432 failed: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
- Running
fly ssh console
, and then psql, gives the error
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
-
proxying the port and connecting using intellij ultimate (I’ve done this in the past and just used the saved configuration)
-
When running fly
postgres config view
, I getError 500: context deadline exceeded.
The fly status for the app also shows the app as readonly which is curious.
Instances
ID PROCESS VERSION REGION DESIRED STATUS HEALTH CHECKS RESTARTS CREATED
7e31e93a app 18 dfw run running (readonly) 3 total, 1 passing, 2 critical 0 1m27s ago
Any ideas?
edit: Restarting I see this in the console
2022-12-08T22:10:06.873 app[19b4912f] dfw [info] exporter | ERRO[0013] Error opening connection to database (postgresql://flypgadmin:PASSWORD_REMOVED@[ip removed]:5433/postgres?sslmode=disable): dial tcp [ip removed]:5433: connect: connection refused source="postgres_exporter.go:1658"