Python client: Error while using Protocol Buffer Interface

Ishwar ishwarsridharan at
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 = {}
            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/", line 22, in get
    post = bucket.get(key)
  File "/usr/local/lib/python2.6/dist-packages/riak-1.2.1-py2.6.egg/riak/", line 245, in get
    return obj.reload(r)
  File "/usr/local/lib/python2.6/dist-packages/riak-1.2.1-py2.6.egg/riak/", 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/", 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/", line 349, in recv_msg
  File "/usr/local/lib/python2.6/dist-packages/riak-1.2.1-py2.6.egg/riak/transports/", 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.


Just another resurrected Neozoic Archosaur comics.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: local.haproxy.conf
Type: application/octet-stream
Size: 980 bytes
Desc: not available
URL: <>

More information about the riak-users mailing list