mongod: symbol lookup error: mongod: undefined symbol: _ZN5boost6detail13once_epoch_cvE

Iam having trouble with my mongodb install : when I run sudo mongod, I get mongod: symbol lookup error: mongod: undefined symbol: _ZN5boost6detail13once_epoch_cvE

uname -a
Linux xyz 3.2.0-4-686-pae #1 SMP Debian 3.2.65-1+deb7u2 i686 GNU/Linux

which mongod
/usr/bin/mongod

ldd /usr/bin/mongod
    linux-gate.so.1 =>  (0xb76e7000)
    libpcrecpp.so.0 => /usr/lib/i386-linux-gnu/libpcrecpp.so.0 (0xb76b9000)
    libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0xb767b000)
    libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb758e000)
    libboost_system.so.1.49.0 => /usr/lib/libboost_system.so.1.49.0 (0xb758a000)
    libboost_thread.so.1.49.0 => /usr/lib/libboost_thread.so.1.49.0 (0xb7565000)
    libboost_filesystem.so.1.49.0 => /usr/lib/libboost_filesystem.so.1.49.0 (0xb7546000)
    libboost_program_options.so.1.49.0 => /usr/lib/libboost_program_options.so.1.49.0 (0xb74de000)
    libm.so.6 => /lib/i386-linux-gnu/i686/cmov/libm.so.6 (0xb74b7000)
    libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb749a000)
    libpthread.so.0 => /lib/i386-linux-gnu/i686/cmov/libpthread.so.0 (0xb7481000)
    libc.so.6 => /lib/i386-linux-gnu/i686/cmov/libc.so.6 (0xb731d000)
    /lib/ld-linux.so.2 (0xb76e8000)
    librt.so.1 => /lib/i386-linux-gnu/i686/cmov/librt.so.1 (0xb7314000)
    libboost_system.so.1.57.0 => /lib/libboost_system.so.1.57.0 (0xb730f000)

I have reinstalled libboost and mongodb, but without success. any idea what's going on ?

BR/


Solution 1:

First, with a command

$ echo _ZN5boost6detail13once_epoch_cvE|c++filt
boost::detail::once_epoch_cv                                                   

we can see, that your boost library is missing the boost::detail::once_epoch_cv symbol. Such cryptic missing symbols are coming in most cases from c++ namespace / class names, and they could be translated easily with the c++filt tool (part of the gcc / g++ package).

Thus, you don't have the once_epoch_cv method in the detail namespace of your boost library. Googling for that we can found here, that at least boost-1.47 contained this symbol. Your ldd output says you are using a newer boost version (1.49).

I think, there is this type of incompatibility between your actual installed boost and between for which your mongodb executable was compiled for. My suggestion were to recompile that mongodb from source, or eliminate the cause of this incompatibility (probably the usage of some inofficial / incompatible repos).