Python .5 Library Problem
I've been trying out the Python library for Couchbase 2.0, and occasionally I run into this problem where the cluster will refuse to add a value for a key. I have 3 nodes in the cluster at the moment.
I've been connecting to the cluster like this:
from pymembase.membaseclient import VBucketAwareMembaseClient as MBClient
membase = MBClient('http://10.4.4.101:8091/pools/default', 'default', '', False)When I try to add keys, it sometimes gives me this (executed via python cli):
membase.add("set13", 0, 0, 'blank')
Memcached error #7: I'm not responsible for this vbucket
[2012-01-05 19:35:57,616] - [membaseclient] [139671710267136] - ERROR - got not my vb error
[2012-01-05 19:35:57,616] - [membaseclient] [139671710267136] - ERROR - Memcached error #7: I'm not responsible for this vbucket
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/pymembase/membaseclient.py", line 766, in add
return self._respond(item, event)
File "/usr/local/lib/python2.6/dist-packages/pymembase/membaseclient.py", line 717, in _respond
return item["response"]["return"]
KeyError: 'return'
>>> Memcached error #7: I'm not responsible for this vbucket
[2012-01-05 19:35:57,837] - [membaseclient] [139671710267136] - ERROR - got not my vb error
[2012-01-05 19:35:57,837] - [membaseclient] [139671710267136] - ERROR - Memcached error #7: I'm not responsible for this vbucket
Memcached error #7: I'm not responsible for this vbucket
[2012-01-05 19:35:58,036] - [membaseclient] [139671710267136] - ERROR - got not my vb error
[2012-01-05 19:35:58,036] - [membaseclient] [139671710267136] - ERROR - Memcached error #7: I'm not responsible for this vbucket
Memcached error #7: I'm not responsible for this vbucket
[2012-01-05 19:35:58,265] - [membaseclient] [139671710267136] - ERROR - got not my vb error
[2012-01-05 19:35:58,265] - [membaseclient] [139671710267136] - ERROR - Memcached error #7: I'm not responsible for this vbucket
Memcached error #7: I'm not responsible for this vbucket
[2012-01-05 19:35:58,492] - [membaseclient] [139671710267136] - ERROR - got not my vb error
[2012-01-05 19:35:58,493] - [membaseclient] [139671710267136] - ERROR - Memcached error #7: I'm not responsible for this vbucket
Memcached error #7: I'm not responsible for this vbucket
[2012-01-05 19:35:58,716] - [membaseclient] [139671710267136] - ERROR - got not my vb error
[2012-01-05 19:35:58,716] - [membaseclient] [139671710267136] - ERROR - Memcached error #7: I'm not responsible for this vbucket
Memcached error #7: I'm not responsible for this vbucket
[2012-01-05 19:35:58,945] - [membaseclient] [139671710267136] - ERROR - got not my vb error
[2012-01-05 19:35:58,945] - [membaseclient] [139671710267136] - ERROR - Memcached error #7: I'm not responsible for this vbucketIt keeps repeating forever. Am I using the library incorrectly?
EDIT:
I also noticed that the CAS operation doesn't return a value whereas the other modification methods seem to. Is there a reason for that?
I don't think I had done a recent rebalance. If it were the result of a rebalance, what would be the proper method of handling it? Also, is the KeyError something I need to try to handle?
I am using Membase 1.7.1.1
I'm getting this error for cas (using couchbase 1.8 and the python client from github):
>>> c.client.get('test')
(1, 26, '1')
>>> c.client.cas('test', 0, 1, '1', '1')
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.6/site-packages/couchbase/client.py", line 227, in cas
return self.mc_client.cas(key, exp, flags, oldVal, val)
File "/usr/local/lib/python2.6/site-packages/couchbase/couchbaseclient.py", line 861, in cas
return self._respond(item, event)
File "/usr/local/lib/python2.6/site-packages/couchbase/couchbaseclient.py", line 832, in _respond
raise item["response"]["error"]
struct.error: cannot convert argument to long
or
>>> c.client.cas('test', 0, 1, 1, '1')
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.6/site-packages/couchbase/client.py", line 227, in cas
return self.mc_client.cas(key, exp, flags, oldVal, val)
File "/usr/local/lib/python2.6/site-packages/couchbase/couchbaseclient.py", line 861, in cas
return self._respond(item, event)
File "/usr/local/lib/python2.6/site-packages/couchbase/couchbaseclient.py", line 832, in _respond
raise item["response"]["error"]
couchbase.couchbaseclient.MemcachedError: Memcached error #2: Data exists for key
It appears you're using the client correctly, and it appears the server is sending info back. Is it possible you've done a rebalance recently? Which version of the server are you running?
On the question of the CAS not returning a value, that sounds just like a bug. I'll file one shortly.