Could not get response from python riak

Naveen Tamanam naveen32india at gmail.com
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:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
)
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')

Traceback:
File
"/usr/lib/python2.6/site-packages/Django-1.5-py2.6.egg/django/core/handlers/base.py"
in get_response
115. response = callback(request, *callback_args, **callback_kwargs)
File "/opt/backend/mobichat/userapp/edit_views.py" in editCamp
100. campinfo = helpers.getCampinfoForTemplating(request, url=key)
File "/opt/backend/mobichat/userapp/helpers.py" in getCampinfoForTemplating
213. campinfo['logo_url'], campinfo['logo_name'] = CampaignLogoPath.get(url)
File "/opt/backend/mobichat/common/riak_backend/riak_backend.py" in get
1806. obj = cls.bucket.get(camp_uid)
File "/usr/lib/python2.6/site-packages/riak-1.5.2-py2.6.egg/riak/bucket.py"
in get
326. return obj.reload(r=r, pr=pr)
File
"/usr/lib/python2.6/site-packages/riak-1.5.2-py2.6.egg/riak/riak_object.py"
in reload
459. Result = t.get(self, r=r, pr=pr, vtag=vtag)
File
"/usr/lib/python2.6/site-packages/riak-1.5.2-py2.6.egg/riak/transports/http.py"
in get
152. response = self.http_request('GET', url)
File
"/usr/lib/python2.6/site-packages/riak-1.5.2-py2.6.egg/riak/transports/http.py"
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/http.py

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.
                try:
                    conn.request(method, uri, body, headers)
                    response = conn.getresponse()

                    try:
                        # 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 = response.read()
                    finally:
                        response.close()

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

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


At line number 626 in  riak/transport/http.py
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: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20131026/1fa54874/attachment.html>


More information about the riak-users mailing list