Cannot load 'instance' in the base class - problem in floating-ip-list

Bug #1356051 reported by Thang Pham
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Thang Pham

Bug Description

I tried the following on VMware using the VMwareVCDriver with nova-network:

1. Create an instance

2. Create a floating IP: $ nova floating-ip-create

3. Associate a floating IP with the instance: $ nova floating-ip-associate test1 10.131.254.249

4. Attempt a list of the floating IPs:
$ nova floating-ip-list
ERROR (ClientException): The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-dcb17077-c670-4e2a-8a34-715a8afc5f33)

It failed and printed out the following messages in n-api logs:

2014-08-12 13:54:29.578 ERROR nova.api.openstack [req-86d8f466-cfae-42ac-8340-9eac36d6fc71 demo demo] Caught error: Cannot load 'instance' in the base class
2014-08-12 13:54:29.578 TRACE nova.api.openstack Traceback (most recent call last):
2014-08-12 13:54:29.578 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/__init__.py", line 124, in __call__
2014-08-12 13:54:29.578 TRACE nova.api.openstack return req.get_response(self.application)
2014-08-12 13:54:29.578 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1320, in send
2014-08-12 13:54:29.578 TRACE nova.api.openstack application, catch_exc_info=False)
2014-08-12 13:54:29.578 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1284, in call_application
2014-08-12 13:54:29.578 TRACE nova.api.openstack app_iter = application(self.environ, start_response)
2014-08-12 13:54:29.578 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2014-08-12 13:54:29.578 TRACE nova.api.openstack return resp(environ, start_response)
2014-08-12 13:54:29.578 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/keystonemiddleware/auth_token.py", line 565, in __call__
2014-08-12 13:54:29.578 TRACE nova.api.openstack return self._app(env, start_response)
2014-08-12 13:54:29.578 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2014-08-12 13:54:29.578 TRACE nova.api.openstack return resp(environ, start_response)
2014-08-12 13:54:29.578 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2014-08-12 13:54:29.578 TRACE nova.api.openstack return resp(environ, start_response)
2014-08-12 13:54:29.578 TRACE nova.api.openstack File "/usr/lib/python2.7/dist-packages/routes/middleware.py", line 131, in __call__
2014-08-12 13:54:29.578 TRACE nova.api.openstack response = self.app(environ, start_response)
2014-08-12 13:54:29.578 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
2014-08-12 13:54:29.578 TRACE nova.api.openstack return resp(environ, start_response)
2014-08-12 13:54:29.578 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
2014-08-12 13:54:29.578 TRACE nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2014-08-12 13:54:29.578 TRACE nova.api.openstack File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
2014-08-12 13:54:29.578 TRACE nova.api.openstack return self.func(req, *args, **kwargs)
2014-08-12 13:54:29.578 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 908, in __call__
2014-08-12 13:54:29.578 TRACE nova.api.openstack content_type, body, accept)
2014-08-12 13:54:29.578 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 974, in _process_stack
2014-08-12 13:54:29.578 TRACE nova.api.openstack action_result = self.dispatch(meth, request, action_args)
2014-08-12 13:54:29.578 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/wsgi.py", line 1058, in dispatch
2014-08-12 13:54:29.578 TRACE nova.api.openstack return method(req=request, **action_args)
2014-08-12 13:54:29.578 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/compute/contrib/floating_ips.py", line 146, in index
2014-08-12 13:54:29.578 TRACE nova.api.openstack self._normalize_ip(floating_ip)
2014-08-12 13:54:29.578 TRACE nova.api.openstack File "/opt/stack/nova/nova/api/openstack/compute/contrib/floating_ips.py", line 117, in _normalize_ip
2014-08-12 13:54:29.578 TRACE nova.api.openstack floating_ip['instance'] = fixed_ip['instance']
2014-08-12 13:54:29.578 TRACE nova.api.openstack File "/opt/stack/nova/nova/objects/base.py", line 447, in __getitem__
2014-08-12 13:54:29.578 TRACE nova.api.openstack return getattr(self, name)
2014-08-12 13:54:29.578 TRACE nova.api.openstack File "/opt/stack/nova/nova/objects/base.py", line 67, in getter
2014-08-12 13:54:29.578 TRACE nova.api.openstack self.obj_load_attr(name)
2014-08-12 13:54:29.578 TRACE nova.api.openstack File "/opt/stack/nova/nova/objects/base.py", line 375, in obj_load_attr
2014-08-12 13:54:29.578 TRACE nova.api.openstack _("Cannot load '%s' in the base class") % attrname)
2014-08-12 13:54:29.578 TRACE nova.api.openstack NotImplementedError: Cannot load 'instance' in the base class
2014-08-12 13:54:29.579 INFO nova.api.openstack [req-86d8f466-cfae-42ac-8340-9eac36d6fc71 demo demo] http://10.131.179.211:8774/v2/875c3f62ef75400487e4a68679f8e239/os-floating-ips returned with HTTP 500
2014-08-12 13:54:29.580 DEBUG nova.api.openstack.wsgi [req-86d8f466-cfae-42ac-8340-9eac36d6fc71 demo demo] Returning 500 to user: The server has either erred or is incapable of performing the requested operation. from (pid=12246) __call__ /opt/stack/nova/nova/api/openstack/wsgi.py:1200

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

