List detail of non-existent floating ip fails

Bug #940500 reported by David Kranz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Alex Meade

Bug Description

This was from a test failure in tempest: test_list_floating_ips.py, line 61. This test passes against diablo.
Here is the tempest failure log and the nova-api log using current devstack.

$ TEMPEST_CONFIG=tempest.essex.conf nosetests -v tempest/tests/test_list_floating_ips.py
Positive test:Should be able to GET the details of floatingIP ... ok
Negative test:Should not be able to GET the details ... ERROR
Positive test:Should return the list of floating IPs ... ok

======================================================================
ERROR: Negative test:Should not be able to GET the details
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/cygdrive/c/source/tempest/tempest/tests/test_list_floating_ips.py", line 77, in test_get_nonexistant_floating_ip_details
    self.client.get_floating_ip_details(non_exist_id)
  File "/cygdrive/c/source/tempest/tempest/services/nova/json/floating_ips_client.py", line 31, in get_floating_ip_details
    resp, body = self.client.get(url)
  File "/cygdrive/c/source/tempest/tempest/common/rest_client.py", line 96, in get
    return self.request('GET', url)
  File "/cygdrive/c/source/tempest/tempest/common/rest_client.py", line 156, 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.common.rest_client: ERROR: Request URL: http://172.18.0.156:8774/v2/98c31a0aa069415084c48cc8ff8fd551/os-floating-ips/99915045349242
tempest.common.rest_client: ERROR: Request Body: None
tempest.common.rest_client: ERROR: Response Headers: {'date': 'Fri, 24 Feb 2012 17:51:01 GMT', 'status': '500', 'content-length': '128', 'content-type': 'application/json; charset=UTF-8'}
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 3 tests in 1.350s

FAILED (errors=1)

