Could not get response from python riak

Naveen Tamanam naveen32india at
Fri Oct 25 18:29:52 EDT 2013

Hi All,

I am using the riak with python/django.

Sometimes I am getting the error  "Could not get response"

I am using Djang*o 1.5
Python riak-1.5.2

The error description is as follows;


Django Version: 1.5
Python Version: 2.6.6
Installed Applications:
Installed Middleware:

in get_response
115. response = callback(request, *callback_args, **callback_kwargs)
File "/opt/backend/mobichat/userapp/" in editCamp
100. campinfo = helpers.getCampinfoForTemplating(request, url=key)
File "/opt/backend/mobichat/userapp/" in getCampinfoForTemplating
213. campinfo['logo_url'], campinfo['logo_name'] = CampaignLogoPath.get(url)
File "/opt/backend/mobichat/common/riak_backend/" in get
1806. obj = cls.bucket.get(camp_uid)
File "/usr/lib/python2.6/site-packages/riak-1.5.2-py2.6.egg/riak/"
in get
326. return obj.reload(r=r, pr=pr)
in reload
459. Result = t.get(self, r=r, pr=pr, vtag=vtag)
in get
152. response = self.http_request('GET', url)
in http_request
626. raise RiakError("could not get a response")

Exception Type: RiakError at /manager/camp-edit/EHbo24hFYDZGsg8ujpY9itDtM2a
Exception Value: 'could not get a response'

Any body please help me out  to fix the above issue.

I see the riak source code

Moudle is at  riak-1.5.2-py2.6.egg/riak/transports/

The function where that is coming is as follows

    def http_request(self, method, uri, headers=None, body=''):
        Given a Method, URL, Headers, and Body, perform and HTTP request,
        and return a 2-tuple containing a dictionary of response headers
        and the response body.
        if headers is None:
            headers = {}
        # Run the request...
        for retry in range(self.RETRY_COUNT):
            with self._conns.withconn() as conn:
                ### should probably build this try/except into a custom
                ### contextmanager for the connection.
                    conn.request(method, uri, body, headers)
                    response = conn.getresponse()

                        # Get the response headers...
                        response_headers = {'http_code': response.status}
                        for (key, value) in response.getheaders():
                            response_headers[key.lower()] = value

                        # Get the body...
                        response_body =

                    return response_headers, response_body
                except socket.error, e:
                    if e[0] == errno.ECONNRESET:
                        # Grab another connection and try again.
                    # Don't know how to handle this.
                except httplib.HTTPException:
                    # Just close the connection and try again.

        # No luck, even with retrying.
        raise RiakError("could not get a response")

At line number 626 in  riak/transport/
where http_requst is at   http.RiakHttpTransport.http_request

This is error is coming very often.  For what reason it is coming and how
to get permanent solution for this error .

Thanks & Regards,
Naveen Tamanam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the riak-users mailing list