500 occurs when making a reboot request without the type field

Bug #1247735 reported by Daryl Walleck
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Adrien Cunin

Bug Description

By accident, I tried to perform a reboot via the API without passing the type field, which returned a 500. On further investigation, it appears that there may not be a check if the reboot type field is None before making the upper call on the value:

2013-11-04 06:20:13.936 DEBUG nova.api.openstack.wsgi [req-2a11d741-2988-4b8f-af9f-81282790d3c9 auto auto] Action: 'action', body: {"reboot": {"type": null}} from (pid=18212) _process_stack /opt/stack/nova/nova/api/openstack/wsgi.py:962
2013-11-04 06:20:13.937 DEBUG nova.api.openstack.wsgi [req-2a11d741-2988-4b8f-af9f-81282790d3c9 auto auto] Calling method <bound method Controller._action_reboot of <nova.api.openstack.compute.contrib.keypairs.Controller object at 0x3c8bf10>> from (pid=18212) _process_stack /opt/stack/nova/nova/api/openstack/wsgi.py:963
2013-11-04 06:20:13.937 ERROR nova.api.openstack [req-2a11d741-2988-4b8f-af9f-81282790d3c9 auto auto] Caught error: 'NoneType' object has no attribute 'upper'
2013-11-04 06:20:13.941 INFO nova.api.openstack [req-2a11d741-2988-4b8f-af9f-81282790d3c9 auto auto] http://127.0.0.1:8774/v2/400db056ab16454fa4c7c2fe987dafc4/servers/6d897db9-b4f2-459f-95a4-0ad264e87334/action returned with HTTP 500
2013-11-04 06:20:13.941 DEBUG nova.api.openstack.wsgi [req-2a11d741-2988-4b8f-af9f-81282790d3c9 auto auto] Returning 500 to user: The server has either erred or is incapable of performing the requested operation. from (pid=18212) __call__ /opt/stack/nova/nova/api/openstack/wsgi.py:1224
2013-11-04 06:20:13.942 INFO nova.osapi_compute.wsgi.server [req-2a11d741-2988-4b8f-af9f-81282790d3c9 auto auto] 72.32.115.230 "POST /v2/400db056ab16454fa4c7c2fe987dafc4/servers/6d897db9-b4f2-459f-95a4-0ad264e87334/action HTTP/1.1" status: 500 len: 335 time: 0.1340361

Daryl Walleck (dwalleck)
description: updated
Adrien Cunin (adri2000)
Changed in nova:
status: New → In Progress
assignee: nobody → Adrien Cunin (adri2000)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/57487
Committed: http://github.com/openstack/nova/commit/67962468a7c1975ed68750e94340cfda0267b74f
Submitter: Jenkins
Branch: master

commit 67962468a7c1975ed68750e94340cfda0267b74f
Author: Adrien Cunin <email address hidden>
Date: Wed Nov 20 17:41:19 2013 +0100

    Check if reboot request type is None

    If the reboot request type is None, raise HTTPBadRequest like if the
    argument was missing.

    Change-Id: I75b1791b7a6c9304c3a78e869fe63d72302fc9d8
    Closes-Bug: #1247735

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-2
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-2 → 2014.1
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.