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

Mongod fails to start as unprivileged user when {{/sys/devices/system/node}} is not readable and executable.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.4.6, 2.5.2
    • Fix Version/s: 2.5.3
    • Component/s: Stability
    • Labels:
      None
    • Environment:
      ArchLinux, kernel 3.10.9-xxxx-grs-ipv6-64 (OVH) x86_64, Intel(R) Xeon(R) CPU E3-1245 V2 @ 3.40GHz
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      Linux

      Description

      The function boost::filesystem::exists(boost::filesystem::path) throws an exception if some component of the path is not accessible by the executing user. This can cause the ProcessInfo::checkNumaEnabled() to throw an uncaught exception at start-up, when trying to determine if NUMA interleaving is enabled or disabled. Possible resolutions are to detect this in a different way that cannot fail, or to recover more gracefully when this fails.

      Original report follows.

      Hi,

      On a brand new dedicated server from OVH, under ArchLinux, mongod fails to start as mongodb user. Starting with the same config as root works flawlessly.

      This might be related to the kernel version/options set by OVH as I've found a Gentoo user with the exact same issue. The common trait would be the custom 3.10.9 kernel (http://forums.gentoo.org/viewtopic-p-7382216.html).

      Below is the syslog for a failed startup:

      Aug 26 17:42:14 lead systemd[1]: Started High-performance, schema-free document-oriented database.
      Aug 26 17:42:14 lead mongod[4279]: Mon Aug 26 17:42:14.211 terminate() called, printing stack (if implemented for platform):
      Aug 26 17:42:14 lead mongod[4279]: 0xadb736 0x6e3355 0x31af3645c46 0x31af3645c73 0x31af3645e9e 0x31af41de41f 0xad02ed 0xad0b02 0xacf9d5 0xacfa69 0x704d6c 0x70508a 0x705633 0x705659 0x7059f7 0x6cbf99 0x31af2d45bc5 0x6e31f5
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x26) [0xadb736]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5mongo11myterminateEv+0x45) [0x6e3355]
      Aug 26 17:42:14 lead mongod[4279]: /usr/lib/libstdc++.so.6(+0x5ec46) [0x31af3645c46]
      Aug 26 17:42:14 lead mongod[4279]: /usr/lib/libstdc++.so.6(+0x5ec73) [0x31af3645c73]
      Aug 26 17:42:14 lead mongod[4279]: /usr/lib/libstdc++.so.6(+0x5ee9e) [0x31af3645e9e]
      Aug 26 17:42:14 lead mongod[4279]: /usr/lib/libboost_filesystem.so.1.54.0(_ZN5boost10filesystem6detail6statusERKNS0_4pathEPNS_6system10error_codeE+0x1ff) [0x31af41de41f]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5mongo11ProcessInfo16checkNumaEnabledEv+0x2d) [0xad02ed]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5mongo11ProcessInfo10SystemInfo17collectSystemInfoEv+0x292) [0xad0b02]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5mongo11ProcessInfo20initializeSystemInfoEv+0x85) [0xacf9d5]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5mongo36_mongoInitializerFunction_SystemInfoEPNS_18InitializerContextE+0x9) [0xacfa69]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5boost6detail8function17function_invoker1IPFN5mongo6StatusEPNS3_18InitializerContextEES4_S6_E6invokeERNS1_15function_bufferES6_+0xc) [0x704d6c]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZNK5mongo11Initializer7executeERKSt6vectorISsSaISsEERKSt3mapISsSsSt4lessISsESaISt4pairIKSsSsEEE+0x1aa) [0x70508a]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5mongo21runGlobalInitializersERKSt6vectorISsSaISsEERKSt3mapISsSsSt4lessISsESaISt4pairIKSsSsEEE+0x23) [0x705633]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5mongo26runGlobalInitializersOrDieERKSt6vectorISsSaISsEERKSt3mapISsSsSt4lessISsESaISt4pairIKSsSsEEE+0x19) [0x705659]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5mongo26runGlobalInitializersOrDieEiPKPKcS3_+0x307) [0x7059f7]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(main+0x259) [0x6cbf99]
      Aug 26 17:42:14 lead mongod[4279]: /usr/lib/libc.so.6(__libc_start_main+0xf5) [0x31af2d45bc5]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod() [0x6e31f5]
      Aug 26 17:42:14 lead mongod[4279]: Mon Aug 26 17:42:14.217 Got signal: 6 (Aborted).
      Aug 26 17:42:14 lead mongod[4279]: Mon Aug 26 17:42:14.221 Backtrace:
      Aug 26 17:42:14 lead mongod[4279]: 0xadb736 0x6e381b 0x31af2d59450 0x31af2d593d9 0x31af2d5a7d8 0x6e335a 0x31af3645c46 0x31af3645c73 0x31af3645e9e 0x31af41de41f 0xad02ed 0xad0b02 0xacf9d5 0xacfa69 0x704d6c 0x70508a 0x705633 0x705659 0x7059f7 0x6cbf99
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x26) [0xadb736]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5mongo10abruptQuitEi+0xfb) [0x6e381b]
      Aug 26 17:42:14 lead mongod[4279]: /usr/lib/libc.so.6(+0x35450) [0x31af2d59450]
      Aug 26 17:42:14 lead mongod[4279]: /usr/lib/libc.so.6(gsignal+0x39) [0x31af2d593d9]
      Aug 26 17:42:14 lead mongod[4279]: /usr/lib/libc.so.6(abort+0x148) [0x31af2d5a7d8]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5mongo11myterminateEv+0x4a) [0x6e335a]
      Aug 26 17:42:14 lead mongod[4279]: /usr/lib/libstdc++.so.6(+0x5ec46) [0x31af3645c46]
      Aug 26 17:42:14 lead mongod[4279]: /usr/lib/libstdc++.so.6(+0x5ec73) [0x31af3645c73]
      Aug 26 17:42:14 lead mongod[4279]: /usr/lib/libstdc++.so.6(+0x5ee9e) [0x31af3645e9e]
      Aug 26 17:42:14 lead mongod[4279]: /usr/lib/libboost_filesystem.so.1.54.0(_ZN5boost10filesystem6detail6statusERKNS0_4pathEPNS_6system10error_codeE+0x1ff) [0x31af41de41f]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5mongo11ProcessInfo16checkNumaEnabledEv+0x2d) [0xad02ed]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5mongo11ProcessInfo10SystemInfo17collectSystemInfoEv+0x292) [0xad0b02]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5mongo11ProcessInfo20initializeSystemInfoEv+0x85) [0xacf9d5]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5mongo36_mongoInitializerFunction_SystemInfoEPNS_18InitializerContextE+0x9) [0xacfa69]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5boost6detail8function17function_invoker1IPFN5mongo6StatusEPNS3_18InitializerContextEES4_S6_E6invokeERNS1_15function_bufferES6_+0xc) [0x704d6c]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZNK5mongo11Initializer7executeERKSt6vectorISsSaISsEERKSt3mapISsSsSt4lessISsESaISt4pairIKSsSsEEE+0x1aa) [0x70508a]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5mongo21runGlobalInitializersERKSt6vectorISsSaISsEERKSt3mapISsSsSt4lessISsESaISt4pairIKSsSsEEE+0x23) [0x705633]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5mongo26runGlobalInitializersOrDieERKSt6vectorISsSaISsEERKSt3mapISsSsSt4lessISsESaISt4pairIKSsSsEEE+0x19) [0x705659]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(_ZN5mongo26runGlobalInitializersOrDieEiPKPKcS3_+0x307) [0x7059f7]
      Aug 26 17:42:14 lead mongod[4279]: /usr/bin/mongod(main+0x259) [0x6cbf99]
      Aug 26 17:42:14 lead systemd[1]: mongodb.service: main process exited, code=exited, status=14/n/a
      Aug 26 17:42:14 lead systemd[1]: Unit mongodb.service entered failed state.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kyle.erf Kyle Erf
              Reporter:
              hlidobe Hugues Lismonde
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: