Nova aggregate API throws an uncaught exception on invalid host

Bug #1154138 reported by Hans Lindgren
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Hans Lindgren

Bug Description

Giving an invalid host name when trying to remove a host from an aggregate results in an uncaught exception thrown in the nova-api log.

2013-03-12 15:59:40.482 ERROR nova.api.openstack [req-84e69291-229e-4c5d-9bc5-7e78fe5b68ef admin admin] Caught error: Compute host nohost could not be found.
2013-03-12 15:59:40.482 TRACE nova.api.openstack Traceback (most recent call last):
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/__init__.py", line 81, in __call__
2013-03-12 15:59:40.482 TRACE nova.api.openstack return req.get_response(self.application)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1296, in send
2013-03-12 15:59:40.482 TRACE nova.api.openstack application, catch_exc_info=False)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1260, in call_application
2013-03-12 15:59:40.482 TRACE nova.api.openstack app_iter = application(self.environ, start_response)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2013-03-12 15:59:40.482 TRACE nova.api.openstack return resp(environ, start_response)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/keystoneclient/middleware/auth_token.py", line 298, in __call__
2013-03-12 15:59:40.482 TRACE nova.api.openstack return self.app(env, start_response)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2013-03-12 15:59:40.482 TRACE nova.api.openstack return resp(environ, start_response)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2013-03-12 15:59:40.482 TRACE nova.api.openstack return resp(environ, start_response)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2013-03-12 15:59:40.482 TRACE nova.api.openstack return resp(environ, start_response)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/routes/middleware.py", line 131, in __call__
2013-03-12 15:59:40.482 TRACE nova.api.openstack response = self.app(environ, start_response)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2013-03-12 15:59:40.482 TRACE nova.api.openstack return resp(environ, start_response)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
2013-03-12 15:59:40.482 TRACE nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
2013-03-12 15:59:40.482 TRACE nova.api.openstack return self.func(req, *args, **kwargs)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 895, in __call__
2013-03-12 15:59:40.482 TRACE nova.api.openstack content_type, body, accept)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 955, in _process_stack
2013-03-12 15:59:40.482 TRACE nova.api.openstack action_result = self.dispatch(meth, request, action_args)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 1035, in dispatch
2013-03-12 15:59:40.482 TRACE nova.api.openstack return method(req=request, **action_args)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/compute/contrib/aggregates.py", line 138, in action
2013-03-12 15:59:40.482 TRACE nova.api.openstack return _actions[action](req, id, data)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/compute/contrib/aggregates.py", line 40, in wrapped
2013-03-12 15:59:40.482 TRACE nova.api.openstack return fn(self, req, id, host, *args, **kwargs)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/compute/contrib/aggregates.py", line 169, in _remove_host
2013-03-12 15:59:40.482 TRACE nova.api.openstack aggregate = self.api.remove_host_from_aggregate(context, id, host)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/opt/stack/nova/nova/compute/api.py", line 2672, in remove_host_from_aggregate
2013-03-12 15:59:40.482 TRACE nova.api.openstack self.db.service_get_by_compute_host(context, host_name)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/opt/stack/nova/nova/db/api.py", line 150, in service_get_by_compute_host
2013-03-12 15:59:40.482 TRACE nova.api.openstack return IMPL.service_get_by_compute_host(context, host)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 95, in wrapper
2013-03-12 15:59:40.482 TRACE nova.api.openstack return f(*args, **kwargs)
2013-03-12 15:59:40.482 TRACE nova.api.openstack File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 390, in service_get_by_compute_host
2013-03-12 15:59:40.482 TRACE nova.api.openstack raise exception.ComputeHostNotFound(host=host)
2013-03-12 15:59:40.482 TRACE nova.api.openstack ComputeHostNotFound: Compute host nohost could not be found.
2013-03-12 15:59:40.482 TRACE nova.api.openstack

Changed in nova:
status: New → Confirmed
milestone: none → grizzly-rc1
milestone: grizzly-rc1 → none
tags: added: grizzly-rc-potential
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/24187

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/24187
Committed: http://github.com/openstack/nova/commit/e94deedd42f79a5e63e2f3b13be31cd0b57d24e6
Submitter: Jenkins
Branch: master

commit e94deedd42f79a5e63e2f3b13be31cd0b57d24e6
Author: Hans Lindgren <email address hidden>
Date: Tue Mar 12 16:11:39 2013 +0100

    Fix: Nova aggregate API throws an uncaught exception on invalid host

    Add ComputeHostNotFound to the caught exceptions.

    Resolves bug 1154138.

    Change-Id: I385b88b85caf534f51db70577eb62361e8cc461f

Changed in nova:
status: In Progress → Fix Committed
Joe Gordon (jogo)
Changed in nova:
milestone: none → grizzly-rc1
tags: removed: grizzly-rc-potential
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-rc1 → 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.