Failed - Ubuntu 14.04 (Trusty) and Couchbase 1.3.13 gem

124 views
Skip to first unread message

Jesus Orosco

unread,
Jul 8, 2015, 4:05:36 PM7/8/15
to couc...@googlegroups.com
I've installed the most recent C libraries via Couchbase repo:

ro...@ma-fld02.drhm01:~# dpkg -l | grep couchbase
ii  libcouchbase-dev:amd64              2.5.1-1                          amd64        library for the Couchbase protocol, development files
ii  libcouchbase2-bin                   2.5.1-1                          amd64        library for the Couchbase protocol
ii  libcouchbase2-core:amd64            2.5.1-1                          amd64        library for the Couchbase protocol, core files
ii  libcouchbase2-libev:amd64           2.5.1-1                          amd64        library for the Couchbase protocol (libev backend)
ii  libcouchbase2-libevent:amd64        2.5.1-1                          amd64        library for the Couchbase protocol (libevent backend)

Only find 1 library: 

ro...@ma-fld02.drhm01:~# find / -name couchbase.h 2>/dev/null
/usr/include/libcouchbase/couchbase.h

gem install seems to fail to find the libcouchbase libraries:

ro...@ma-fld02.drhm01:~# /opt/td-agent/embedded/bin/gem install couchbase -v 1.3.13
Building native extensions.  This could take a while...
ERROR:  Error installing couchbase:
ERROR: Failed to build gem native extension.

    /opt/td-agent/embedded/bin/ruby extconf.rb
checking for lcb_iops_wire_bsd_impl2(NULL, 0) in -lcouchbase... no

**********************************************************************
* You must install libcouchbase >= 2.4.0
**********************************************************************

*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/opt/td-agent/embedded/bin/ruby
--with-libcouchbase-dir
--without-libcouchbase-dir
--with-libcouchbase-include
--without-libcouchbase-include=${libcouchbase-dir}/include
--with-libcouchbase-lib
--without-libcouchbase-lib=${libcouchbase-dir}/lib
--with-couchbaselib
--without-couchbaselib

extconf failed, exit code 1

Gem files will remain installed in /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/couchbase-1.3.13 for inspection.
Results logged to /opt/td-agent/embedded/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0/couchbase-1.3.13/gem_make.out

mkmf.log:

Mark Nunberg

unread,
Jul 8, 2015, 4:16:25 PM7/8/15
to couc...@googlegroups.com
What version of openssl do you have installed? What does dpkg say? At first glance it would seem that either libcouchase is linked against the wrong openssl, or you have a different openssl installation.

I’ve just downloaded the libssl deb for trusty and extracted it. Among one of the symbols missing is SSL_get_ssl_method@OPENSSL_1.0.0 (from the error log).

It’s found inside the ssl package I just downloaded:
mnunberg@csure:~/repos/ubuntu/pool/trusty/main/libc/libcouchbase/tmp/lib/x86_64-linux-gnu$ readelf -a libssl.so.1.0.0 | grep SSL_get_ssl_method
   622: 0000000000038830     5 FUNC    GLOBAL DEFAULT   12 SSL_get_ssl_method@@OPENSSL_1.0.0

I am seeing you are using a non-system Ruby installation. Perhaps this Ruby version has its own openssl which is different than the system’s, and in turn, is accidentally being picked up by libcouchbase?

--
You received this message because you are subscribed to the Google Groups "Couchbase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to couchbase+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jesus Orosco

unread,
Jul 8, 2015, 4:24:57 PM7/8/15
to couc...@googlegroups.com
Openssl version as follows:

ro...@ma-fld02.drhm01:~# dpkg -l | grep openssl
ii  libgnutls-openssl27:amd64           2.12.23-12ubuntu2.2              amd64        GNU TLS library - OpenSSL wrapper
ii  openssl                             1.0.1f-1ubuntu2.11               amd64        Secure Sockets Layer toolkit - cryptographic utility

I failed to mention this, my bad. Yes I am using the Ruby that is embedded with Treasure Data Fluent D package, the ultimate goal being to use the Couchbase plugin for fluentd:


I have this working on Ubuntu 12 using a similar embedded version of Ruby.

Mark Nunberg

unread,
Jul 8, 2015, 4:43:23 PM7/8/15
to couc...@googlegroups.com
So you’re using the correct system openssl, but for some reason I still suspect that the Ruby you are using isn’t using the correct one.

Just to verify, download the libcouchbase command line tools (libcouchbase2-bin) and see if a simple command such as ‘cbc version’ works for you. If that does, your options are:

1) Rebuild libcouchbase without SSL support (you’d need to build it from source)
2) Ensure your Ruby uses the system-available openssl

Curious what an ‘ldd’ would yield on the Ruby binary being used. 

Jesus Orosco

unread,
Jul 8, 2015, 4:49:46 PM7/8/15
to couc...@googlegroups.com
cbc version:

ro...@ma-fld02.drhm01:/opt/td-agent/embedded/lib# cbc version
cbc:
  Runtime: Version=2.5.1, Changeset=54ea1fa2e7bd5fef34450d09f2677bb53b6e62ea
  Headers: Version=2.5.1, Changeset=54ea1fa2e7bd5fef34450d09f2677bb53b6e62ea
  IO: Default=libevent, Current=libevent
  SSL: .. SUPPORTED

ldd:

ro...@ma-fld02.drhm01:/opt/td-agent/embedded/lib# ldd /opt/td-agent/embedded/bin/ruby
linux-vdso.so.1 =>  (0x00007fff02f72000)
libruby.so.2.1 => /opt/td-agent/embedded/lib/libruby.so.2.1 (0x00007f0e98795000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0e983c9000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f0e981aa000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f0e97fa6000)
libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f0e97d6d000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0e97a66000)
/lib64/ld-linux-x86-64.so.2 (0x00007f0e98c74000)

Mark Nunberg

unread,
Jul 8, 2015, 5:13:39 PM7/8/15
to couc...@googlegroups.com
So it seems libruby.so uses its own statically linked openssl, and exports those symbols so they are available to other applications. Maybe modifying the linker commandline to provide -lcouchbase before -lruby
would help? I’m not entirely sure. Your best bet is to build the library without openssl (requires CMake, use ./cmake/configure —disable-ssl). Follow the instructions for building from source on the README (https://github.com/couchbase/libcouchbase). Remember to git checkout 2.5.1 before building in order to get a stable release version.

Jesus Orosco

unread,
Jul 9, 2015, 8:11:52 PM7/9/15
to couc...@googlegroups.com
Care to speculate why this worked?

ro...@ma-fld02.drhm01:/opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.10.60/bin# ./fluent-gem install ~/couchbase-1.3.13.gem
Building native extensions.  This could take a while...
Successfully installed couchbase-1.3.13
Parsing documentation for couchbase-1.3.13
Done installing documentation for couchbase after 2 seconds
1 gem installed

Mark Nunberg

unread,
Jul 9, 2015, 8:19:40 PM7/9/15
to couc...@googlegroups.com
Perhaps it manipulates the compiler flags? I’m guessing there’s a lot somewhere showing what compiler line it used.
My knowledge with Ruby is rather limited (I only know about the C library here..)

Jesus Orosco

unread,
Jul 10, 2015, 1:42:37 PM7/10/15
to couc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages