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

ruby client hangs when trying to use a sasl protected bucket

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: library
    • Security Level: Public
    • Labels:
      None
    • Environment:
      Apple OSX 10.6, ruby 1.9.2, libcouchbase 1.0.0, libvbucket 1.8.0.1, couchbase-ruby-client trunk

      Description

      This simple ruby script:

      require 'couchbase'
      c = Couchbase.new('http://localhost:11211/pools/default/buckets/sasl', :password => 'sasl')

      Hangs. Here's the stack trace:

      #0 0x00007fff83746c0a in kevent ()
      #1 0x00000001005a45f5 in kq_dispatch ()
      #2 0x0000000100593cdc in event_base_loop ()
      #3 0x000000010058257a in libcouchbase_wait ()
      #4 0x00000001002f5824 in cb_bucket_init ()
      #5 0x000000010016d034 in vm_call0 ()
      #6 0x00000001001721ee in rb_funcall2 ()
      #7 0x00000001002f4bc7 in cb_bucket_new ()
      #8 0x00000001001779c3 in vm_call_method ()
      #9 0x0000000100162d23 in vm_exec_core ()
      #10 0x000000010016b873 in vm_exec ()
      #11 0x000000010016c0c0 in eval_string_with_cref ()
      #12 0x000000010016c7e2 in rb_f_eval ()
      #13 0x00000001001779c3 in vm_call_method ()
      #14 0x0000000100162d23 in vm_exec_core ()
      #15 0x000000010016b873 in vm_exec ()
      #16 0x0000000100179d51 in loop_i ()
      #17 0x000000010003bdb7 in rb_rescue2 ()
      #18 0x000000010015e9e6 in rb_f_loop ()
      #19 0x00000001001779c3 in vm_call_method ()
      #20 0x0000000100162d23 in vm_exec_core ()
      #21 0x000000010016b873 in vm_exec ()
      #22 0x00000001001799d4 in catch_i ()
      #23 0x000000010015dbd5 in rb_catch_obj ()
      #24 0x000000010015e8a0 in rb_f_catch ()
      #25 0x00000001001779c3 in vm_call_method ()
      #26 0x0000000100162d23 in vm_exec_core ()
      #27 0x000000010016b873 in vm_exec ()
      #28 0x00000001001799d4 in catch_i ()
      #29 0x000000010015dbd5 in rb_catch_obj ()
      #30 0x000000010015e8a0 in rb_f_catch ()
      #31 0x00000001001779c3 in vm_call_method ()
      #32 0x0000000100162d23 in vm_exec_core ()
      #33 0x000000010016b873 in vm_exec ()
      #34 0x000000010016bb7b in rb_iseq_eval_main ()
      #35 0x000000010003c022 in ruby_exec_internal ()
      #36 0x000000010003eb2c in ruby_run_node ()
      #37 0x0000000100000aef in main ()

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

        Activity

        Hide
        erickt Erick Tryzelaar added a comment -

        I forgot to mention that this is with couchbase 1.8, and I've created a sasl protected bucket named sasl with the password sasl.

        Show
        erickt Erick Tryzelaar added a comment - I forgot to mention that this is with couchbase 1.8, and I've created a sasl protected bucket named sasl with the password sasl.
        Hide
        ingenthr Matt Ingenthron added a comment -

        The URL should be to port 8091. Port 11211 is memcached protocol. You're probably sending a bunch of HTTP junk to moxi, and then it's hanging at bootstrap time.

        Try replacing it with port 8091 in the URL.

        Show
        ingenthr Matt Ingenthron added a comment - The URL should be to port 8091. Port 11211 is memcached protocol. You're probably sending a bunch of HTTP junk to moxi, and then it's hanging at bootstrap time. Try replacing it with port 8091 in the URL.
        Hide
        erickt Erick Tryzelaar added a comment -

        Thanks Matt! I found a way to get a similar hang with port 8091. I've been occasionally getting an "Unable to start sasl client" error message, and when I was poking around in irb, I got a hang when I tried using a client after I got the auth error:

        irb(main):041:0> loop do; c = Couchbase.new('http://localhost:8091/pools/default/buckets/sasl', :username => 'sasl', :password => 'sasl'); c.stats; end
        Couchbase::Error::Auth: Unable to start sasl client (error=0x2)
        from (irb):41:in `stats'
        from (irb):41:in `block in irb_binding'
        from (irb):41:in `loop'
        from (irb):41
        from /Users/etryzelaar/.rbenv/versions/1.9.2-p290/bin/irb:12:in `<main>'
        irb(main):042:0> c.stats
        Hangs

        Now it's probably just a bad idea to try to keep reusing a connection after I got an auth failure, but I would hope libcouchbase would invalidate the connection if it was unsafe to use. It'd also be great to know why I occasionally get these auth errors in the first place. Anyway, here's the stack trace for this error:

        #0 0x00007fff83746c0a in kevent ()
        #1 0x00000001005a45f5 in kq_dispatch ()
        #2 0x0000000100593cdc in event_base_loop ()
        #3 0x00000001002f391d in cb_bucket_stats (argc=<value temporarily unavailable, due to optimizations>, argv=<value temporarily unavailable, due to optimizations>, self=<value temporarily unavailable, due to optimizations>) at couchbase_ext.c:1778
        #4 0x00000001001779c3 in vm_call_method ()
        #5 0x0000000100162d23 in vm_exec_core ()
        #6 0x000000010016b873 in vm_exec ()
        #7 0x000000010016c0c0 in eval_string_with_cref ()
        #8 0x000000010016c7e2 in rb_f_eval ()
        #9 0x00000001001779c3 in vm_call_method ()
        #10 0x0000000100162d23 in vm_exec_core ()
        #11 0x000000010016b873 in vm_exec ()
        #12 0x0000000100179d51 in loop_i ()
        #13 0x000000010003bdb7 in rb_rescue2 ()
        #14 0x000000010015e9e6 in rb_f_loop ()
        #15 0x00000001001779c3 in vm_call_method ()
        #16 0x0000000100162d23 in vm_exec_core ()
        #17 0x000000010016b873 in vm_exec ()
        #18 0x00000001001799d4 in catch_i ()
        #19 0x000000010015dbd5 in rb_catch_obj ()
        #20 0x000000010015e8a0 in rb_f_catch ()
        #21 0x00000001001779c3 in vm_call_method ()
        #22 0x0000000100162d23 in vm_exec_core ()
        #23 0x000000010016b873 in vm_exec ()
        #24 0x00000001001799d4 in catch_i ()
        #25 0x000000010015dbd5 in rb_catch_obj ()
        #26 0x000000010015e8a0 in rb_f_catch ()
        #27 0x00000001001779c3 in vm_call_method ()
        #28 0x0000000100162d23 in vm_exec_core ()
        #29 0x000000010016b873 in vm_exec ()
        #30 0x000000010016bb7b in rb_iseq_eval_main ()
        #31 0x000000010003c022 in ruby_exec_internal ()
        #32 0x000000010003eb2c in ruby_run_node ()
        #33 0x0000000100000aef in main ()

        Show
        erickt Erick Tryzelaar added a comment - Thanks Matt! I found a way to get a similar hang with port 8091. I've been occasionally getting an "Unable to start sasl client" error message, and when I was poking around in irb, I got a hang when I tried using a client after I got the auth error: irb(main):041:0> loop do; c = Couchbase.new('http://localhost:8091/pools/default/buckets/sasl', :username => 'sasl', :password => 'sasl'); c.stats; end Couchbase::Error::Auth: Unable to start sasl client (error=0x2) from (irb):41:in `stats' from (irb):41:in `block in irb_binding' from (irb):41:in `loop' from (irb):41 from /Users/etryzelaar/.rbenv/versions/1.9.2-p290/bin/irb:12:in `<main>' irb(main):042:0> c.stats Hangs Now it's probably just a bad idea to try to keep reusing a connection after I got an auth failure, but I would hope libcouchbase would invalidate the connection if it was unsafe to use. It'd also be great to know why I occasionally get these auth errors in the first place. Anyway, here's the stack trace for this error: #0 0x00007fff83746c0a in kevent () #1 0x00000001005a45f5 in kq_dispatch () #2 0x0000000100593cdc in event_base_loop () #3 0x00000001002f391d in cb_bucket_stats (argc=<value temporarily unavailable, due to optimizations>, argv=<value temporarily unavailable, due to optimizations>, self=<value temporarily unavailable, due to optimizations>) at couchbase_ext.c:1778 #4 0x00000001001779c3 in vm_call_method () #5 0x0000000100162d23 in vm_exec_core () #6 0x000000010016b873 in vm_exec () #7 0x000000010016c0c0 in eval_string_with_cref () #8 0x000000010016c7e2 in rb_f_eval () #9 0x00000001001779c3 in vm_call_method () #10 0x0000000100162d23 in vm_exec_core () #11 0x000000010016b873 in vm_exec () #12 0x0000000100179d51 in loop_i () #13 0x000000010003bdb7 in rb_rescue2 () #14 0x000000010015e9e6 in rb_f_loop () #15 0x00000001001779c3 in vm_call_method () #16 0x0000000100162d23 in vm_exec_core () #17 0x000000010016b873 in vm_exec () #18 0x00000001001799d4 in catch_i () #19 0x000000010015dbd5 in rb_catch_obj () #20 0x000000010015e8a0 in rb_f_catch () #21 0x00000001001779c3 in vm_call_method () #22 0x0000000100162d23 in vm_exec_core () #23 0x000000010016b873 in vm_exec () #24 0x00000001001799d4 in catch_i () #25 0x000000010015dbd5 in rb_catch_obj () #26 0x000000010015e8a0 in rb_f_catch () #27 0x00000001001779c3 in vm_call_method () #28 0x0000000100162d23 in vm_exec_core () #29 0x000000010016b873 in vm_exec () #30 0x000000010016bb7b in rb_iseq_eval_main () #31 0x000000010003c022 in ruby_exec_internal () #32 0x000000010003eb2c in ruby_run_node () #33 0x0000000100000aef in main ()
        Hide
        ingenthr Matt Ingenthron added a comment -

        I believe this is likely solved with the libcouchbase 1.0.1 just released the other day. Sergey, do you think so too?

        Show
        ingenthr Matt Ingenthron added a comment - I believe this is likely solved with the libcouchbase 1.0.1 just released the other day. Sergey, do you think so too?
        Hide
        avsej Sergey Avseyev added a comment -

        It is fixed in libcouchbase and works well on master version of couchbase ruby gem, which hasn't released yet

        Show
        avsej Sergey Avseyev added a comment - It is fixed in libcouchbase and works well on master version of couchbase ruby gem, which hasn't released yet
        Hide
        avsej Sergey Avseyev added a comment -
        Show
        avsej Sergey Avseyev added a comment - There are several fixes related to SASL in libcouchbase: http://review.couchbase.org/12722 http://review.couchbase.org/12700 http://review.couchbase.org/12857

          People

          • Assignee:
            avsej Sergey Avseyev
            Reporter:
            erickt Erick Tryzelaar
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes