Python: More problems with counters

Alex De la rosa alex.rosa.box at gmail.com
Sun Aug 17 13:33:34 EDT 2014


Hi there,

I was able to install the latest python client version with "pip install
riak==2.1.0rc1", however, counters still fails to work... I used the
following code ( that is the same as in the documentation ):

bucket = client.bucket_type('counter_bucket').bucket('likes')

however I get the following error:

Traceback (most recent call last):
  File "x.py", line 18, in <module>
    counter = bucket.new('Barcelona')
  File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line 159,
in new
    if self.bucket_type.datatype:
  File "/usr/local/lib/python2.7/dist-packages/riak/util.py", line 78, in
__get__
    value = self.fget(obj)
  File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line 618,
in datatype
    return self.get_properties().get('datatype')
  File "/usr/local/lib/python2.7/dist-packages/riak/bucket.py", line 557,
in get_properties
    return self._client.get_bucket_type_props(self)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
line 184, in wrapper
    return self._with_retries(pool, thunk)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
line 126, in _with_retries
    return fn(transport)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/transport.py",
line 182, in thunk
    return fn(self, transport, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/riak/client/operations.py",
line 265, in get_bucket_type_props
    return transport.get_bucket_type_props(bucket_type)
  File
"/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/transport.py",
line 381, in get_bucket_type_props
    MSG_CODE_GET_BUCKET_RESP)
  File
"/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
line 50, in _request
    return self._recv_msg(expect)
  File
"/usr/local/lib/python2.7/dist-packages/riak/transports/pbc/connection.py",
line 142, in _recv_msg
    raise RiakError(err.errmsg)
riak.RiakError: 'Invalid bucket type: <<"counter_bucket">>'

It says the bucket type is wrong (but is the same as in the
documentation)... I tried other combinations and all of them failed too:

riak.RiakError: 'Invalid bucket type: <<"counters_bucket">>'
riak.RiakError: 'Invalid bucket type: <<"counters">>'
riak.RiakError: 'Invalid bucket type: <<"counter">>'

so... no plural, no singular, not isolated... which is the correct
"bucket_type" to use then??

Thanks!
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20140817/4abd4580/attachment.html>


More information about the riak-users mailing list