Bug: Ruby Client - Connection Errors on Views

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

https://issues.couchbase.com/browse/RCBC-188

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!

Thanks

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?

Thanks

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