I installed MongoDB on a Debian VM using apt-get from the 10gen repository. Some time after the install, I wanted to enable authentication in the configuration file, but when I ran service mongodb restart, it stopped and refused to start again.

I am able to reproduce this reliably: every time I run apt-get purge mongodb-10gen; apt-get install mongodb-10gen the server starts. However. when I run service mongodb start, it says

Starting database: mongodb failed!

There is nothing written to the mongo.log file, or any other log that I could find.


I edited /etc/init.d/mongodb to remove the --background argument from the call to start-stop-daemon and got an error with a stack trace. I can't post the full stack trace (because I can't scroll back in the terminal window to get it), but the last function call before the error was some function that has to do with getting the system language.

I had previously set LANG="en_US.UTF-8" in order to build some ruby gems. I ran unset LANG and now I am able to start MongoDB.

(The interesting thing is that I then set LANG... again and restarted MongoDB and it still worked.)


Did it look something like the stack trace here?


This might be a case of the Locale settings getting messed up - I have seen a logout/login fix that, or a direct setting of LC_ALL or similar do the same. If you can figure out how to reproduce it reliably, then it would be worth reporting, I suspect this is actually a boost dependency rather than a MongoDB one but still worth knowing the trigger and fix for the problem.

  • Mine looked a little different, but it is the same as that one in that the last call before the error has locale in the name, which is what clued me in. You're right that it looks from here like a boost problem.
    – Moshe Katz
    May 23 '13 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.