List Services - NON ASCII limit causes poppy to return 500

Bug #1384271 reported by Malini Kamalambal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Poppy
Fix Released
Medium
Obulapathi

Bug Description

Steps to Repro: Run the test https://github.com/stackforge/poppy/blob/master/tests/api/services/test_services.py#L178

Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py", line 85, in run
    self.result = application(self.environ, self.start_response)
  File "/Users/malini.kamalambal/github/poppyenv/lib/python2.7/site-packages/pecan/middleware/recursive.py", line 56, in __call__
    return self.application(environ, start_response)
  File "/Users/malini.kamalambal/github/poppyenv/lib/python2.7/site-packages/pecan/core.py", line 750, in __call__
    return super(Pecan, self).__call__(environ, start_response)
  File "/Users/malini.kamalambal/github/poppyenv/lib/python2.7/site-packages/pecan/core.py", line 645, in __call__
    e
  File "/Users/malini.kamalambal/github/poppyenv/lib/python2.7/site-packages/pecan/core.py", line 773, in handle_hooks
    return super(Pecan, self).handle_hooks(hooks, *args, **kw)
  File "/Users/malini.kamalambal/github/poppyenv/lib/python2.7/site-packages/pecan/core.py", line 317, in handle_hooks
    result = getattr(hook, hook_type)(*args)
  File "/Users/malini.kamalambal/github/poppy/poppy/transport/pecan/hooks/error.py", line 55, in on_error
    message['message'] = str(exception)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 15-16: ordinal not in range(128)
1.0.0.127.in-addr.arpa - - [22/Oct/2014 10:01:04] "GET /v1.0/services?limit=%E5%AD%A6%E6%A0%A1 HTTP/1.1" 500 59
2014-10-22 10:01:04.026 4340 ERROR poppy.transport.pecan.hooks.error [req-b6f3bb11-0f3c-486d-b8bc-c64d68e0b000 - 650278 - - -] Exception message: Invalid limit:

See test logs,

root: INFO: ========================================================
root: INFO: Test Case....: test_list_services_invalid_limits_6_______
root: INFO: Created At...: 2014-10-22 10:01:03.546432
root: INFO: No Test description.
root: INFO: ========================================================
cafe.engine.http.client: DEBUG: (<tests.api.utils.client.PoppyClient object at 0x101319990>, 'GET', 'http://0.0.0.0:8888/v1.0/services') {'headers': {'Content-Type': 'application/json', 'X-Project-Id': u'650278', 'X-Auth-Token': u'6f2a4ebe6f3a438d89422fde3dc05d82'}, 'params': {'limit': '\xe5\xad\xa6\xe6\xa0\xa1'}, 'verify': False, 'data': None}
requests.packages.urllib3.connectionpool: INFO: Starting new HTTP connection (1): 0.0.0.0
requests.packages.urllib3.connectionpool: DEBUG: "GET /v1.0/services?limit=%E5%AD%A6%E6%A0%A1 HTTP/1.1" 500 59
cafe.engine.http.client: DEBUG:
------------
REQUEST SENT
------------
request method..: GET
request url.....: http://0.0.0.0:8888/v1.0/services
request params..: limit=%E5%AD%A6%E6%A0%A1
request headers.: {'Accept-Encoding': 'gzip, deflate', 'X-Project-Id': u'650278', 'Accept': '*/*', 'X-Auth-Token': u'6f2a4ebe6f3a438d89422fde3dc05d82', 'Connection': 'keep-alive', 'User-Agent': 'python-requests/2.4.1 CPython/2.7.1 Darwin/11.4.2', 'Content-Type': 'application/json'}
request body....: None

cafe.engine.http.client: DEBUG:
-----------------
RESPONSE RECEIVED
-----------------
response status..: <Response [500]>
response time....: 0.00837707519531
response headers.: {'date': 'Wed, 22 Oct 2014 14:01:04 GMT', 'content-length': '59', 'content-type': 'text/plain', 'server': 'WSGIServer/0.1 Python/2.7.1'}
response body....: A server error occurred. Please contact the administrator.

Changed in poppy:
importance: Undecided → Medium
assignee: nobody → Obulapathi (obulpathi)
status: New → Triaged
description: updated
Obulapathi (obulpathi)
Changed in poppy:
status: Triaged → Confirmed
Changed in poppy:
status: Confirmed → Fix Released
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.