2012-02-24 12:51:01 ERROR nova.api.openstack [req-49c026d8-fddc-4169-8e70-290704c80678 admin 98c31a0aa069415084c48cc8ff8fd551] Caught error: Remote error: FloatingIpNotFound Floating ip not found for id 99915045349242.
[u'Traceback (most recent call last):\n', u' File "/opt/stack/nova/nova/rpc/amqp.py", line 250, in _process_data\n rval = node_func(context=ctxt, **node_args)\n', u' File "/opt/stack/nova/nova/network/manager.py", line 239, in wrapped\n return func(self, context, *args, **kwargs)\n', u' File "/opt/stack/nova/nova/network/manager.py", line 530, in get_floating_ip\n return dict(self.db.floating_ip_get(context, id).iteritems())\n', u' File "/opt/stack/nova/nova/db/api.py", line 268, in floating_ip_get\n return IMPL.floating_ip_get(context, id)\n', u' File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 119, in wrapper\n return f(*args, **kwargs)\n', u' File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 693, in floating_ip_get\n raise exception.FloatingIpNotFound(id=id)\n', u'FloatingIpNotFound: Floating ip not found for id 99915045349242.\n'].
(nova.api.openstack): TRACE: Traceback (most recent call last):
(nova.api.openstack): TRACE: File "/opt/stack/nova/nova/api/openstack/__init__.py", line 41, in __call__
(nova.api.openstack): TRACE: return req.get_response(self.application)
(nova.api.openstack): TRACE: File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1053, in get_response
(nova.api.openstack): TRACE: application, catch_exc_info=False)
(nova.api.openstack): TRACE: File "/usr/lib/python2.7/dist-packages/webob/request.py", line 1022, in call_application
(nova.api.openstack): TRACE: app_iter = application(self.environ, start_response)
(nova.api.openstack): TRACE: File "/opt/stack/keystone/keystone/middleware/auth_token.py", line 213, in __call__
(nova.api.openstack): TRACE: return self._forward_request(env, start_response, proxy_headers)
(nova.api.openstack): TRACE: File "/opt/stack/keystone/keystone/middleware/auth_token.py", line 375, in _forward_request
(nova.api.openstack): TRACE: return self.app(env, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
(nova.api.openstack): TRACE: return resp(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
(nova.api.openstack): TRACE: return resp(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.7/routes/middleware.py", line 131, in __call__
(nova.api.openstack): TRACE: response = self.app(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
(nova.api.openstack): TRACE: return resp(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
(nova.api.openstack): TRACE: resp = self.call_func(req, *args, **self.kwargs)
(nova.api.openstack): TRACE: File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 208, in call_func
(nova.api.openstack): TRACE: return self.func(req, *args, **kwargs)
(nova.api.openstack): TRACE: File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 797, in __call__
(nova.api.openstack): TRACE: content_type, body, accept)
(nova.api.openstack): TRACE: File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 845, in _process_stack
(nova.api.openstack): TRACE: action_result = self.dispatch(meth, request, action_args)
(nova.api.openstack): TRACE: File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 921, in dispatch
(nova.api.openstack): TRACE: return method(req=request, **action_args)
(nova.api.openstack): TRACE: File "/opt/stack/nova/nova/api/openstack/compute/contrib/floating_ips.py", line 123, in show
(nova.api.openstack): TRACE: floating_ip = self.network_api.get_floating_ip(context, id)
(nova.api.openstack): TRACE: File "/opt/stack/nova/nova/network/api.py", line 76, in get_floating_ip
(nova.api.openstack): TRACE: 'args': {'id': id}})
(nova.api.openstack): TRACE: File "/opt/stack/nova/nova/rpc/__init__.py", line 69, in call
(nova.api.openstack): TRACE: return _get_impl().call(context, topic, msg, timeout)
(nova.api.openstack): TRACE: File "/opt/stack/nova/nova/rpc/impl_kombu.py", line 624, in call
(nova.api.openstack): TRACE: return rpc_amqp.call(context, topic, msg, timeout, Connection.pool)
(nova.api.openstack): TRACE: File "/opt/stack/nova/nova/rpc/amqp.py", line 336, in call
(nova.api.openstack): TRACE: rv = list(rv)
(nova.api.openstack): TRACE: File "/opt/stack/nova/nova/rpc/amqp.py", line 304, in __iter__
(nova.api.openstack): TRACE: raise result
(nova.api.openstack): TRACE: RemoteError: Remote error: FloatingIpNotFound Floating ip not found for id 99915045349242.
(nova.api.openstack): TRACE: [u'Traceback (most recent call last):\n', u' File "/opt/stack/nova/nova/rpc/amqp.py", line 250, in _process_data\n rval = node_func(context=ctxt, **node_args)\n', u' File "/opt/stack/nova/nova/network/manager.py", line 239, in wrapped\n return func(self, context, *args, **kwargs)\n', u' File "/opt/stack/nova/nova/network/manager.py", line 530, in get_floating_ip\n return dict(self.db.floating_ip_get(context, id).iteritems())\n', u' File "/opt/stack/nova/nova/db/api.py", line 268, in floating_ip_get\n return IMPL.floating_ip_get(context, id)\n', u' File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 119, in wrapper\n return f(*args, **kwargs)\n', u' File "/opt/stack/nova/nova/db/sqlalchemy/api.py", line 693, in floating_ip_get\n raise exception.FloatingIpNotFound(id=id)\n', u'FloatingIpNotFound: Floating ip not found for id 99915045349242.\n'].
(nova.api.openstack): TRACE:
2012-02-24 12:51:01 INFO nova.api.openstack [req-49c026d8-fddc-4169-8e70-290704c80678 admin 98c31a0aa069415084c48cc8ff8fd551] http://172.18.0.156:8774/v2/98c31a0aa069415084c48cc8ff8fd551/os-floating-ips/99915045349242 returned with HTTP 500

Revision history for this message
Jay Pipes (jaypipes) wrote :

David, is this on Diablo, Essex or both?

Changed in nova:
importance: Undecided → Medium
Revision history for this message
David Kranz (david-kranz) wrote :

This test passed with diablo...

Alex Meade (alex-meade)
Changed in nova:
assignee: nobody → Alex Meade (alex-meade)
status: New → In Progress
Revision history for this message
Alex Meade (alex-meade) wrote :

So this is because in Essex, the network api does rpc calls instead of direct calls to the db. This means that all the errors from the db, such as FloatingIpNotFound is turned into a RemoteError. But contrib/floating_ips.py is expecting a NotFound.

Revision history for this message
Alex Meade (alex-meade) wrote :

This is all due to lp920705

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/5749

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit a0150a4d9e751ec222221558dfe89a66b0c118ab
Author: Alex Meade <email address hidden>
Date: Wed Mar 21 19:13:16 2012 +0000

    Add the serialization of exceptions for RPC calls.

    This change uses json to serialize an exception so that it can be sent
    through RPC calls to be reconstructed on the other side. The traceback is added
    to the exception message. If recreating the exception fails for whatever reason
    then a RemoteError is created containing all of the exception information.

    Adds flag 'allowed_rpc_exception_modules' to prevent dangerous modules from
    being accessed and allowing arbitrary code to be run.

    Fixes bug 920705
    Fixes bug 940500

    Change-Id: Ife3b64b19fe8abbc730184d4ee7d9fcabfd29db3

Changed in nova:
status: In Progress → Fix Committed
Devin Carlen (devcamcar)
Changed in nova:
milestone: none → folsom-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Revision history for this message
Rajalakshmi Ganesan (rajalakshmi-ganesan) wrote :

The behaviour is also observed same in get floating ip details with alpha numeric ID and alpha ID(Raising http 500)
Instead of raising NotFound exception

The following is the nosetests log:

Negative test: Should not able to GET the details ... ERROR

======================================================================
ERROR: Negative test: Should not able to GET the details
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/muralik/tempest_harika/5thJune/tempest/tempest/tests/test_list_floating_ips_latest.py", line 101, in test_get_floating_ip_details_by_invalid_id
    self.client.get_floating_ip_details(floating_ip_ids[i])
  File "/home/muralik/tempest_harika/5thJune/tempest/tempest/services/nova/json/floating_ips_client.py", line 30, in get_floating_ip_details
    resp, body = self.get(url)
  File "/home/muralik/tempest_harika/5thJune/tempest/tempest/common/rest_client.py", line 155, in get
    return self.request('GET', url)
  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 15:40:52 GMT', 'status': '404', 'content-length': '62', 'content-type': 'application/json; charset=UTF-8', 'x-compute-request-id': 'req-f4cacb02-bf6b-4183-8cbb-e3bb8f65939e'}
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/os-floating-ips/afh1323
tempest.common.rest_client: ERROR: Request Body: None
tempest.common.rest_client: ERROR: Response Headers: {'date': 'Wed, 06 Jun 2012 15:40:52 GMT', 'status': '500', 'content-length': '128', 'content-type': 'application/json; charset=UTF-8', 'x-compute-request-id': 'req-604a0d1b-3b70-4ecb-863f-7eb975e41446'}
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 << ---------------------

Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-1 → 2012.2
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.