Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 2 down vote accepted

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.)

share|improve this answer

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.

share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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