I created a Postgres instance in Fly.io and wanted to connect the database via Pgadmin but receiving error “Unable to connect to server: connection failed: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request”.
I’m deploying with image flyio/postgres-flex:15.3 and have followed this tutorial Fly.io - Postgres - Connecting external to configure public IP for my instance but it’s still not working.
Monitoring also shows the instance is healthy and running.
Not sure if you have since got this working however you may be able to proxy to it using a local port.
Make sure you have the latest Fly CLI (often fixes many problems) then try:
fly proxy 15432:5432 --app your-db-app
You should then be able to connect to the database using the hostname localhost and the port 15432 (as that is the local port) which proxies to the remote 5432.