Malformed XML request body causes 500 error

Bug #814012 reported by Salvatore Orlando
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
dan wendlandt
quantum (Ubuntu)
Fix Released
Undecided
Unassigned
Nominated for Precise by Yolanda Robla

Bug Description

When using Quantum API with XML format, if the request body is not a well-formed XML string, an exception is raised resulting in a 500 error.

Quantum API should return a 400 error (BadRequest).

Stacktrace available at: paste.openstack.org/show/1922

Related branches

Changed in quantum:
assignee: nobody → Salvatore Orlando (salvatore-orlando)
Revision history for this message
dan wendlandt (danwent) wrote :

Salvatore, is there a particular unit test that is failing here? If so, could you call out the test by name? Or are you looking for someone to write the test and fix the bug?

Revision history for this message
Salvatore Orlando (salvatore-orlando) wrote :

Dan,
I gave the wrong bug id in yesterday meeting. The ones that still cause failures in unit tests are bug #814517 (already fixed by Tyler, merge proposed), and bug #814518.

This bug is related to a minor undesired behaviour of the API, as a 500 error is returned whereas a 400 error would have been more suitable. I think a unit test for proving it fixed the bug should be provided as well.

Salvatore

Revision history for this message
dan wendlandt (danwent) wrote :

Ok, I fixed this bug anyway, and will merge prop it for your review.

I'm take a look to see where this fits naturally into the existing unit tests.

Changed in quantum:
assignee: Salvatore Orlando (salvatore-orlando) → dan wendlandt (danwent)
Revision history for this message
Salvatore Orlando (salvatore-orlando) wrote :

The unit tests should be very similar to the *_bad_request tests, witht he only exception that the body should not be valid JSON/XML data. A body containing some random characters would be perfect.

Revision history for this message
dan wendlandt (danwent) wrote :

It seems like adding the test was a bit more complicated than that, otherwise the code that serializes the request chokes before the unparsed data is passed to the API server. Let me know what you think about this branch.

https://code.launchpad.net/~danwent/quantum/bug814012

Changed in quantum:
status: New → Fix Committed
Changed in quantum:
importance: Undecided → Low
dan wendlandt (danwent)
Changed in quantum:
status: Fix Committed → Fix Released
Changed in quantum (Ubuntu):
status: New → 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.