Hi!
(Sorry about the dramatical title…)
I tried to test the docker image with the ruby client.
When It fails during the connect:
options = Couchbase::Cluster::ClusterOptions.new
options.authenticate('Administrator', 'Administrator')
@cluster = Couchbase::Cluster.connect("couchbase://localhost", options)
Fatal error encountered during exception handling (rev="cae6890057eb2b761897d932ce2d80257df6f4fd", compiler="GNU 10.3.1", system="Linux-4.15.0-66-generic"
Caught unhandled std::exception-derived exception. what(): event:
Call stack:
<backtrace not supported on this platform>
terminate called after throwing an instance of 'std::system_error'
what(): event:
When I downgrade to version 3.2.0 it works.
Do you have any idea what could be the issue?
avsej
2
Hi @lambdadevfr, what is your platform?
Could you also post output of
pp Couchbase::VERSION
pp Couchbase::BUILD_INFO
1 Like
Sure!
[1] pry(main)> pp Couchbase::VERSION
{:sdk=>"3.2.0",
:backend=>"1.6.0",
:build_timestamp=>"2022-04-25 08:46:00",
:revision=>"6c069e4e6965117c7240b331847dc3f62afe0554",
:platform=>"Linux-5.13.0-39-generic",
:cpu=>"x86_64",
:cc=>"GNU 11.2.0",
:cxx=>"GNU 11.2.0",
:ruby=>"3.1.0",
:spdlog=>"1.8.1",
:asio=>"1.18.0",
:snappy=>"1.1.8",
:http_parser=>"2.9.4",
:openssl_headers=>"OpenSSL 1.1.1l 24 Aug 2021",
:openssl_runtime=>"OpenSSL 1.1.1l 24 Aug 2021"}
[2] pry(main)> pp Couchbase::BUILD_INFO
{:cmake_version=>"3.18.4",
:cmake_build_type=>"RelWithDebInfo",
:compile_definitions=>"HAVE_BACKTRACE=1;HAVE_DLADDR=1;_GNU_SOURCE=1",
:compile_features=>"cxx_std_17;cxx_std_17",
:compile_flags=>"",
:compile_options=>
"-fdiagnostics-color=always;-ggdb3;-Wall;-Wextra;-Wshadow;-Wnon-virtual-dtor;-Wold-style-cast;-Wcast-align;-Wunused;-Woverloaded-virtual;-Wpedantic;-Wconversion;-Wsign-conversion;-Wnull-dereference;-Wdouble-promotion;-Wformat=2;-Wno-unknown-warning-option;-Wno-gnu-statement-expression;-Wno-compound-token-split-by-macro;-Werror;-Wmisleading-indentation;-Wduplicated-cond;-Wduplicated-branches;-Wlogical-op;-Wuseless-cast;-Wdeprecated-declarations",
:link_depends=>"",
:link_flags=>"",
:link_libraries=>"project_options;project_warnings;OpenSSL::SSL;OpenSSL::Crypto;platform;cbcrypto;cbsasl;http_parser;hdr_histogram_static;snappy;spdlog::spdlog_header_only",
:link_options=>"",
:openssl_crypto_libraries=>"/usr/lib/x86_64-linux-gnu/libcrypto.so",
:openssl_ssl_libraries=>"/usr/lib/x86_64-linux-gnu/libssl.so",
:openssl_include_dir=>"/usr/include",
:ruby_library=>"",
:ruby_include_dir=>""}
Hi Sergey!
Sure!
pp Couchbase::BUILD_INFO
{:ruby_librubyarg=>"-Wl,-rpath,/home/couchbase/.rubies/ruby-3.1.2/lib -L/home/couchbase/.rubies/ruby-3.1.2/lib",
:ruby_include_dir=>"/home/couchbase/.rubies/ruby-3.1.2/include/ruby-3.1.0;/home/couchbase/.rubies/ruby-3.1.2/include/ruby-3.1.0/x86_64-linux-musl",
:ruby_library_dir=>"/home/couchbase/.rubies/ruby-3.1.2/lib",
:cxx_client=>
{:asio=>"1.21.0",
:build_timestamp=>"2022-05-06 00:46:09",
:cc=>"GNU 10.3.1",
:cmake_build_type=>"RelWithDebInfo",
:cmake_version=>"3.21.3",
:compile_definitions=>"HAVE_DLADDR=1;_GNU_SOURCE=1;SPDLOG_COMPILED_LIB;SPDLOG_FMT_EXTERNAL",
:compile_features=>"cxx_std_17;cxx_variadic_templates",
:compile_flags=>"",
:compile_options=>"-fdiagnostics-color=always;-ggdb3",
:cpu=>"x86_64",
:cxx=>"GNU 10.3.1",
:fmt=>"8.800.1",
:http_parser=>"2.9.4",
:link_depends=>"",
:link_flags=>"",
:link_libraries=>
"project_options;project_warnings;fmt::fmt;spdlog::spdlog;couchbase_backtrace;couchbase_logger;couchbase_platform;couchbase_io;couchbase_meta;couchbase_crypto;couchbase_sasl;couchbase_topology;couchbase_utils;couchbase_protocol;couchbase_management;couchbase_operations;couchbase_operations_management;couchbase_tracing;couchbase_metrics;OpenSSL::SSL;OpenSSL::Crypto",
:link_options=>"",
:openssl_headers=>"OpenSSL 1.1.1n 15 Mar 2022",
:openssl_runtime=>"OpenSSL 1.1.1l 24 Aug 2021",
:platform=>"Linux-4.15.0-66-generic",
:post_linked_openssl=>"OFF",
:revision=>"cae6890057eb2b761897d932ce2d80257df6f4fd",
:snappy=>"1.1.8",
:snapshot=>false,
:spdlog=>"1.9.2",
:static_openssl=>false,
:static_stdlib=>false,
:version=>"1.0.0",
:version_build=>1829,
:version_major=>1,
:version_minor=>0,
:version_patch=>0}}
pp Couchbase::VERSION
{:sdk=>"3.3.0", :ruby_abi=>"3.1.0", :revision=>"35071abd412e84b2131268e05fa95e2c0335b379"}
avsej
5
What OS are you using? You are using login Administrator/Administrator?
Also what is the server version/edition?
In my irb it works.
irb(main):004:0> options = Couchbase::Cluster::ClusterOptions.new
=>
#<Couchbase::Options::Cluster:0x00007fa1f31c4098
...
irb(main):005:0> options.authenticate('Administrator', 'password')
=>
#<Couchbase::PasswordAuthenticator:0x00007fa1fb847f20
@allowed_sasl_mechanisms=[:scram_sha512, :scram_sha256, :scram_sha1],
@password="password",
@username="Administrator">
irb(main):006:0> @cluster = Couchbase::Cluster.connect("couchbase://localhost", options)
[2022-06-02 20:11:16.369] [76304,76432] [warning] 31446ms, DNS SRV query returned 0 records for "localhost", assuming that cluster is listening this address
=> #<Couchbase::Cluster:0x00007fa1f3f9e948>
In my irb it works.
I believe you, sure, no pb.
I’m using a Ubuntu 21.10.
The login/pwd is Administrator/Administrator.
As I said, it works on sdk 3.2.0 but not 3.3.0
I run the docker version.
$ docker run -d --name couchbase -p 8091-8096:8091-8096 -p 11210-11211:11210-11211 couchbase
The only thing I did (that was not “in the book” was to add musl.
Maybe that’s the issue though?
musl version is 1.2.2-1
sudo apt-get install musl-dev
sudo ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1
avsej
7
hm, why did you install musl? How do you install couchbase
gem?
musl version was built on Alpine Linux, where musl is system C stdlib.
Try just couchbase-3.3.0-x86_64-linux-3.1.0.gem
from
hm, why did you install musl?
I had an error without it (can’t remember the error but I can uninstall it if you think it’s worth it.
How do you install couchbase
gem?
From the GemFile.: gem ‘couchbase’
Try just couchbase-3.3.0-x86_64-linux-3.1.0.gem
from
tbd
avsej
9
So you are saying that your Gemfile
contains this line, and when you do bundle install
it downloads library with extension compiled against musl
gem "couchbase"
yes it creates ~.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/couchbase-3.3.0-x86_64-linux-musl/
Hi,
Here is an update on that one: I upgraded cmake
to 3.23.2, recompiled everything and now it works.
This problem is solved 
Thanks for your help !
1 Like