← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1825034] Re: listing deleted servers from the API fails after running fill_virtual_interface_list online data migration

 

Reviewed:  https://review.opendev.org/653158
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=f9eb685bee156590600889449470b35c993cc4cf
Submitter: Zuul
Branch:    master

commit f9eb685bee156590600889449470b35c993cc4cf
Author: Matt Riedemann <mriedem.os@xxxxxxxxx>
Date:   Tue Apr 16 17:47:08 2019 -0400

    Exclude fake marker instance when listing servers
    
    The fill_virtual_interface_list online data migration added
    in Stein creates a fake instance marker record without some
    fields (like flavor) which will fail to load and result in
    a 500 error when listing deleted servers across all tenants:
    
      openstack server list --all-projects --deleted
    
    This fixes the issue by excluding the specific fake marker
    instance when listing servers in the API.
    
    This admittedly isn't great but it's one of many not-so-great
    options (listed in the bug) and also something that we'll
    eventually remove when we drop the online data migration.
    
    Change-Id: Ibd34b7f24016641bc251f85e6ea17e8a969c3095
    Closes-Bug: #1825034


** Changed in: nova
       Status: In Progress => 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/1825034

Title:
  listing deleted servers from the API fails after running
  fill_virtual_interface_list online data migration

Status in OpenStack Compute (nova):
  Fix Released
Status in OpenStack Compute (nova) stein series:
  In Progress

Bug description:
  I found this bug while trying to recreate bug 1824435 with a
  functional test.

  The fill_virtual_interface_list online data migration creates a fake
  mostly empty instance record to satisfy a foreign key constraint in
  the virtual_interfaces table which is used as a marker when paging
  across cells to fulfill the migration. The problem is if you list
  deleted servers (as admin) with the all_tenants=1 and deleted=1
  filters, the API will fail with a 500 error trying to load the
  instance.flavor field:

      b'2019-04-16 15:08:53,720 ERROR [nova.api.openstack.wsgi] Unexpected exception in API method'
      b'Traceback (most recent call last):'
      b'  File "/home/osboxes/git/nova/.tox/functional-py36/lib/python3.6/site-packages/urllib3/connectionpool.py", line 377, in _make_request'
      b'    httplib_response = conn.getresponse(buffering=True)'
      b"TypeError: getresponse() got an unexpected keyword argument 'buffering'"
      b''
      b'During handling of the above exception, another exception occurred:'
      b''
      b'Traceback (most recent call last):'
      b'  File "/home/osboxes/git/nova/nova/api/openstack/wsgi.py", line 671, in wrapped'
      b'    return f(*args, **kwargs)'
      b'  File "/home/osboxes/git/nova/nova/api/validation/__init__.py", line 192, in wrapper'
      b'    return func(*args, **kwargs)'
      b'  File "/home/osboxes/git/nova/nova/api/validation/__init__.py", line 192, in wrapper'
      b'    return func(*args, **kwargs)'
      b'  File "/home/osboxes/git/nova/nova/api/validation/__init__.py", line 192, in wrapper'
      b'    return func(*args, **kwargs)'
      b'  File "/home/osboxes/git/nova/nova/api/openstack/compute/servers.py", line 136, in detail'
      b'    servers = self._get_servers(req, is_detail=True)'
      b'  File "/home/osboxes/git/nova/nova/api/openstack/compute/servers.py", line 330, in _get_servers'
      b'    req, instance_list, cell_down_support=cell_down_support)'
      b'  File "/home/osboxes/git/nova/nova/api/openstack/compute/views/servers.py", line 390, in detail'
      b'    cell_down_support=cell_down_support)'
      b'  File "/home/osboxes/git/nova/nova/api/openstack/compute/views/servers.py", line 425, in _list_view'
      b'    for server in servers]'
      b'  File "/home/osboxes/git/nova/nova/api/openstack/compute/views/servers.py", line 425, in <listcomp>'
      b'    for server in servers]'
      b'  File "/home/osboxes/git/nova/nova/api/openstack/compute/views/servers.py", line 222, in show'
      b'    show_extra_specs),'
      b'  File "/home/osboxes/git/nova/nova/api/openstack/compute/views/servers.py", line 494, in _get_flavor'
      b'    instance_type = instance.get_flavor()'
      b'  File "/home/osboxes/git/nova/nova/objects/instance.py", line 1191, in get_flavor'
      b'    return getattr(self, attr)'
      b'  File "/home/osboxes/git/nova/.tox/functional-py36/lib/python3.6/site-packages/oslo_versionedobjects/base.py", line 67, in getter'
      b'    self.obj_load_attr(name)'
      b'  File "/home/osboxes/git/nova/nova/objects/instance.py", line 1114, in obj_load_attr'
      b'    self._obj_load_attr(attrname)'
      b'  File "/home/osboxes/git/nova/nova/objects/instance.py", line 1158, in _obj_load_attr'
      b'    self._load_flavor()'
      b'  File "/home/osboxes/git/nova/nova/objects/instance.py", line 967, in _load_flavor'
      b'    self.flavor = instance.flavor'
      b'  File "/home/osboxes/git/nova/.tox/functional-py36/lib/python3.6/site-packages/oslo_versionedobjects/base.py", line 67, in getter'
      b'    self.obj_load_attr(name)'
      b'  File "/home/osboxes/git/nova/nova/objects/instance.py", line 1101, in obj_load_attr'
      b'    objtype=self.obj_name())'
      b'nova.exception.OrphanedObjectError: Cannot call obj_load_attr on orphaned Instance object'
      b'2019-04-16 15:08:53,722 INFO [nova.api.openstack.wsgi] HTTP exception thrown: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.'
      b"<class 'nova.exception.OrphanedObjectError'>"
      b'2019-04-16 15:08:53,723 INFO [nova.api.openstack.requestlog] 127.0.0.1 "GET /v2.1/6f70656e737461636b20342065766572/servers/detail?all_tenants=1&deleted=1" status: 500 len: 208 microversion: 2.1 time: 0.138964'

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1825034/+subscriptions


References