503 when passing big binary in request

Bug #1408102 reported by Amit Gandhi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Poppy
Fix Released
Medium
Amit Gandhi
pecan
Fix Released
Medium
Ryan Petrello

Bug Description

when passing a big binary in body of request

When supplying a big binary in the body of a create service request the server responds with a 503:

POST
/v1.0/services

Request body:

{Submit Binary Data}

Error Stack Trace:

Traceback (most recent call last):
File "/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/amit.gandhi/GitHub/poppy/venv/lib/python2.7/site-packages/pecan/middleware/recursive.py", line 56, in _call_
return self.application(environ, start_response)
File "/Users/amit.gandhi/GitHub/poppy/venv/lib/python2.7/site-packages/pecan/core.py", line 805, in _call_
return super(Pecan, self)._call_(environ, start_response)
File "/Users/amit.gandhi/GitHub/poppy/venv/lib/python2.7/site-packages/pecan/core.py", line 653, in _call_
controller, args, kwargs = self.find_controller(state)
File "/Users/amit.gandhi/GitHub/poppy/venv/lib/python2.7/site-packages/pecan/core.py", line 823, in find_controller
controller, args, kw = super(Pecan, self).find_controller(_state)
File "/Users/amit.gandhi/GitHub/poppy/venv/lib/python2.7/site-packages/pecan/core.py", line 440, in find_controller
controller, remainder = self.route(req, self.root, path)
File "/Users/amit.gandhi/GitHub/poppy/venv/lib/python2.7/site-packages/pecan/core.py", line 277, in route
node, remainder = lookup_controller(node, path, req)
File "/Users/amit.gandhi/GitHub/poppy/venv/lib/python2.7/site-packages/pecan/routing.py", line 49, in lookup_controller
request)
File "/Users/amit.gandhi/GitHub/poppy/venv/lib/python2.7/site-packages/pecan/routing.py", line 145, in find_object
next_obj, next_remainder = route(remainder, request)
File "/Users/amit.gandhi/GitHub/poppy/poppy/transport/pecan/controllers/root.py", line 45, in _route
return super(RootController, self)._route(args, request)
File "/Users/amit.gandhi/GitHub/poppy/venv/lib/python2.7/site-packages/pecan/rest.py", line 73, in _route
method = request.params.get('_method', request.method).lower()
File "/Users/amit.gandhi/GitHub/poppy/venv/lib/python2.7/site-packages/webob/request.py", line 832, in params
params = NestedMultiDict(self.GET, self.POST)
File "/Users/amit.gandhi/GitHub/poppy/venv/lib/python2.7/site-packages/webob/request.py", line 783, in POST
vars = MultiDict.from_fieldstorage(fs)
File "/Users/amit.gandhi/GitHub/poppy/venv/lib/python2.7/site-packages/webob/multidict.py", line 92, in from_fieldstorage
obj.add(field.name, decode(value))
File "/Users/amit.gandhi/GitHub/poppy/venv/lib/python2.7/site-packages/webob/multidict.py", line 78, in <lambda>
decode = lambda b: b.decode(charset)
File "/Users/amit.gandhi/GitHub/poppy/venv/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xa2 in position 0: invalid start byte

Changed in poppy:
status: Confirmed → Invalid
importance: Medium → Undecided
Revision history for this message
Amit Gandhi (amit-gandhi) wrote :

this is handled by repose limits. Outside the scope of poppy.

Revision history for this message
Amit Gandhi (amit-gandhi) wrote :

This appears to be a bug in Pecan handling

Changed in poppy:
status: Invalid → Confirmed
description: updated
Changed in poppy:
importance: Undecided → Medium
Changed in pecan:
importance: Undecided → Low
importance: Low → Medium
assignee: nobody → Ryan Petrello (ryan-petrello)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to pecan (master)

Fix proposed to branch: master
Review: https://review.openstack.org/145614

Changed in pecan:
status: New → In Progress
Changed in poppy:
assignee: nobody → Amit Gandhi (amit-gandhi)
Revision history for this message
Amit Gandhi (amit-gandhi) wrote :

confirmed that the pecan fix proposed fixes the issue

Changed in poppy:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to pecan (master)

Reviewed: https://review.openstack.org/145614
Committed: https://git.openstack.org/cgit/stackforge/pecan/commit/?id=f491076a0f1b9f080c139a8062c9481e8024d8cb
Submitter: Jenkins
Branch: master

commit f491076a0f1b9f080c139a8062c9481e8024d8cb
Author: Ryan Petrello <email address hidden>
Date: Wed Jan 7 17:34:21 2015 -0500

    Change pecan to more gracefully handle a few odd request encoding edge cases.

    Webob raises UnicodeDecodeErrors during request argument parsing in two
    situations:
        * HTTP POST requests composed of non-Unicode data (only affects Webob in
          Python2)
        * URL paths that contain invalid percent-encoded characters, e.g.,
          /some/path/%AA

    Pecan should detect these types of decoding failures when `webob.Request`
    attributes are accessed, log the original exception, and coerce the HTTP 500
    into a more accurate HTTP 400.

    Fixes bug: 1408102
    Fixes bug: 1407749

    Change-Id: I734efd36230b6742805bcfd801dc0de2489ef92b

Changed in pecan:
status: In Progress → Fix Committed
Changed in pecan:
status: Fix Committed → Fix Released
Changed in poppy:
status: In Progress → 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.