OS API: empty network list raises an exception
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
Alexej Ababilov |
Bug Description
Consider if network list is empty and `list all networks' call is performed with OS API.
nova-api performs an RPC call. Then NoNetworksFound will be raised in nova-network. nova-api will raise RemoteError. Finally, a computeFault will be reported to the end user.
Example.
curl -i 'main-node:
HTTP/1.1 500 Internal Server Error
Content-Length: 128
Content-Type: application/json; charset=UTF-8
X-Compute-
Date: Thu, 12 Jul 2012 08:59:09 GMT
{"computeFault": {"message": "The server has either erred or is incapable of performing the requested operation.", "code": 500}}
nova-network log:
2012-07-12 11:59:09 TRACE nova.rpc.amqp Traceback (most recent call last):
2012-07-12 11:59:09 TRACE nova.rpc.amqp File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.rpc.amqp rval = node_func(
2012-07-12 11:59:09 TRACE nova.rpc.amqp File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.rpc.amqp return func(self, context, *args, **kwargs)
2012-07-12 11:59:09 TRACE nova.rpc.amqp File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.rpc.amqp networks = self.db.
2012-07-12 11:59:09 TRACE nova.rpc.amqp File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.rpc.amqp return IMPL.network_
2012-07-12 11:59:09 TRACE nova.rpc.amqp File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.rpc.amqp return f(*args, **kwargs)
2012-07-12 11:59:09 TRACE nova.rpc.amqp File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.rpc.amqp raise exception.
2012-07-12 11:59:09 TRACE nova.rpc.amqp NoNetworksFound: No networks defined.
2012-07-12 11:59:09 TRACE nova.rpc.amqp
nova-api log:
2012-07-12 11:59:09 TRACE nova.api.openstack Traceback (most recent call last):
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack return req.get_
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack application, catch_exc_
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack app_iter = application(
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack return self.app(env, start_response)
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack return resp(environ, start_response)
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack return resp(environ, start_response)
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack return resp(environ, start_response)
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack response = self.app(environ, start_response)
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack return resp(environ, start_response)
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack return self.func(req, *args, **kwargs)
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack content_type, body, accept)
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack action_result = self.dispatch(meth, request, action_args)
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack return method(req=request, **action_args)
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack networks = self.network_
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack {'method': 'get_all_
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack return _get_impl(
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack return rpc_amqp.
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack rv = list(rv)
2012-07-12 11:59:09 TRACE nova.api.openstack File "/usr/lib/
2012-07-12 11:59:09 TRACE nova.api.openstack raise result
2012-07-12 11:59:09 TRACE nova.api.openstack RemoteError: Remote error: NoNetworksFound No networks defined.
Changed in nova: | |
milestone: | none → folsom-3 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | folsom-3 → 2012.2 |
Fix proposed to branch: master /review. openstack. org/9705
Review: https:/