Bug: Ruby Client - Connection Errors on Views

I specifically signed up on this forum to ask about the following issue:


Is there any update on this? This is REALLY annoying and slowly makes me dislike Couchbase more and more. This bug is pretty critical and has been known for over 3 months now with no sign of activity!


P.S.: The Ruby SDK is also the only one not on v2.0 yet, whereas most of the other SDKs were updated ages ago.

From what I can determine, this bug was fixed in the Ruby gem version 1.3.12. Did you try that version out?

If all else fails, as a temporary fix you can set LCB_OPTIONS=http_poolsize=0 in your environment (the environment variable being LCB_OPTIONS).

Unfortunately it was not… at least for me. I’m using 1.3.12 and also set the poolsize to 0. It made things a bit better (or so I think), but strangely enough didn’t fix it completely. However I’m not 100% sure if sudo picked up the env variable correctly.

So, new gem version didn’t really do anything for me :-/

Please do verify these settings are in effect. The cause of this issue is established as being the view engine closing idle HTTP connections; I am unsure if the fact that you are using couchbase-model changes anything.

In any event, it would be helpful to post logs (from the underlying C library) demonstrating this issue. I do not remember how many people have had this issue, but I remember at least one person saying that disabling the connection pool solved this issue (although it was not ideal).

If you do enable logging you would also see the logs tell you the initial settings applied via LCB_OPTIONS.

Yiu may also have a firewall interfering perhaps?

Sent via the Samsung Galaxy S™III, an AT&T 4G LTE smartphone

I’m not a complete Unix noob, but I didn’t get the environment variables applied correctly, apparently. I installed Couchbase on a Debian system and started it via non-root user with “sudo /etc/init.d/couchbase-server start”. I tried setting “set LCB_OPTIONS=detailed_errcodes=1 && set LCB_LOGLEVEL=5” and starting it, also tried with “sudo LCB_LOGLEVEL=5 LCB_OPTIONS=detailed_errcodes=1 /etc/init.d/couchbase-server start”, but I’m still only getting:

App 26585 stderr: 2015-05-10 11:46:36 - Couchbase::Error::Network - failed to execute HTTP request, Generic network failure. Enable detailed error
 codes (via LCB_CNTL_DETAILED_ERRCODES, or via `detailed_errcodes` in the connection string) and/or enable logging to get more information (key="/
bluewin/_design/keys/_view/keys", error=0x10):
App 26585 stderr:       /opt/rubies/ruby-2.1.3/lib/ruby/gems/2.1.0/gems/couchbase-1.3.12/lib/couchbase/view.rb:492:in `continue'
App 26585 stderr:       /opt/rubies/ruby-2.1.3/lib/ruby/gems/2.1.0/gems/couchbase-1.3.12/lib/couchbase/view.rb:492:in `fetch_sync'
App 26585 stderr:       /opt/rubies/ruby-2.1.3/lib/ruby/gems/2.1.0/gems/couchbase-1.3.12/lib/couchbase/view.rb:378:in `fetch'

I’m using Couchbase with a webserver btw (Rack-based, with Passenger).

Could you tell me how I can - in my environment - set the error logging correctly?


I’m running the Ruby app and Couchbase on the same server and I’m having the same problem on a Vagrant machine and on a live server, so I don’t think it’s a firewall issue. The error is always occuring if I make another request 300 seconds / 5 min after the last request, btw.

Edit: Also, if I use JRuby and this gem everything works fine. So it most probably is an issue with the Ruby gem.

Edit 2: I’m also NOT using couchbase-model, contrary to the original bug reporter. Just a plain and simple request to Couchbase using the official couchbase gem.

Seems this would be more easily handled if Ruby exposed ways to utilize these settings directly (rather than through environment variables). I would suggest you file an issue in the RCBC project to make this possible.

In the meantime, you can set the environment variables wherever your script is instantiated (if it’s an init script, simply set those variables there). You might also want to export those shell variables (in case they are invoked by subshells).

Additionally, I’ve been looking at the ruby ext code, and see that this issue was not actually fixed (after a further examination).

Thanks for looking into it! I tried logging in and registering at your Jira server, but my login for the forum doesn’t work and the “register” link just redirects directly to this forum…

There’s a small known issue with our registration process which we’re working to fix. If you don’t put a ‘first name’ on your account, JIRA won’t let you use your SSO session there.

I’ve updated your account so you have a first name entry. It may take a little bit for the cache on auth to clear, but you should be able to sign in at issues.couchbase.com soon @gottlike.

Also, it seems your issue has been fixed with the latest commit (actually filed as RCBC-196): https://github.com/couchbase/couchbase-ruby-client/commit/ae3030c85c1ca6f8d4e6d50a0e183c6dd6c14f7b

I’m sure @avsej can chime in to tell you when it will be available, but you could probably build and test for source to see if this fixes your issue.

Thanks guys, that’s great news! According to the JIRA milestone, the new release is planned for Friday. I was also able to open a new issue regarding the CB options.

Good to know that you can get great feedback on the forums :slight_smile:
(although it’d be nicer if you’d be using Github for community feedback/filing bugs)

1 Like

This is very good news~!! :smile:

I was the one who was having the same issue. I worked around the issue by ajax-retrying if the request failed. I am looking forward to patch the issue.

Thank you for the info. @gottlike