skip to Main Content

When trying to start postgresql

➜  ~ brew services start postgresql
Warning: Use postgresql@14 instead of deprecated postgresql
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/josh/Library/LaunchAgents/[email protected]` exited with 5.

Getting "error" as status when running brew services list

➜  ~ brew services list
Name          Status     User File
postgresql@14 error  256 root ~/Library/LaunchAgents/[email protected]

PSQL was working perfectly fine, shut down my laptop (did not update) and when I turned it on the next day psql was not working. I am on OSX Version 12.6 (Monteray).

4

Answers


  1. Had the same error today 🤓 on my Mac Ventura 13.0. Did these steps and it helped.

    1. Run rm /usr/local/var/postgresql@{YOUR_VERSION}/postmaster.pid to remove postmaster.pid file. this is usually caused by an error in the postmaster.pid file.
    2. Run brew services stop postgresql to stop the current postgresql service.
    3. Then finally run brew services start postgresql, a new postmaster.pid file will be generated.

    If this doesn’t work you can run brew doctor and see if it will return Your system is ready to brew. If there are warnings 🥶, you can share them here with the community for more details.?

    Login or Signup to reply.
  2. I had the same issue on 13.0 on M1 pro, all is did was brew services restart postgresql@14, it shut down, restarted and ran fine, issue gone.

    Login or Signup to reply.
  3. Had the same issue, but couldn’t get Postgres 14 working, and ended up just upgrading to Postgres 15, which I did get to work.

    The steps looked like this (version numbers might vary)

    brew services stop postgresql@14
    brew install postgresql@15
    # This command will copy data over to the new database
    brew /opt/homebrew/Cellar/postgresql@15/15.1/bin/pg_upgrade -b /opt/homebrew/Cellar/postgresql@14/14.6/bin/ -d /opt/homebrew/var/postgres/ -D /opt/homebrew/var/postgresql@15/
    brew services start postgresql@15
    
    Login or Signup to reply.
  4. In my case, I had postgresql@13 and postgresql@14 install with brew on Ventura 13.1

    I first removed postgresql@13 and all data within :

    brew remove postgresql@13 and rm -rf /usr/local/var/postgresql@13

    This assure me that the previous folder is fully remove, however, I did not care about my local data … you may want to take care of it before doing this

    After that, I reinstall postgresql@14 within the following commands :

    # Remove postgresql 14 with brew 
    brew remove postgresql@14
    
    # Reinstall postgresql 14 with brew
    brew install postgresql@14
    
    # Remove all the files in the db folder
    rf -rf /usr/local/var/postgresql@14/*
    
    # Kill all process that run any db of the postgresql 14 folder 
    pkill -f /usr/local/var/postgresql@14   
       
    # Initialize the db folder for postgresql 14 
    initdb --locale=C -E UTF-8 /usr/local/var/postgresql@14
    
    # Restart postgresql with brew (should say that it's already running) 
    brew services start postgresql@14
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search