Removing non-existant floating ip yields 500

Bug #984762 reported by shilpa batchu
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Low
Ying Chun Guo

Bug Description

Steps to Reproduce:
1.Launch an instance
2.nova remove-floating-ip (server id) 183.2.4.6 (This address is not associated with the instance)

Expected Result:
Message saying "No such floating-ip associated with the instance"

Actual Result:
The server has either erred or is incapable of performing the requested operation. (HTTP 500)

In nova-api log:

Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/nova/api/openstack/__init__.py", line 41, in __call__
return req.get_response(self.application)
File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1053, in get_response
application, catch_exc_info=False)
File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1022, in call_application
app_iter = application(self.environ, start_response)
File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
return resp(environ, start_response)
File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
return resp(environ, start_response)
File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
return resp(environ, start_response)
File "/usr/lib/pymodules/python2.7/routes/middleware.py", line 131, in __call__
response = self.app(environ, start_response)
File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
return resp(environ, start_response)
File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 208, in call_func
return self.func(req, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 786, in __call__
content_type, body, accept)
File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 834, in _process_stack
action_result = self.dispatch(meth, request, action_args)
File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 910, in dispatch
return method(req=request, **action_args)
File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/contrib/floating_ips.py", line 237, in _remove_floating_ipaddress)
File "/usr/lib/python2.7/dist-packages/nova/network/api.py", line 81, in get_floating_ip_by_address
'args': {'address': address}})
File "/usr/lib/python2.7/dist-packages/nova/rpc/__init__.py", line 69, in call
return _get_impl().call(context, topic, msg, timeout)
File "/usr/lib/python2.7/dist-packages/nova/rpc/impl_kombu.py", line 611, in call
return rpc_amqp.call(context, topic, msg, timeout)
File "/usr/lib/python2.7/dist-packages/nova/rpc/amqp.py", line 334, in call
rv = list(rv)
File "/usr/lib/python2.7/dist-packages/nova/rpc/amqp.py", line 302, in __iter__
raise result
 RemoteError: Remote error: FloatingIpNotFoundForAddress Floating ip not found for address 183.2.4.6.
 [u'Traceback (most recent call last):\n', u' File "/usr/lib/python2.7/dist-packages/nova/rpc/amqp.py", line 249, in _process_data\n rval = node_func(context=ctxt, **node_args)\n', u' File "/usr/lib/python2.7/dist-packages/nova/network/manager.py", line 238, in wrapped\n return func(self, context, *args, **kwargs)\n', u' File "/usr/lib/python2.7/dist-packages/nova/network/manager.py", line 543, in get_floating_ip_by_address\n address).iteritems())\n', u' File "/usr/lib/python2.7/dist-packages/nova/db/api.py", line 340, in floating_ip_get_by_address\n return IMPL.floating_ip_get_by_address(context, address)\n', u' File "/usr/lib/python2.7/dist-packages/nova/db/sqlalchemy/api.py", line 119, in wrapper\n return f(*args, **kwargs)\n', u' File "/usr/lib/python2.7/dist-packages/nova/db/sqlalchemy/api.py", line 853, in floating_ip_get_by_address\n raise exception.FloatingIpNotFoundForAddress(address=address)\n', u'FloatingIpNotFoundForAddress: Floating ip not found for address 183.2.4.6.\n'].
(nova.api.openstack): TRACE:

Revision history for this message
Rajalakshmi Ganesan (rajalakshmi-ganesan) wrote :

Disassociating Floating IP without passing Floating is also yielding 500, instead of Raising NotFound exception

The following is the nosetest log:

Negative Test:DISASSOCIATE floating ip without passing ... ERROR

======================================================================
ERROR: Negative Test:DISASSOCIATE floating ip without passing
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/muralik/tempest_harika/5thJune/tempest/tempest/tests/test_floating_ips_actions.py", line 299, in test_dissociate_without_passing_floatingip
    self.client.disassociate_floating_ip_from_server('', self.server_id)
  File "/home/muralik/tempest_harika/5thJune/tempest/tempest/services/nova/json/floating_ips_client.py", line 72, in disassociate_floating_ip_from_server
    resp, body = self.post(url, post_body, self.headers)
  File "/home/muralik/tempest_harika/5thJune/tempest/tempest/common/rest_client.py", line 152, in post
    return self.request('POST', url, headers, body)
  File "/home/muralik/tempest_harika/5thJune/tempest/tempest/common/rest_client.py", line 225, in request
    raise exceptions.ComputeFault(message)
ComputeFault: Got compute fault
Details: Got compute fault
Details: The server has either erred or is incapable of performing the requested operation.
-------------------- >> begin captured logging << --------------------
tempest.config: INFO: Using tempest config file /home/muralik/tempest_harika/5thJune/tempest/etc/tempest.conf
tempest.common.rest_client: ERROR: Request URL: http://10.233.52.27:8774/v2/b0f9c09937de4a15864cd15ea0c28810/images/f0a26cd1-0735-4347-8cdc-c70c829e9f87
tempest.common.rest_client: ERROR: Request Body: None
tempest.common.rest_client: ERROR: Response Headers: {'date': 'Wed, 06 Jun 2012 14:03:44 GMT', 'status': '404', 'content-length': '62', 'content-type': 'application/json; charset=UTF-8', 'x-compute-request-id': 'req-bffa816d-1575-4a63-bd84-766412e76e2e'}
tempest.common.rest_client: ERROR: Response Body: {"itemNotFound": {"message": "Image not found.", "code": 404}}
tempest.common.rest_client: ERROR: Request URL: http://10.233.52.27:8774/v2/b0f9c09937de4a15864cd15ea0c28810/servers/f8f2dd2f-a5f6-43a1-9796-6f3279a4d595/action
tempest.common.rest_client: ERROR: Request Body: {"removeFloatingIp": {"address": ""}}
tempest.common.rest_client: ERROR: Response Headers: {'date': 'Wed, 06 Jun 2012 14:04:06 GMT', 'status': '500', 'content-length': '128', 'content-type': 'application/json; charset=UTF-8', 'x-compute-request-id': 'req-3a6321ca-3dfa-447d-b809-f8c245d2ec22'}
tempest.common.rest_client: ERROR: Response Body: {u'computeFault': {u'message': u'The server has either erred or is incapable of performing the requested operation.', u'code': 500}}
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 1 test in 21.563s

FAILED (errors=1)

Changed in nova:
status: New → Incomplete
status: Incomplete → Confirmed
Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → Low
tags: added: osapi
Changed in nova:
assignee: nobody → Ying Chun Guo (daisy-ycguo)
Revision history for this message
Dan Smith (danms) wrote :

I think this is fixed in the following change, which has been merged:

https://review.openstack.org/#/c/10139/

Can you re-test with it?

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.