yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #11949
[Bug 1160309] Re: Nova API floating IP error code inconsistent between Nova-Net and Quantum
** Changed in: nova/grizzly
Status: Fix Committed => Fix Released
--
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/1160309
Title:
Nova API floating IP error code inconsistent between Nova-Net and
Quantum
Status in OpenStack Compute (Nova):
Fix Released
Status in OpenStack Compute (nova) grizzly series:
Fix Released
Status in Tempest:
Fix Released
Bug description:
If you ask for details of a floating IP address (GET .../os-
floating-ips/<id>) that is not allocated to you, then on a system
with Nova-networking the error code is 404 itemNotFound, whereas on a
system with Quantum the error code is 500 computeFault.
The Nova Floating IP API code (api/openstack/compute/contrib/floating_ips.py) traps the NotFound exception raised by Nova-Net, but the quantum networking raises a QuantumClientException.
Not clear to me if the network/quantumv2/api code can just trap that
exception in this case and translate it to NotFound. or if we need a
seperate exception from the quantum client
Devstack with Nova-Net:
====================
$ curl -k -i http://10.2.1.79:8774/v2/7ac11f64dbf84c548f4161cf408b9799/os-floating-ips/1 -X GET -H "X-Auth-Project-Id: demo" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ...."
HTTP/1.1 200 OK
X-Compute-Request-Id: req-c16fdbbe-dcda-4c3b-be46-d70a4fdade5d
Content-Type: application/json
Content-Length: 103
Date: Tue, 26 Mar 2013 10:45:04 GMT
{"floating_ip": {"instance_id": null, "ip": "172.24.4.225",
"fixed_ip": null, "id": 1, "pool": "nova"}}
$ nova floating-ip-delete 172.24.4.225
$ curl -k -i http://10.2.1.79:8774/v2/7ac11f64dbf84c548f4161cf408b9799/os-floating-ips/1 -X GET -H "X-Auth-Project-Id: demo" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ..,."TTP/1.1 404 Not Found
Content-Length: 76
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-61125f73-8989-4f00-9799-2d22e0ec4d51
Date: Tue, 26 Mar 2013 10:45:28 GMT
{"itemNotFound": {"message": "Floating ip not found for id 1", "code":
404}}ubuntu@server-1357841265-az-3-region-a-geo-1:/mnt/devstack$
DevStack with Quantum:
====================
$ curl -k -i http://10.2.2.114:8774/v2/18b18e535c6149b0bf71a42b46f2ab39/os-floating-ips/c7a3a81e-28c8-4b15-94f4-6ca55e9c437b -X GET -H "X-Auth-Project-Id: demo" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: ..."HTTP/1.1 200 OK
X-Compute-Request-Id: req-77b52904-6cd9-402d-93a2-124cfdcc86b2
Content-Type: application/json
Content-Length: 180
Date: Tue, 26 Mar 2013 10:36:16 GMT
{"floating_ip": {"instance_id": "09ffe9c9-0138-4f2f-b11b-
c92e8d099b63", "ip": "172.24.4.227", "fixed_ip": "10.0.0.5", "id":
"c7a3a81e-28c8-4b15-94f4-6ca55e9c437b", "pool": "nova"}}
$ nova floating-ip-delete 172.24.4.227
$ curl -k -i
http://10.2.2.114:8774/v2/18b18e535c6149b0bf71a42b46f2ab39/os-
floating-ips/c7a3a81e-28c8-4b15-94f4-6ca55e9c437b -X GET -H "X-Auth-
Project-Id: demo" -H "User-Agent: python-novaclient" -H "Accept:
application/json" -H "X-Auth-Token: ..."
HTTP/1.1 500 Internal Server Error
Content-Length: 128
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-720eb948-ae3a-4837-ab95-958d70132aa5
Date: Tue, 26 Mar 2013 10:39:09 GMT
{"computeFault": {"message": "The server has either erred or is
incapable of performing the requested operation.", "code": 500}}
From the API log:
2013-03-25 19:11:00.377 DEBUG nova.api.openstack.wsgi [req-eda934a2-549d-4954-99b9-9dac74df01db 64090786631639 40099433467163] Calling method <bound method FloatingIPController.show of <nova.api.openstack.compute.contrib.floating_ips.FloatingIPController object at 0x45c4ed0>> _process_stack /usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py:924
2013-03-25 19:11:00.510 ERROR nova.api.openstack [req-eda934a2-549d-4954-99b9-9dac74df01db 64090786631639 40099433467163] Caught error: Floating IP 8e9a5dfb-90f5-4fce-a82b-d814fe461d7b could not be found
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack Traceback (most recent call last):
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/__init__.py", line 81, in __call__
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack return req.get_response(self.application)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1296, in send
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack application, catch_exc_info=False)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1260, in call_application
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack app_iter = application(self.environ, start_response)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack return resp(environ, start_response)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/hp/middleware/cs_auth_token.py", line 137, in __call__
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack return super(CsAuthProtocol, self).__call__(env, start_response)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/keystoneclient/middleware/auth_token.py", line 348, in __call__
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack return self.app(env, start_response)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack return resp(environ, start_response)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack return resp(environ, start_response)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack return resp(environ, start_response)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/routes/middleware.py", line 131, in __call__
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack response = self.app(environ, start_response)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack return resp(environ, start_response)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack return self.func(req, *args, **kwargs)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 895, in __call__
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack content_type, body, accept)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 955, in _process_stack
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack action_result = self.dispatch(meth, request, action_args)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 1035, in dispatch
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack return method(req=request, **action_args)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/contrib/floating_ips.py", line 130, in show
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack floating_ip = self.network_api.get_floating_ip(context, id)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/nova/network/quantumv2/api.py", line 600, in get_floating_ip
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack fip = client.show_floatingip(id)['floatingip']
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/quantumclient/v2_0/client.py", line 105, in with_params
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack ret = self.function(instance, *args, **kwargs)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/quantumclient/v2_0/client.py", line 409, in show_floatingip
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack return self.get(self.floatingip_path % (floatingip), params=_params)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/quantumclient/v2_0/client.py", line 772, in get
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack headers=headers, params=params)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/quantumclient/v2_0/client.py", line 757, in retry_request
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack headers=headers, params=params)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/quantumclient/v2_0/client.py", line 702, in do_request
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack self._handle_fault_response(status_code, replybody)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/quantumclient/v2_0/client.py", line 683, in _handle_fault_response
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack exception_handler_v20(status_code, des_error_body)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/quantumclient/v2_0/client.py", line 78, in exception_handler_v20
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack message=error_dict)
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack QuantumClientException: Floating IP 8e9a5dfb-90f5-4fce-a82b-d814fe461d7b could not be found
2013-03-25 19:11:00.510 65276 TRACE nova.api.openstack
2013-03-25 19:11:00.515 INFO nova.api.openstack [req-eda934a2-549d-4954-99b9-9dac74df01db 64090786631639 40099433467163] http://compute.systestb.hpcloud.net/v1.1/40099433467163/os-floating-ips/8e9a5dfb-90f5-4fce-a82b-d814fe461d7b returned with HTTP 500
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1160309/+subscriptions