Internal error in case of MalformedRequestBody

Bug #1423369 reported by Andrew Lazarev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sahara
Fix Released
Medium
Andrew Lazarev

Bug Description

Steps to reproduce:
1. Send malformed request to Sahara

Observed behavior: 500 error with { "error_message": "format requires a mapping"} message

Stacktrace:

2015-02-18 14:22:44.640 8687 TRACE sahara.api File "/Users/alazarev/openstack/sahara/sahara/utils/wsgi.py", line 243, in _from_json
2015-02-18 14:22:44.640 8687 TRACE sahara.api raise exceptions.MalformedRequestBody(msg)
2015-02-18 14:22:44.640 8687 TRACE sahara.api File "/Users/alazarev/openstack/sahara/sahara/exceptions.py", line 330, in __init__
2015-02-18 14:22:44.640 8687 TRACE sahara.api self.message = self.message % reason
2015-02-18 14:22:44.640 8687 TRACE sahara.api File "/Users/alazarev/openstack/sahara/.tox/venv/lib/python2.7/site-packages/oslo_i18n/_message.py", line 112, in __mod__
2015-02-18 14:22:44.640 8687 TRACE sahara.api unicode_mod = super(Message, self).__mod__(params)
2015-02-18 14:22:44.640 8687 TRACE sahara.api TypeError: format requires a mapping

Cause:

Issue was introduced in https://review.openstack.org/#/c/153526/
Here is code with bug:

class MalformedRequestBody(SaharaException):
    message = _("Malformed message body: %(reason)s")

    def __init__(self, reason):
        self.message = self.message % reason

Changed in sahara:
status: New → Confirmed
assignee: nobody → Andrew Lazarev (alazarev)
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to sahara (master)

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

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

Reviewed: https://review.openstack.org/157176
Committed: https://git.openstack.org/cgit/openstack/sahara/commit/?id=f831a3f563cd18c6c14377d6706d9047c13f0d54
Submitter: Jenkins
Branch: master

commit f831a3f563cd18c6c14377d6706d9047c13f0d54
Author: Andrew Lazarev <email address hidden>
Date: Wed Feb 18 14:32:06 2015 -0800

    Fixed format mapping in MalformedRequestBody

    Change-Id: I3039b95b7564098fc36f8a46a4238a90e227f307
    Closes-Bug: #1423369

Changed in sahara:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in sahara:
milestone: none → kilo-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in sahara:
milestone: kilo-3 → 2015.1.0
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.