HTTP 500 response when get_console_output or start,stop action called before host set

Bug #1116012 reported by Zhou ShaoYu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Zhou ShaoYu

Bug Description

If instance host was not set, actions such as request console output or start, stop the instance cause HTTP 500 response.

2013-02-05 14:05:42 ERROR nova.api.openstack [req-36bc6ade-bf56-4a5b-a913-1195b75040e8 0732bcc6b79b44058498feedbb957763 12ed8c7f70fb48018cdbf3aa60503541] Caught error: Unable to find host for Instance 5116bdf5-4cbe-4bd1-96d4-1534b22a010f2013-02-05 14:05:42 TRACE nova.api.openstack Traceback (most recent call last):
2013-02-05 14:05:42 TRACE nova.api.openstack File "path/nova/api/openstack/__init__.py", line 78, in __call__
2013-02-05 14:05:42 TRACE nova.api.openstack return req.get_response(self.application)
2013-02-05 14:05:42 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1053, in get_response
2013-02-05 14:05:42 TRACE nova.api.openstack application, catch_exc_info=False)
2013-02-05 14:05:42 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1022, in call_application
2013-02-05 14:05:42 TRACE nova.api.openstack app_iter = application(self.environ, start_response)
2013-02-05 14:05:42 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
2013-02-05 14:05:42 TRACE nova.api.openstack return resp(environ, start_response)
2013-02-05 14:05:42 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/keystone/middleware/auth_token.py", line 278, in __call__
2013-02-05 14:05:42 TRACE nova.api.openstack return self.app(env, start_response)
2013-02-05 14:05:42 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
2013-02-05 14:05:42 TRACE nova.api.openstack return resp(environ, start_response)
2013-02-05 14:05:42 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
2013-02-05 14:05:42 TRACE nova.api.openstack return resp(environ, start_response)
2013-02-05 14:05:42 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
2013-02-05 14:05:42 TRACE nova.api.openstack return resp(environ, start_response)
2013-02-05 14:05:42 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/routes/middleware.py", line 131, in __call__
2013-02-05 14:05:42 TRACE nova.api.openstack response = self.app(environ, start_response)
2013-02-05 14:05:42 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
2013-02-05 14:05:42 TRACE nova.api.openstack return resp(environ, start_response)
2013-02-05 14:05:42 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
2013-02-05 14:05:42 TRACE nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2013-02-05 14:05:42 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 208, in call_func
2013-02-05 14:05:42 TRACE nova.api.openstack return self.func(req, *args, **kwargs)
2013-02-05 14:05:42 TRACE nova.api.openstack File "path/nova/api/openstack/wsgi.py", line 885, in __call__
2013-02-05 14:05:42 TRACE nova.api.openstack content_type, body, accept)
2013-02-05 14:05:42 TRACE nova.api.openstack File "path/nova/api/openstack/wsgi.py", line 933, in _process_stack
2013-02-05 14:05:42 TRACE nova.api.openstack action_result = self.dispatch(meth, request, action_args)
2013-02-05 14:05:42 TRACE nova.api.openstack File "path/nova/api/openstack/wsgi.py", line 1021, in dispatch
2013-02-05 14:05:42 TRACE nova.api.openstack return method(req=request, **action_args)
2013-02-05 14:05:42 TRACE nova.api.openstack File "path/nova/api/openstack/compute/contrib/server_start_stop.py", line 56, in _stop_server
2013-02-05 14:05:42 TRACE nova.api.openstack self.compute_api.stop(context, instance)
2013-02-05 14:05:42 TRACE nova.api.openstack File "path/nova/compute/api.py", line 116, in wrapped
2013-02-05 14:05:42 TRACE nova.api.openstack return func(self, context, target, *args, **kwargs)
2013-02-05 14:05:42 TRACE nova.api.openstack File "path/nova/compute/api.py", line 106, in inner
2013-02-05 14:05:42 TRACE nova.api.openstack return function(self, context, instance, *args, **kwargs)
2013-02-05 14:05:42 TRACE nova.api.openstack File "path/nova/compute/api.py", line 96, in inner
2013-02-05 14:05:42 TRACE nova.api.openstack return f(self, context, instance, *args, **kw)
2013-02-05 14:05:42 TRACE nova.api.openstack File "path/nova/compute/api.py", line 1176, in stop
2013-02-05 14:05:42 TRACE nova.api.openstack self.compute_rpcapi.stop_instance(context, instance, cast=do_cast)
2013-02-05 14:05:42 TRACE nova.api.openstack File "path/nova/compute/rpcapi.py", line 487, in stop_instance
2013-02-05 14:05:42 TRACE nova.api.openstack topic=_compute_topic(self.topic, ctxt, None, instance))
2013-02-05 14:05:42 TRACE nova.api.openstack File "path/nova/compute/rpcapi.py", line 48, in _compute_topic
2013-02-05 14:05:42 TRACE nova.api.openstack 'Instance %s') % instance['uuid'])
2013-02-05 14:05:42 TRACE nova.api.openstack NovaException: Unable to find host for Instance 5116bdf5-4cbe-4bd1-96d4-1534b22a010f
2013-02-05 14:05:42 TRACE nova.api.openstack-
2013-02-05 14:05:42 INFO nova.api.openstack [req-36bc6ade-bf56-4a5b-a913-1195b75040e8 0732bcc6b79b44058498feedbb957763 12ed8c7f70fb48018cdbf3aa60503541] http://localhost:8774/v2/12ed8c7f70fb48018cdbf3aa60503541/servers/5116bdf5-4cbe-4bd1-96d4-1534b22a010f/action returned with HTTP 500

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/21193

Changed in nova:
assignee: nobody → Zhou ShaoYu (hzzhoushaoyu)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/21193
Committed: http://github.com/openstack/nova/commit/702fdf2fc1acc32b5ccd9e0830e574c42770ab5d
Submitter: Jenkins
Branch: master

commit 702fdf2fc1acc32b5ccd9e0830e574c42770ab5d
Author: Zhou ShaoYu <email address hidden>
Date: Tue Feb 5 14:42:53 2013 +0800

    Fix check instance host for instance action

    When instance has no host, actions such as get_console_output,
    start_stop_instance cause HTTP 500 response. Here change to
    HTTPConflict when action called before host set.

    Fix LP# 1116012

    Change-Id: I6153a03f449d9fad8d0d8fb7295bdea4d2b2c2b1

Changed in nova:
status: In Progress → Fix Committed
tags: added: folsom-backport-potential
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-3 → 2013.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.