Changed in nova:
status: New → In Progress
Thang Pham (thang-pham)
description: updated
summary: - Cannot load 'instance' in the base class
+ Cannot load 'instance' in the base class - problem in floating-ip-list
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

I've been able to recreate the problem with KVM + Nova network as well

Thang Pham (thang-pham)
Changed in nova:
importance: Undecided → High
Revision history for this message
Ramy Asselin (ramy-asselin) wrote :

FYI I'm also running into this as well using devstack master as my nodepool provider (https://github.com/openstack-infra/nodepool).

Nodepool stack trace is:

2014-08-21 00:46:19,529 ERROR nodepool.ProviderManager: Unable to get IP details for server f8eb992f-7db9-4566-b993-fceb59a73525, will retry
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nodepool/provider_manager.py", line 476, in addPublicIP
    newip = self.getFloatingIP(ip['id'])
  File "/usr/local/lib/python2.7/dist-packages/nodepool/provider_manager.py", line 405, in getFloatingIP
    return self.submitTask(GetFloatingIPTask(ip_id=ip_id))
  File "/usr/local/lib/python2.7/dist-packages/nodepool/task_manager.py", line 98, in submitTask
    return task.wait()
  File "/usr/local/lib/python2.7/dist-packages/nodepool/task_manager.py", line 51, in run
    self.done(self.main(client))
  File "/usr/local/lib/python2.7/dist-packages/nodepool/provider_manager.py", line 153, in main
    ip = client.floating_ips.get(self.args['ip_id'])
  File "/usr/local/lib/python2.7/dist-packages/novaclient/v1_1/floating_ips.py", line 59, in get
    "floating_ip")
  File "/usr/local/lib/python2.7/dist-packages/novaclient/base.py", line 93, in _get
    _resp, body = self.api.client.get(url)
  File "/usr/local/lib/python2.7/dist-packages/novaclient/client.py", line 482, in get
    return self._cs_request(url, 'GET', **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/novaclient/client.py", line 459, in _cs_request
    **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/novaclient/client.py", line 441, in _time_request
    resp, body = self.request(url, method, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/novaclient/client.py", line 435, in request
    raise exceptions.from_response(resp, body, url, method)
ClientException: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-7618e5e0-4469-4474-a83f-e22905f56d60)

Revision history for this message
Ramy Asselin (ramy-asselin) wrote :

Thang Pham, if there's a workaround, any (e.g. go back to nova revision XYZ), or a patch set submitted, please let me know. Thanks.

Revision history for this message
Thang Pham (thang-pham) wrote :

Ramy Asselin: Patch set can be found here - https://review.openstack.org/#/c/113981/

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

Reviewed: https://review.openstack.org/113981
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=6c085e1d6652df013ec176d46ffb234065373193
Submitter: Jenkins
Branch: master

commit 6c085e1d6652df013ec176d46ffb234065373193
Author: Thang Pham <email address hidden>
Date: Wed Aug 13 11:33:34 2014 -0400

    Fix NotImplementedError in floating-ip-list

    A list of existing floating IP (nova floating-ip-list) fails
    when using VMwareVCDriver/LibvirtDriver and nova-network.
    The following error is thrown: "NotImplementedError: Cannot load
    'instance' in the base class". The problem is caused by
    _normalize_ip, which tries to set an 'instance' field in
    FloatingIP that is needed by _translate_floating_ip_view. The
    instance is derived from the FixedIP that is assigned to the
    'fixed_ip' field in FloatingIP. However, FixedIP may not have
    an 'instance' field set, which can cause the NotImplementedError.

    The following patch removes _normalize_ip and assigns the
    'instance_id' required by _translate_floating_ip_view to
    the 'instance_uuid' in FixedIP, since only the instance ID
    is required and not the entire instance object.

    Change-Id: I2d7937e969bd87e53557842a22f3861f0d307b5e
    Closes-Bug: #1356051

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
Gloria Gu (gloria-gu) wrote :
no longer affects: horizon
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-3 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.