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

python client Broken pipe when one node is down

3 replies [Last post]
  • Login or register to post comments
Fri, 07/27/2012 - 11:16
fm
Offline
Joined: 06/18/2012
Groups: None

Hello,
I have two servers in one cluster (running 1.8.1 version of couchbase). My couchbase bucket called test which is replicated by one. I am try to test high-availability.

My python client (0.6) connection succeeds when both nodes are up. If one of the nodes is down and I try to connect to second node (that is up & running), I get [Errno 32] Broken pipe error.

Tcpdump shows the interaction between client and server. I am trying to connect to port 8091.

From where the client is I can do curl 'http://rmq2-test:8091/pools/default' and I get response.

On the working node the error log indicates: Bucket "test" not yet ready on ['ns_1@74.115.96.113']
This is the address of failed node.

Note, as soon as I re-start the failed node then the same code works successfully.

Any help is greatly appreciated:

Thanks,

>>> client
'http://rmq2-test:8091/pools/default'

>>> mycb = couchbaseClient(client,'test','password',False)
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.6/site-packages/couchbase/couchbaseclient.py", line 650, in __init__
self.init_vbucket_connections()
File "/usr/lib/python2.6/site-packages/couchbase/couchbaseclient.py", line 735, in init_vbucket_connections
self.start_vbucket_connection(i)
File "/usr/lib/python2.6/site-packages/couchbase/couchbaseclient.py", line 743, in start_vbucket_connection
self._memcacheds[server] = MemcachedClientHelper.direct_client(self.rest, serverIp, serverPort, self.bucket)
File "/usr/lib/python2.6/site-packages/couchbase/couchbaseclient.py", line 1157, in direct_client
bucket_info.saslPassword.encode('ascii'))
File "/usr/lib/python2.6/site-packages/couchbase/couchbaseclient.py", line 410, in sasl_auth_plain
return self.sasl_auth_start('PLAIN', '\0'.join([foruser, user, password]))
File "/usr/lib/python2.6/site-packages/couchbase/couchbaseclient.py", line 406, in sasl_auth_start
return self._doCmd(MemcachedConstants.CMD_SASL_AUTH, mech, data)
File "/usr/lib/python2.6/site-packages/couchbase/couchbaseclient.py", line 302, in _doCmd
self._sendCmd(cmd, key, val, opaque, extraHeader, cas)
File "/usr/lib/python2.6/site-packages/couchbase/couchbaseclient.py", line 254, in _sendCmd
vbucketId=self.vbucketId)
File "/usr/lib/python2.6/site-packages/couchbase/couchbaseclient.py", line 262, in _sendMsg
self.s.send(msg + extraHeader + key + val)
socket.error: [Errno 32] Broken pipe

Top
  • Login or register to post comments
Fri, 08/03/2012 - 10:36
BigBlueHat
Offline
Joined: 01/28/2011
Groups: None

fm,

Thanks for writing. I've just updated our Python SDK and cut an 0.7.1 release. It's available via PyPI (pip install couchbase) and will soon be available via our web site.

I'd suggest giving that a try as well as using the "unified client" which handles topology changes.

The new sample code looks similar to this:

from couchbase import Couchbase()
 
cb = Couchbase('localhost:8091', 'Administrator', 'password')
bucket = cb['default']
bucket.set('key', 0, 0, 'value')
# or more simply...without expiration and flags being set to 0
bucket['key'] = 'value'

Give that unified client a try, and let me know what you find. I believe it should hold up much better to node unavailability.

Thanks!

Top
  • Login or register to post comments
Wed, 08/08/2012 - 11:33
fm
Offline
Joined: 06/18/2012
Groups: None

Hello,
Tried version 0.7.1 (after going through "version" problem during installation) with unified client and I get the same error. If one node in the 2-node cluster is down, cannot connect/access the running node. Thus, the cluster is unavailable!!!

Thanks,

Top
  • Login or register to post comments
Wed, 08/08/2012 - 11:43
BigBlueHat
Offline
Joined: 01/28/2011
Groups: None

Sorry for the trouble, fm. I've filed a bug for it (PYCBC-54). We can track progress there.

Thanks for reporting this, fm.

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