There are a few ways around this, the question didn t show how to use mongod
so I m going to run through how to get a bit more detail on the error. meteor reset
might work but not always & it will clear your apps data if it does work.
The core issue is meteor is very undescriptive when it comes to displaying data, so I would advise to get get a bit more detail on the error as it could literally any mongodb error out there. The steps below should reproduce the error with more verbosity to help diagnose what the root issue is
Find where Meteor installs mongodb
If you have the mongod
tool (downloadable from http://mongodb.com), otherwise use the one installed with meteor. Just be careful you don t get too new a version that upgrades your old database, then meteor s older mongodb won t be able to understand it.
typically (but not always) at
/usr/local/meteor/mongodb/bin/mongod (OS X)
/usr/lib/meteor/mongodb/bin/mongod (Red Hat/Debian)
C:Program FilesMeteormongodbinmongod.exe (Windows via Tom Wijsman s port)
Run Meteor s database manually with mongodb
So we re going to use this to manually run mongodb on your apps mongodb database:
In your projects directory with your terminal app/command prompt
cd .meteor
cd local
/usr/local/meteor/mongodb/bin/mongod --dbpath ./
If your mongod
path is something else use that instead, the above works on OS X.
Analyse the output to find the root cause of the issue
Now mongodb should run and give you a good description of what the problem is, or run smoothly:
Mon Apr 1 23:59:55 [initandlisten] MongoDB starting : pid=84640 port=27017 dbpath=./ 64-bit host=MacBook-Pro.local
Mon Apr 1 23:59:55 [initandlisten]
Mon Apr 1 23:59:55 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
Mon Apr 1 23:59:55 [initandlisten] db version v2.2.1, pdfile version 4.5
Mon Apr 1 23:59:55 [initandlisten] git version: d6764bf8dfe0685521b8bc7b98fd1fab8cfeb5ae
Mon Apr 1 23:59:55 [initandlisten] waiting for connections on port 27017
Have a look at the what the error might be and then tackle the problem displayed. It could be one of many.
Example issue
If it has:
exception in initAndListen: 10310 Unable to lock file: ./mongod.lock. Is a mongod instance already running?, terminating
Then restart your computer to kill any processes that might be using the file and if it still doesn t help use meteor reset
to clear the directory at .meteor/local/db
so your app uses a fresh database.
The errors are very helpful e.g low disk space (clear up the trash ;-)
or cannot write to disk (permissions issue - use chmod/sudo).
Very obscure issues
If you find something very perplexing it might be a mongodb issue more than a meteor one, have a look around for the error you get here on stackoverflow and if you can t find it put a question up and swarms of helpful people are hopefully ready to help :)