Skip to content

Cannot initialize server - additional failure case #655

Closed

Description

@blag

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. :)

Activity

  1. jakob commented on Mar 8, 2022

    @jakob
    Member

    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.

  2. jakob commented on Sep 22, 2022

    @jakob
    Member

    We found out what was causing the issue -- see #676 for details. We fixed it in Postgres.app 2.5.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions