Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9032

mongod fails when launched with misconfigured locale

    • Linux
    • Hide

      in python:

      import subprocess
      
      subprocess.Popen(('mongod', '--fork', '--config', '/etc/mongodb.conf'))
      
      Show
      in python: import subprocess subprocess.Popen(( 'mongod' , '--fork' , '--config' , '/etc/mongodb.conf' ))
    • Server 2.7.3

      Issue Status as of Sep 02, 2014

      ISSUE SUMMARY
      On linux systems, if the user running mongod does not have a locale set or the locale is misconfigured, mongod fails to start printing a stack trace.

      USER IMPACT
      mongod can't be started with a missing or misconfigured locale.

      WORKAROUNDS
      Configure a locale for the user running mongod.

      AFFECTED VERSIONS
      MongoDB production releases up to 2.6.4 are affected by this issue.

      FIX VERSION
      The fix is included in the 2.6.5 production release.

      RESOLUTION DETAILS
      Validate that the user running mongod has a locale set. If a locale is not set, print a useful error message and exit.

      Original description

      Hi guys!

      I'm trying to start mongod process from python script, using subprocess module, and this is what mongod crashes with:

      about to fork child process, waiting until server is ready for connections.
      forked process: 2462
      Wed Mar 20 13:43:27.436 terminate() called, printing stack (if implemented for platform):
      0xdcae01 0x6cd72e 0x7faab9b23846 0x7faab9b23873 0x7faab9b2396e 0x7faab9ad0a07 0x7faab9ae0284 0x7faab9ad4a74 0x7faab9ad565f 0xde86df 0xde902b 0xde5cd0 0x9e63ff 0x6dba43 0x6dd7e9 0x7faab91be76d 0x6cd519 
       mongod(_ZN5mongo15printStackTraceERSo+0x21) [0xdcae01]
       mongod(_ZN5mongo11myterminateEv+0x3e) [0x6cd72e]
       /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb5846) [0x7faab9b23846]
       /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb5873) [0x7faab9b23873]
       /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb596e) [0x7faab9b2396e]
       /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZSt21__throw_runtime_errorPKc+0x57) [0x7faab9ad0a07]
       /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x72284) [0x7faab9ae0284]
       /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt6locale5_ImplC1EPKcm+0x44) [0x7faab9ad4a74]
       /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt6localeC1EPKc+0x22f) [0x7faab9ad565f]
       mongod(_ZN5boost11filesystem34path21wchar_t_codecvt_facetEv+0x4f) [0xde86df]
       mongod(_ZNK5boost11filesystem34path14root_directoryEv+0xbb) [0xde902b]
       mongod(_ZN5boost11filesystem38absoluteERKNS0_4pathES3_+0x40) [0xde5cd0]
       mongod(_ZN5mongo27initializeServerGlobalStateEb+0x15f) [0x9e63ff]
       mongod() [0x6dba43]
       mongod(main+0x9) [0x6dd7e9]
       /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7faab91be76d]
       mongod(__gxx_personality_v0+0x499) [0x6cd519]
      Wed Mar 20 13:43:27.531 Got signal: 6 (Aborted).
      
      Wed Mar 20 13:43:27.534 Backtrace:
      0xdcae01 0x6ce879 0x7faab91d34a0 0x7faab91d3425 0x7faab91d6b8b 0x6cd733 0x7faab9b23846 0x7faab9b23873 0x7faab9b2396e 0x7faab9ad0a07 0x7faab9ae0284 0x7faab9ad4a74 0x7faab9ad565f 0xde86df 0xde902b 0xde5cd0 0x9e63ff 0x6dba43 0x6dd7e9 0x7faab91be76d 
       mongod(_ZN5mongo15printStackTraceERSo+0x21) [0xdcae01]
       mongod(_ZN5mongo10abruptQuitEi+0x399) [0x6ce879]
       /lib/x86_64-linux-gnu/libc.so.6(+0x364a0) [0x7faab91d34a0]
       /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x7faab91d3425]
       /lib/x86_64-linux-gnu/libc.so.6(abort+0x17b) [0x7faab91d6b8b]
       mongod(_ZN5mongo11myterminateEv+0x43) [0x6cd733]
       /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb5846) [0x7faab9b23846]
       /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb5873) [0x7faab9b23873]
       /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xb596e) [0x7faab9b2396e]
       /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZSt21__throw_runtime_errorPKc+0x57) [0x7faab9ad0a07]
       /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x72284) [0x7faab9ae0284]
       /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt6locale5_ImplC1EPKcm+0x44) [0x7faab9ad4a74]
       /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZNSt6localeC1EPKc+0x22f) [0x7faab9ad565f]
       mongod(_ZN5boost11filesystem34path21wchar_t_codecvt_facetEv+0x4f) [0xde86df]
       mongod(_ZNK5boost11filesystem34path14root_directoryEv+0xbb) [0xde902b]
       mongod(_ZN5boost11filesystem38absoluteERKNS0_4pathES3_+0x40) [0xde5cd0]
       mongod(_ZN5mongo27initializeServerGlobalStateEb+0x15f) [0x9e63ff]
       mongod() [0x6dba43]
       mongod(main+0x9) [0x6dd7e9]
       /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7faab91be76d]
      
      ERROR: child process failed, exited with error number 14 <err>:  <args>: ('/usr/bin/sudo', '-u', 'mongodb', 'mongod', '--fork', '--config=/etc/mongodb.shardsrv.conf', '-vv')
      

      I've tried all combinations of arguments and subprocess flags, and i still getting the same error. If i run mongod with the same args from shell - it starts, and i don't get no errors.

      It worked with previous versions of mongo (2.0, 2.2), but it doesn't in 2.4.

            Assignee:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Reporter:
            nick.demyanchuk Nick Demyanchuk
            Votes:
            2 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: