Search code examples
mongodblocaledump

mongodump failure 'locale::facet::_S_create_c_locale name not valid'


When I try to create a mongodb dump with

$ mongodump -d mydb

it fails

terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid
Aborted

I have LC_ALL=en_US, Ubuntu 10.0.4, MongoDB 2.4.6 I suspect something is wrong with my locale, but can't find what exactly it is.


Solution

  • I run into the same issue today. It's not strictly MongoDB related. It's locale/language related. Somehow the language on your computer is not defined correctly. I managed to fix my problem by typing:

    sudo locale-gen en_US en_US.UTF-8
    sudo locale-gen xx_XX xx_XX.UTF-8
    sudo dpkg-reconfigure locales

    These commands are to generate and configure the needed locales. After those steps everything should work as expected.