Error responses are double JSON encoded
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ironic |
Triaged
|
Medium
|
Unassigned |
Bug Description
Error responses from the Ironic API return as a double JSON encoded error message. An example of this is: {"error_message": "{\"debuginfo\": null, \"faultcode\": \"Client\", \"faultstring\": \"The requested action \\\"provide\\\" can not be performed on node \\\"7c b3fb9f-
The JSON dictionary inside of error_message does not need to be string encoded, this results in applications consuming the API to have to decode the outer body of the response and then (and only if the error_message exists) decode again the internal body of the message.
Even our own python-ironicclient falls victim to this: https:/
After some investigation it appears the response ends up encoded this way because of two separate places: https:/
and
https:/
The first place creates the
{\"debuginfo\": null, \"faultcode\": \"Client\", \"faultstring\": \"The requested action \\\"provide\\\" can not be performed on node \\\"7c b3fb9f-
body, and then the middleware wraps it the second time.
description: | updated |
Changed in ironic: | |
importance: | Undecided → Medium |
status: | New → Triaged |
Changed in ironic: | |
assignee: | nobody → Ramamani Yeleswarapu (ramamani-yeleswarapu) |
Changed in ironic: | |
assignee: | Ramamani Yeleswarapu (ramamani-yeleswarapu) → nobody |
Changed in ironic: | |
assignee: | nobody → Abdallah Banishamsa (abdallahb) |
Changed in ironic: | |
assignee: | nobody → Afonne-CID (cidelight) |
Changed in ironic: | |
status: | In Progress → Triaged |
assignee: | Afonne-CID (cidelight) → nobody |
Hi! Unassigning this bug after nearly 2 months of inactivity.