python client Broken pipe when one node is down
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
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,
Sorry for the trouble, fm. I've filed a bug for it (PYCBC-54). We can track progress there.
Thanks for reporting this, fm.
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:
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!