Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Ruby Client: Setting :symbolize_keys on MultiJson breaks Client#buckets and Bucket#keys #135 [JIRA: CLIENTS-784] #135
I am using riak-client 1.4.2 with the Excon http_backend.
When I do Bucket#keys in irb, I get the complete list along with the expected warning.
But when I put similar code in a short script, and execute that script at the command line, I get:
This is when using Bucket#keys with no block, or when trying to pass it a block to let it stream the processing.
I get the above error if using for instance: keys.each
But if I pass a block, the block never seems to actually be called (code in the block seems to not run, nor does a simple puts). Here is a quick example:
Again, same code run in irb works as expected.
Is it not possible to use #keys from actual code vs irb? If not, is there any recommended way to discover all they keys in a bucket from code, without foreknowledge of the keys?
Was able to narrow this down more - the problem occurs because of:
Which, I had set in my application (and thus in the examples where I was trying to run some of the sample code above via a command line), but never set when testing these same steps in irb (and thus the difference of it seeming to work in irb and not in script).
The problem then looks to be in http_backend.rb where it specifically looks for ['buckets'] and doesn't take into account the possibility of [:buckets].
changed the title from
Setting :symbolize_keys on MultiJson breaks Client#buckets and Bucket#keys
Ruby Client: Setting :symbolize_keys on MultiJson breaks Client#buckets and Bucket#keys #135 [JIRA: CLIENTS-784]
Feb 29, 2016
@danpisarski - HTTP has been deprecated in the Ruby client since the 2.0 release of the client. I'm going to close this but if a patch release with this fix is absolutely necessary, and you can't upgrade to the newest Ruby client (thus using TCP/protocol buffers), please re-open this issue and let me know about it.