You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot initialize server - additional failure case #655
I recently stumbled across this error even though there were no instances of PostgreSQL running on my machine.
But I had left a psql client open. So when I stopped and removed the database it was connected to, and created and initialized a new database in the PostgresApp GUI. I think macOS wouldn't release the port to another application until my psql client was stopped, because once I realized that might be the issue and stopped it, I was able to initialize the database just fine.
I had confirmed that there was nothing running on port 5432 (the port it was complaining about) by checking it with netstat -anvp tcp | awk 'NR<3 || /LISTEN/'. And when that showed that the port was closed, I was confused. It would be nice to have a bit more text in the error message covering this use case as well, especially since Postgres.app is used by non-experts like me. Doesn't have to be much, just something like "Also, check that all PostgreSQL clients have stopped before attempting to initialize the database."
Thank you for this app, it's been great so far besides that speed bump which was entirely my own fault. :)
Can you provide any steps to reproduce this issue? We've talked about this issue a bit, but I really don't see how a PostgreSQL client would bock a port.
The only scenario I can imagine is when you shut down a PostgreSQL server with the "smart" shutdown mode, where it waits for clients to disconnect before shutting down. In that case the error message is accurate (the server is still running), but I'm not sure this would actually block the port.
Activity
jakob commentedon Mar 8, 2022
Can you provide any steps to reproduce this issue? We've talked about this issue a bit, but I really don't see how a PostgreSQL client would bock a port.
The only scenario I can imagine is when you shut down a PostgreSQL server with the "smart" shutdown mode, where it waits for clients to disconnect before shutting down. In that case the error message is accurate (the server is still running), but I'm not sure this would actually block the port.
jakob commentedon Sep 22, 2022
We found out what was causing the issue -- see #676 for details. We fixed it in Postgres.app 2.5.10