MongoDB: locale::facet::_S_create_c_locale name not valid

Osama Jetawe picture Osama Jetawe · Oct 29, 2013 · Viewed 21.6k times · Source

I got this error message when trying to start mongod:

Tue Oct 29 21:33:23.589 [initandlisten] exception in initAndListen std::exception: locale::facet::_S_create_c_locale name not valid, terminating

I have tried remove it and re-installing, but I got the same error.

What can I do?

Answer

joews picture joews · Oct 29, 2013

The error message: locale::facet::_S_create_c_locale name not valid indicates that mongod is unable to work with your operating system's current locale.

Adjusting your locale to C, which is supported by Mongo, will fix the problem:

export LC_ALL=C
mongod 

This isn't a perfect solution, however: LC_ALL=C forces sorted by byte order rather than locale-sensitive character ordering,

MongoDB locale support is generally lacking. There is an open JIRA ticket discussing locale support.