Search code examples
mongodbmeteor

Unexpected mongo exit code 48 - restarting in Meteor


I cannot start my Meteor app using the meteor command. I have tried almost all Meteor reset but all in vain, but I have manged to run the Meteor project on different ports, but my mongodb instance must be working.

I have tried running Meteor:

Unexpected mongo exit code 48. Restarting.    
Unexpected mongo exit code 48. Restarting.    
Unexpected mongo exit code 48. Restarting.    
Can't start Mongo server.                     
MongoDB exited because its port was closed, or was already
taken by a previous instance of MongoDB

Check for other processes listening on port 3001
or other Meteor instances running in the same project.

Solution

  • Starting meteor on a different port is a quick and easy workaround. In my case, I had not instructed any app to run on port 3001, thus via this command, I learned what the culprit was:

    sudo lsof -i :3001
    COMMAND    PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
    .ruby.bin 2529 daemon   12u  IPv4  22408      0t0  TCP localhost:3001 (LISTEN)
    

    Simply kill the ruby server if you want, or simply run your meteor app on a new port.