← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1847131] Re: UnboundLocalError: local variable 'cell_uuid' referenced before assignment

 

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

commit 35d76c7cf5b122c9a8b24e62adc73510bbd6d94c
Author: ricolin <rico.lin.guanyu@xxxxxxxxx>
Date:   Mon Oct 7 18:32:24 2019 +0800

    [Gate fix] Avoid use cell_uuid before assignment
    
    Found this error in heat gate during running grenade test job.
    
    Should not asking to provide cell_uuid if queue.get is timeout.
    
    Closes-Bug: #1847131
    
    Change-Id: I7f9edc9a4b4930f4dce98df271888fa8082a1701


** 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/1847131

Title:
  UnboundLocalError: local variable 'cell_uuid' referenced before
  assignment

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  https://review.opendev.org/#/c/684118/ recently merged and is causing
  an issue because a variable used in the log message isn't in scope:

  Oct 07 07:16:51.372050 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server [None req-72524ba6-86bf-479d-a09f-9a9d302f7d2f demo demo] Exception during message handling: UnboundLocalError: local variable 'cell_uuid' referenced before assignment
  Oct 07 07:16:51.372050 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server Traceback (most recent call last):
  Oct 07 07:16:51.372050 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/server.py", line 165, in _process_incoming
  Oct 07 07:16:51.372050 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server     res = self.dispatcher.dispatch(message)
  Oct 07 07:16:51.372050 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 274, in dispatch
  Oct 07 07:16:51.372050 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server     return self._do_dispatch(endpoint, method, ctxt, args)
  Oct 07 07:16:51.372050 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 194, in _do_dispatch
  Oct 07 07:16:51.372050 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server     result = func(ctxt, **new_args)
  Oct 07 07:16:51.372050 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server   File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/server.py", line 235, in inner
  Oct 07 07:16:51.372050 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server     return func(*args, **kwargs)
  Oct 07 07:16:51.372050 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server   File "/opt/stack/new/nova/nova/scheduler/manager.py", line 214, in select_destinations
  Oct 07 07:16:51.372050 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server     allocation_request_version, return_alternates)
  Oct 07 07:16:51.372050 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server   File "/opt/stack/new/nova/nova/scheduler/filter_scheduler.py", line 96, in select_destinations
  Oct 07 07:16:51.372050 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server     allocation_request_version, return_alternates)
  Oct 07 07:16:51.372050 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server   File "/opt/stack/new/nova/nova/scheduler/filter_scheduler.py", line 152, in _schedule
  Oct 07 07:16:51.372050 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server     provider_summaries)
  Oct 07 07:16:51.374461 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server   File "/opt/stack/new/nova/nova/scheduler/filter_scheduler.py", line 494, in _get_all_host_states
  Oct 07 07:16:51.374461 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server     spec_obj)
  Oct 07 07:16:51.374461 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server   File "/opt/stack/new/nova/nova/scheduler/host_manager.py", line 774, in get_host_states_by_uuids
  Oct 07 07:16:51.374461 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server     context, cells, compute_uuids=compute_uuids)
  Oct 07 07:16:51.374461 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server   File "/opt/stack/new/nova/nova/scheduler/host_manager.py", line 640, in _get_computes_for_cells
  Oct 07 07:16:51.374461 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server     targeted_operation)
  Oct 07 07:16:51.374461 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server   File "/opt/stack/new/nova/nova/context.py", line 449, in scatter_gather_cells
  Oct 07 07:16:51.374461 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server     cell_uuid, exc_info=True)
  Oct 07 07:16:51.374461 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server UnboundLocalError: local variable 'cell_uuid' referenced before assignment
  Oct 07 07:16:51.374461 ubuntu-bionic-ovh-bhs1-0012185489 nova-scheduler[28235]: ERROR oslo_messaging.rpc.server 

  The fix is here: https://review.opendev.org/#/c/686996/

  Apparently we don't have test coverage for that code.

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


References