HTTP 500 raised by POST /shares API when failing to handle "share_type" in request
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Shared File Systems Service (Manila) |
Fix Released
|
Low
|
melaku alehegn |
Bug Description
Description
===========
The POST /shares API [1] does not validate the "share_type" as expected. If the request contains an object instead of a string, HTTP 500 is raised due to a DB lookup error:
Example Request:
POST https:/
Body: {"share": {"share_proto": "cephfs", "description": "share-
Log from the failure: https:/
Steps to reproduce
==================
A chronological list of steps which will help reproduce the issue you hit:
* curl -i -X POST $MANILA_ENDPOINT -H "X-Auth-Token: $TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"share": {"size": 1, "share_proto": "nfs", "share_type": {"id": "9b158411-
Expected result
===============
HTTP 400, BadRequest - the share_type parameter was badly formatted
Actual result
=============
HTTP 500, Internal Server Error
Environment
===========
1. dev branch of openstack/manila
[1] https:/
tags: | added: low-hanging-fruit |
tags: | added: api |
Changed in manila: | |
assignee: | nobody → Elena Lindqvist (eqvist) |
Changed in manila: | |
assignee: | Elena Lindqvist (eqvist) → nobody |
Changed in manila: | |
assignee: | nobody → Yuchen Zhang (yuchenz-ubuntu) |
Changed in manila: | |
importance: | Undecided → Low |
Changed in manila: | |
assignee: | Yuchen Zhang (yuchenz-ubuntu) → nobody |
Changed in manila: | |
assignee: | nobody → Goutham Pacha Ravi (gouthamr) |
Changed in manila: | |
assignee: | Goutham Pacha Ravi (gouthamr) → nobody |
assignee: | nobody → Shazia Parveen (sparveen) |
Changed in manila: | |
assignee: | Shazia Parveen (sparveen) → nobody |
status: | In Progress → New |
status: | New → Confirmed |
Changed in manila: | |
status: | Confirmed → In Progress |
Changed in manila: | |
status: | In Progress → New |
Changed in manila: | |
status: | New → Triaged |
Changed in manila: | |
assignee: | nobody → melaku alehegn (melakua) |
milestone: | none → caracal-1 |
Changed in manila: | |
status: | Triaged → In Progress |
Fix proposed to branch: master /review. opendev. org/c/openstack /manila/ +/858214
Review: https:/