Mongodb failing on Debian
debian, mongodb
Solution
If you don't find any traces in the logs:
tail -f -n50 /var/log/mongodb/mongodb.log
you should try to start the server in foreground:
sudo -u mongodb mongod --dbpath /var/lib/mongodb/
and see what's happening. For instance, I had a locale problem.
Problem
I'm building a MongoDB VM and just cannot get it too work. The output is as follows: ``` After this operation, 0 B of additional disk space will be used. Do you want to continue [Y/n]? y [master 462b01d] saving uncommitted changes in /etc prior to apt run Author: root <root@mongo> 1 files changed, 5 insertions(+), 5 deletions(-) Setting up mongodb-10gen (2.4.5) ... Starting database: mongodb failed! invoke-rc.d: initscript mongodb, action "start" failed. dpkg: error processing mongodb-10gen (--configure): subprocess installed post-installation script returned error exit status 1 configured to not write apport reports Errors were encountered while processing: mongodb-10gen E: Sub-process /usr/bin/dpkg returned an error code (1) root@mongo:~# ``` I've been following the official install instructions from the mongodb website. I found this patch fix but this doesn't fix the error either, just throws a new one. I've also seen removing a bad package from dpkg/status can fix the error but I wouldn't even know where to start. EDIT 1 I followed the steps in the top voted answer here and now I can access the mongo shell, but when I `service mongodb start` it still says failed. I wasn't able to access the shell before so that's something, yeah? ``` root@mongo:~# service mongodb start Starting database: mongodb failed! root@mongo:~# mongo MongoDB shell version: 2.4.5 connecting to: test Welcome to the MongoDB shell. For interactive help, type "help". For more comprehensive documentation, see http://docs.mongodb.org/ Questions? Try the support group http://groups.google.com/group/mongodb-user > ^C bye root@mongo:~# ```