Python client: Error while using Protocol Buffer Interface

Ishwar ishwarsridharan at yahoo.com
Thu Apr 7 10:24:08 EDT 2011


Hello Riak folks,

We have a 3-node riak cluster on my local box with haproxy load balancer running on port 9190 for the riak cluster. I've attached the haproxy conf file for your reference.


We use riak-python-client to connect to Riak. While connecting through the HTTP interface, the riak client works fine. When I try to connect through the Protocol Buffer Interface, it throws exception.

Here's an excerpt from the code:
    def get(self, keys):
        #client = riak.RiakClient()
        client = riak.RiakClient(port=9190, transport_class=riak.RiakPbcTransport)
        bucket = client.bucket('test1')
        ret = {}
        try:
            for key in keys:        
                post = bucket.get(key)
                ret[key] = post.get_data()
            return ret
        except Exception, e:
            print  traceback.format_exc()
            return False

and here's the stack trace.
Traceback (most recent call last):
  File "/home/ishwar/workspace/TestRiak/src/HelloWorld.py", line 22, in get
    post = bucket.get(key)
  File "/usr/local/lib/python2.6/dist-packages/riak-1.2.1-py2.6.egg/riak/bucket.py", line 245, in get
    return obj.reload(r)
  File "/usr/local/lib/python2.6/dist-packages/riak-1.2.1-py2.6.egg/riak/riak_object.py", line 290, in reload
    Result = t.get(self, r, vtag)
  File "/usr/local/lib/python2.6/dist-packages/riak-1.2.1-py2.6.egg/riak/transports/pbc.py", line 157, in get
    msg_code, resp = self.recv_msg()
  File "/usr/local/lib/python2.6/dist-packages/riak-1.2.1-py2.6.egg/riak/transports/pbc.py", line 349, in recv_msg
    self.recv_pkt()
  File "/usr/local/lib/python2.6/dist-packages/riak-1.2.1-py2.6.egg/riak/transports/pbc.py", line 401, in recv_pkt
    format(len(self._inbuf), self._inbuf_len))
RiakError: 'Socket returned short packet 135 - expected 1213486160'

Is this a problem with my haproxy config file or is there something wrong with riak settings? I'd be glad to share the output of logs if needed.
--
Thanks for the help.

Ishwar


Just another resurrected Neozoic Archosaur comics.
http://www.flickr.com/photos/mojosaurus/sets/72157600257724083/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20110407/1b1e81a2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: local.haproxy.conf
Type: application/octet-stream
Size: 980 bytes
Desc: not available
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20110407/1b1e81a2/attachment.conf>


More information about the riak-users mailing list