Uploaded image for project: 'Couchbase Ruby client library'
  1. Couchbase Ruby client library
  2. RCBC-359

Crash error during cluster initialization with double couchbase://

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.2.0
    • 3.3.0
    • None
    • None
    • couchbase:community-7.0.2
      OS: Debian GNU/Linux 10 (buster)
    • 1

    Description

      The usage of a wrong endpoint (with two times couchbase://) trigger an error on the library.

      To reproduce use "couchbase://" twice in the initialization of the cluster:

      Couchbase::Cluster.connect(
             "couchbase://couchbase://couchbase1",
             "username",
             "password"
       )
      

      This will prompt the following error:

      [2022-03-25 14:22:58.082] [294,294] [critical] 1063ms, *** Fatal error encountered during exception handling (rev="6c069e4e6965117c7240b331847dc3f62afe0554", compiler="GNU 8.3.0", system="Linux-5.4.0-100-generic", date="2022-03-02 07:53:22") ***
      [2022-03-25 14:22:58.082] [294,294] [critical] 0ms, Caught unhandled std::exception-derived exception. what(): stoul
      [2022-03-25 14:22:58.083] [294,294] [critical] 1ms, Call stack:
          /usr/local/bundle/gems/couchbase-3.2.0/lib/couchbase/libcouchbase.so(print_backtrace_to_buffer+0x2f) [0x7f9c88da9000+0x41622f]
          /usr/local/bundle/gems/couchbase-3.2.0/lib/couchbase/libcouchbase.so() [0x7f9c88da9000+0x41644d]
          /usr/local/bundle/gems/couchbase-3.2.0/lib/couchbase/libcouchbase.so() [0x7f9c88da9000+0x416f42]
          /usr/lib/x86_64-linux-gnu/libstdc++.so.6() [0x7f9c9119f000+0x928c6]
          /usr/lib/x86_64-linux-gnu/libstdc++.so.6() [0x7f9c9119f000+0x92901]
          /usr/lib/x86_64-linux-gnu/libstdc++.so.6() [0x7f9c9119f000+0x92b34]
          /usr/lib/x86_64-linux-gnu/libstdc++.so.6() [0x7f9c9119f000+0x8e81f]
          /usr/local/bundle/gems/couchbase-3.2.0/lib/couchbase/libcouchbase.so(_ZN9__gnu_cxx6__stoaImmcJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_+0x85) [0x7f9c88da9000+0x2cc1a5]
          /usr/local/bundle/gems/couchbase-3.2.0/lib/couchbase/libcouchbase.so(_ZN3tao4json5pegtl5matchINS1_3uri4portELNS1_10apply_modeE1ELNS1_11rewind_modeE0EN9couchbase5utils4priv6actionENS1_6normalENS1_12memory_inputILNS1_13tracking_modeE0ENS1_5ascii3eol7lf_crlfENSt7__cxx1112basic_stringIcSt11char_traitsI
          /usr/local/bundle/gems/couchbase-3.2.0/lib/couchbase/libcouchbase.so(_ZN3tao4json5pegtl5matchINS1_3seqIJN9couchbase5utils4priv4hostENS1_3optIJNS1_5ascii3oneIJLc58EEEENS1_3uri4portEEEENS8_IJNSA_IJLc61EEEENS6_4modeEEEEEEELNS1_10apply_modeE1ELNS1_11rewind_modeE2ENS6_6actionENS1_6normalENS1_12memory_in
          /usr/local/bundle/gems/couchbase-3.2.0/lib/couchbase/libcouchbase.so(_ZN9couchbase5utils23parse_connection_stringERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x37c) [0x7f9c88da9000+0x2ac1ac]
          /usr/local/bundle/gems/couchbase-3.2.0/lib/couchbase/libcouchbase.so() [0x7f9c88da9000+0x2ad846]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x277fdb]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x290c49]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x2914a4]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x27bf53]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x283c26]
          /usr/local/lib/libruby.so.3.0(rb_vm_exec+0x176) [0x7f9c9197d000+0x289426]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x28aad6]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x28c645]
          /usr/local/lib/libruby.so.3.0(rb_funcallv_kw+0x52) [0x7f9c9197d000+0x28cb72]
          /usr/local/lib/libruby.so.3.0(rb_class_new_instance_pass_kw+0x4e) [0x7f9c9197d000+0x17363e]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x277fdb]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x290c49]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x2914a4]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x27bf53]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x283c26]
          /usr/local/lib/libruby.so.3.0(rb_vm_exec+0x176) [0x7f9c9197d000+0x289426]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x293497]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x162dbc]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x277fdb]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x290c49]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x2914a4]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x27bf53]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x283c98]
          /usr/local/lib/libruby.so.3.0(rb_vm_exec+0x176) [0x7f9c9197d000+0x289426]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x293167]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x27d656]
          /usr/local/lib/libruby.so.3.0(rb_catch_obj+0x4c) [0x7f9c9197d000+0x27d7ec]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x277fdb]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x27bf53]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0x283c98]
          /usr/local/lib/libruby.so.3.0(rb_vm_exec+0x176) [0x7f9c9197d000+0x289426]
          /usr/local/lib/libruby.so.3.0(rb_yield_values2+0x64) [0x7f9c9197d000+0x2943d4]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0xf138b]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0xf210b]
          /usr/local/lib/libruby.so.3.0(rb_st_foreach_check+0x6e) [0x7f9c9197d000+0x20ebde]
          /usr/local/lib/libruby.so.3.0() [0x7f9c9197d000+0xf4098]
          /usr/local/lib/libruby.so.3.0(rb_ensure+0x11b) [0x7f9c9197d000+0xcd1eb]
          <frame limit reached, possible truncation>
       
      terminate called after throwing an instance of 'std::invalid_argument'
        what():  stoul
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          Fixed on current master branch (future 3.3.0)

          It will raise an exception now, though:

          couchbase-ruby-client/lib/couchbase/cluster.rb:417:in `open': Failed to parse connection string "couchbase://couchbase://couchbase1": failed to parse connection string (column: 24, trailer: "/couchbase1") (Couchbase::Error::InvalidArgument)
          	from couchbase-ruby-client/lib/couchbase/cluster.rb:417:in `initialize'
          	from couchbase-ruby-client/lib/couchbase/cluster.rb:65:in `new'
          	from couchbase-ruby-client/lib/couchbase/cluster.rb:65:in `connect'
          	from example.rb:7:in `<main>'
          

          avsej Sergey Avseyev added a comment - Fixed on current master branch (future 3.3.0) It will raise an exception now, though: couchbase-ruby-client/lib/couchbase/cluster.rb:417:in `open': Failed to parse connection string "couchbase://couchbase://couchbase1": failed to parse connection string (column: 24, trailer: "/couchbase1") (Couchbase::Error::InvalidArgument) from couchbase-ruby-client/lib/couchbase/cluster.rb:417:in `initialize' from couchbase-ruby-client/lib/couchbase/cluster.rb:65:in `new' from couchbase-ruby-client/lib/couchbase/cluster.rb:65:in `connect' from example.rb:7:in `<main>'

          People

            avsej Sergey Avseyev
            Stefano Stefano Martin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty