yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #71200
[Bug 1749983] Re: Unhelpful error message when trying to force detach and content-type header is missing
Added nova since it has the exact same code.
** Also affects: nova
Importance: Undecided
Status: New
** Changed in: nova
Status: New => Confirmed
** Changed in: nova
Importance: Undecided => Low
** Changed in: nova
Assignee: (unassigned) => Matt Riedemann (mriedem)
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1749983
Title:
Unhelpful error message when trying to force detach and content-type
header is missing
Status in Cinder:
In Progress
Status in OpenStack Compute (nova):
In Progress
Bug description:
I was trying to force detach a volume using curl like so:
curl -d '{"os-force_detach": {}}' -H "accept: application/json" -H "x
-auth-token: $token"
http://199.204.45.19/volume/v3/e9d773beeef2435eb59f7c6eeaf685a9/volumes/126c8d4b-c582
-484a-8c09-fe901a7dc17f/action
And I'd get this error message back:
{"badRequest": {"message": "There is no such action: None", "code":
400}}
When I dug into the cinder-api logs, I saw this:
Feb 16 16:08:49 queens devstack@c-api.service[1549]: DEBUG
cinder.api.openstack.wsgi [None req-c7279a60-f7ba-
4a11-98f2-8fa2b2ec281d demo demo] Unrecognized Content-Type provided
in request {{(pid=1723) get_body
/opt/stack/cinder/cinder/api/openstack/wsgi.py:724}}
Changing the 'accept' header to 'content-type' fixed it:
curl -d '{"os-force_detach": {}}' -H "content-type: application/json"
-H "x-auth-token: $token"
http://199.204.45.19/volume/v3/e9d773beeef2435eb59f7c6eeaf685a9/volumes/126c8d4b-c582
-484a-8c09-fe901a7dc17f/action
I get a policy error since I'm not an admin (default policy rule on
this API is admin-only), but it went through properly:
{"forbidden": {"message": "Policy doesn't allow
volume_extension:volume_admin_actions:force_detach to be performed.",
"code": 403}}
The bug is that the missing content-type results in a very unhelpful
error message.
To manage notifications about this bug go to:
https://bugs.launchpad.net/cinder/+bug/1749983/+subscriptions