novaclient unexpected tokenizing input error

Bug #1042975 reported by Mark Gius
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-novaclient
Expired
Medium
Unassigned

Bug Description

Novaclient handles unexpected connection close very poorly. The error I get is

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (81, 0))

A full stacktrace will be included as a comment below.

How to reproduce:

Setup Nova-compute-api behind HAPoxy with a client timeout of X seconds.

Connect to nova-api through HAProxy, then wait > X seconds.

Issue any API request, get error message above.

Note that this issue is not caused by HAProxy, it's just what we're using and is a convenient way of forcing disconnections.

Novaclient should attempt to re-establish a connection if it gets terminated, or at the very least should display a useful error message, as the current error is misleading.

Revision history for this message
Mark Gius (markgius) wrote :

In [43]: nova_client.servers.list()ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (81, 0))

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (12, 0))

---------------------------------------------------------------------------
BadRequest Traceback (most recent call last)

/home/mgius/src/maestro/tests/integration/<ipython console> in <module>()

/usr/lib/python2.7/dist-packages/novaclient/v1_1/servers.pyc in list(self, detailed, search_opts)
    277 if detailed:
    278 detail = "/detail"
--> 279 return self._list("/servers%s%s" % (detail, query_string), "servers")
    280
    281 def add_fixed_ip(self, server, network_id):

/usr/lib/python2.7/dist-packages/novaclient/base.pyc in _list(self, url, response_key, obj_class, body)
     69 resp, body = self.api.client.post(url, body=body)
     70 else:
---> 71 resp, body = self.api.client.get(url)
     72
     73 if obj_class is None:

/usr/lib/python2.7/dist-packages/novaclient/client.pyc in get(self, url, **kwargs)
    134
    135 def get(self, url, **kwargs):
--> 136 return self._cs_request(url, 'GET', **kwargs)
    137
    138 def post(self, url, **kwargs):

/usr/lib/python2.7/dist-packages/novaclient/client.pyc in _cs_request(self, url, method, **kwargs)
    122
    123 resp, body = self.request(self.management_url + url, method,
--> 124 **kwargs)
    125 return resp, body
    126 except exceptions.Unauthorized, ex:

/usr/lib/python2.7/dist-packages/novaclient/client.pyc in request(self, *args, **kwargs)
    105
    106 if resp.status in (400, 401, 403, 404, 408, 409, 413, 500, 501):
--> 107 raise exceptions.from_response(resp, body)
    108
    109 return resp, body

BadRequest: n/a (HTTP 400)

Revision history for this message
Mark Gius (markgius) wrote :

This is probably only a problem for those using novaclient from an interactive shell, although I suppose if there is heavy caching of clients somewhere this could also be the case.

melanie witt (melwitt)
Changed in python-novaclient:
importance: Undecided → Medium
status: New → Confirmed
ashwini (mashu97)
Changed in python-novaclient:
assignee: nobody → ashwini (mashu97)
assignee: ashwini (mashu97) → nobody
Revision history for this message
Takashi Natsume (natsume-takashi) wrote :

This bug has been open for about 5 years without any activity.
It is not sure that this bug can be reproduced in python-novaclient latest version.
I'm going to move it to "Incomplete".
This bug can be reopened (set back to "New") if this bug can be reproduced in python-novaclient latest version or someone decides to work on this.

Changed in python-novaclient:
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for python-novaclient because there has been no activity for 60 days.]

Changed in python-novaclient:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.