Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | SDKs | SDKs

Python .5 Library Problem

3 replies [Last post]
  • Login or register to post comments
Thu, 01/05/2012 - 20:41
kjw
Offline
Joined: 01/05/2012
Groups: None

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 vbucket

It 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?

Top
  • Login or register to post comments
Wed, 01/11/2012 - 15:26
ingenthr
Offline
Joined: 03/16/2010
Groups:

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.

Top
  • Login or register to post comments
Wed, 01/11/2012 - 16:19
kjw
Offline
Joined: 01/05/2012
Groups: None

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

Top
  • Login or register to post comments
Mon, 02/27/2012 - 12:53
byzhang
Offline
Joined: 02/25/2012
Groups: None

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

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker