ovs agent crashes with UnboundLocalError in case self.scan_ancillary_ports fails

Bug #1479265 reported by Ihar Hrachyshka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Ihar Hrachyshka

Bug Description

It shows in the following functional test crash:

ft1.205: neutron.tests.functional.agent.test_l2_ovs_agent.TestOVSAgent.test_resync_devices_set_up_after_exception(native)_StringException: Empty attachments:
  pythonlogging:'neutron.api.extensions'
  stdout

pythonlogging:'': {{{
2015-07-28 21:38:06,203 INFO [neutron.agent.l2.agent_extensions_manager] Configured agent extensions names: ('qos',)
2015-07-28 21:38:06,204 INFO [neutron.agent.l2.agent_extensions_manager] Loaded agent extensions names: ['qos']
2015-07-28 21:38:06,204 INFO [neutron.agent.l2.agent_extensions_manager] Initializing agent extension 'qos'
2015-07-28 21:38:06,280 INFO [neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent] Mapping physical network physnet to bridge br-int359443631
2015-07-28 21:38:06,349 WARNING [neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent] Creating an interface named br-int359443631 exceeds the 15 character limitation. It was shortened to int-br-in3cbf05 to fit.
2015-07-28 21:38:06,349 WARNING [neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent] Creating an interface named br-int359443631 exceeds the 15 character limitation. It was shortened to phy-br-in3cbf05 to fit.
2015-07-28 21:38:06,970 INFO [neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent] Adding test-br69135803 to list of bridges.
2015-07-28 21:38:06,974 WARNING [neutron.agent.securitygroups_rpc] Driver configuration doesn't match with enable_security_group
2015-07-28 21:38:07,061 INFO [neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent] Agent out of sync with plugin!
2015-07-28 21:38:07,062 INFO [neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent] Agent tunnel out of sync with plugin!
2015-07-28 21:38:07,204 ERROR [neutron.agent.ovsdb.impl_idl] Traceback (most recent call last):
  File "neutron/agent/ovsdb/native/connection.py", line 84, in run
    txn.results.put(txn.do_commit())
  File "neutron/agent/ovsdb/impl_idl.py", line 92, in do_commit
    ctx.reraise = False
  File "/opt/stack/new/neutron/.tox/dsvm-functional/local/lib/python2.7/site-packages/oslo_utils/excutils.py", line 119, in __exit__
    six.reraise(self.type_, self.value, self.tb)
  File "neutron/agent/ovsdb/impl_idl.py", line 87, in do_commit
    command.run_idl(txn)
  File "neutron/agent/ovsdb/native/commands.py", line 355, in run_idl
    br = idlutils.row_by_value(self.api.idl, 'Bridge', 'name', self.bridge)
  File "neutron/agent/ovsdb/native/idlutils.py", line 59, in row_by_value
    raise RowNotFound(table=table, col=column, match=match)
RowNotFound: Cannot find Bridge with name=test-br69135803

2015-07-28 21:38:07,204 ERROR [neutron.agent.ovsdb.native.commands] Error executing command
Traceback (most recent call last):
  File "neutron/agent/ovsdb/native/commands.py", line 35, in execute
    txn.add(self)
  File "neutron/agent/ovsdb/api.py", line 70, in __exit__
    self.result = self.commit()
  File "neutron/agent/ovsdb/impl_idl.py", line 70, in commit
    raise result.ex
RowNotFound: Cannot find Bridge with name=test-br69135803
2015-07-28 21:38:07,205 ERROR [neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent] Error while processing VIF ports
Traceback (most recent call last):
  File "neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py", line 1569, in rpc_loop
    ancillary_ports)
  File "neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py", line 1104, in scan_ancillary_ports
    cur_ports |= bridge.get_vif_port_set()
  File "neutron/agent/common/ovs_lib.py", line 376, in get_vif_port_set
    port_names = self.get_port_name_list()
  File "neutron/agent/common/ovs_lib.py", line 313, in get_port_name_list
    return self.ovsdb.list_ports(self.br_name).execute(check_error=True)
  File "neutron/agent/ovsdb/native/commands.py", line 42, in execute
    ctx.reraise = False
  File "/opt/stack/new/neutron/.tox/dsvm-functional/local/lib/python2.7/site-packages/oslo_utils/excutils.py", line 119, in __exit__
    six.reraise(self.type_, self.value, self.tb)
  File "neutron/agent/ovsdb/native/commands.py", line 35, in execute
    txn.add(self)
  File "neutron/agent/ovsdb/api.py", line 70, in __exit__
    self.result = self.commit()
  File "neutron/agent/ovsdb/impl_idl.py", line 70, in commit
    raise result.ex
RowNotFound: Cannot find Bridge with name=test-br69135803
}}}

stderr: {{{
Traceback (most recent call last):
  File "/opt/stack/new/neutron/.tox/dsvm-functional/local/lib/python2.7/site-packages/eventlet/queue.py", line 117, in switch
    self.greenlet.switch(value)
  File "/opt/stack/new/neutron/.tox/dsvm-functional/local/lib/python2.7/site-packages/eventlet/greenthread.py", line 214, in main
    result = function(*args, **kwargs)
  File "neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py", line 1612, in rpc_loop
    ancillary_port_info = (ancillary_port_info if self.ancillary_brs
UnboundLocalError: local variable 'ancillary_port_info' referenced before assignment
}}}

traceback-1: {{{
Traceback (most recent call last):
  File "neutron/tests/functional/agent/test_l2_ovs_agent.py", line 131, in stop_agent
    rpc_loop_thread.wait()
  File "/opt/stack/new/neutron/.tox/dsvm-functional/local/lib/python2.7/site-packages/eventlet/greenthread.py", line 175, in wait
    return self._exit_event.wait()
  File "/opt/stack/new/neutron/.tox/dsvm-functional/local/lib/python2.7/site-packages/eventlet/event.py", line 125, in wait
    current.throw(*self._exc)
  File "/opt/stack/new/neutron/.tox/dsvm-functional/local/lib/python2.7/site-packages/eventlet/greenthread.py", line 214, in main
    result = function(*args, **kwargs)
  File "neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py", line 1612, in rpc_loop
    ancillary_port_info = (ancillary_port_info if self.ancillary_brs
UnboundLocalError: local variable 'ancillary_port_info' referenced before assignment
}}}

Traceback (most recent call last):
  File "neutron/tests/functional/agent/test_l2_ovs_agent.py", line 272, in test_resync_devices_set_up_after_exception
    lambda: self._expected_plugin_rpc_call(
  File "neutron/agent/linux/utils.py", line 323, in wait_until_true
    eventlet.sleep(sleep)
  File "/opt/stack/new/neutron/.tox/dsvm-functional/local/lib/python2.7/site-packages/eventlet/greenthread.py", line 34, in sleep
    hub.switch()
  File "/opt/stack/new/neutron/.tox/dsvm-functional/local/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 294, in switch
    return self.greenlet.switch()
eventlet.timeout.Timeout: 60 seconds

Note that functional test failure is tracked in https://bugs.launchpad.net/neutron/+bug/1479264

tags: added: ovs
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
assignee: nobody → Ihar Hrachyshka (ihar-hrachyshka)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/206941
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=3b18aa3e1f4bb6d4d2f1264b37f8d784d57c4a28
Submitter: Jenkins
Branch: master

commit 3b18aa3e1f4bb6d4d2f1264b37f8d784d57c4a28
Author: Ihar Hrachyshka <email address hidden>
Date: Wed Jul 29 10:52:59 2015 +0200

    Initialize ancillary_port_info dict as blank in OVS agent

    The first assignment of ancillary_port_info was from the scan_ancillary_ports
    function which could result in an exception and result in ancillary_port_info
    being unbound for the port stats scan below.

    This patch just initializes ancillary_port_info as an empty dict so the port
    stats will always have an input.

    Closes-Bug: #1479265
    Change-Id: I37084bf27d4c328a7b78ca71cf26813207697361

Changed in neutron:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (feature/pecan)

Fix proposed to branch: feature/pecan
Review: https://review.openstack.org/211492

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (feature/pecan)
Download full text (37.3 KiB)

Reviewed: https://review.openstack.org/211492
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=a7b91632fc65ab9d2687298c68b1d715866d0356
Submitter: Jenkins
Branch: feature/pecan

commit 966203f89dee8fe61fb2dce654e36e510e80380f
Author: Sukhdev Kapur <email address hidden>
Date: Wed Jul 1 16:30:44 2015 -0700

    Neutron-Ironic integration patch

    This patch is in preparation for the integration
    of Ironic and Neutron. A new vnic_type is being
    added so that ML2 drivers can filter for all
    Ironic ports based upon match for 'baremetal'.
    Nova/Ironic will set this vnic_type when issuing
    port-create request to neutron.
    (e.g. binding:vnic_type = 'baremetal' )

    Change-Id: I25dc9472b31db052719db503a10c1fb1a55572ef
    Partial-Implements: blueprint neutron-ironic-integration

commit 236e408272bcb9b8e957524864e571b5afdc4623
Author: Oleg Bondarev <email address hidden>
Date: Tue Jul 7 12:02:58 2015 +0300

    DVR: fix router scheduling

    Fix scheduling of DVR routers to not stop scheduling once
    csnat portion was scheduled. See bug report for failing
    scenario.

    This partially reverts
    commit 3794b4a83e68041e24b715135f0ccf09a5631178
    and fixes bug 1374473 by moving csnat scheduling
    after general dvr router scheduling, so double binding does
    not happen.

    Closes-Bug: #1472163
    Related-Bug: #1374473
    Change-Id: I57c06e2be732e47b6cce7c724f6b255ea2d8fa32

commit e152f93878b9bb6af7cfedc9e045892fcf7d0615
Author: Assaf Muller <email address hidden>
Date: Sat Aug 8 21:15:03 2015 +0300

    TESTING.rst love

    Change-Id: I64b569048f8f87ea2fe63d861302b4020d36493d

commit 633c52cca1b383af2c900e1663c8682114acd177
Author: sridhargaddam <email address hidden>
Date: Wed Aug 5 10:49:33 2015 +0000

    Avoid dhcp_release for ipv6 addresses

    dhcp_release is only supported for IPv4 addresses [1] and not for
    IPv6 addresses [2]. There will be no effect when it is called with
    IPv6 address. This patch adds a corresponding note and avoids calling
    dhcp_release for IPv6 addresses.

    [1] http://manpages.ubuntu.com/manpages/trusty/man1/dhcp_release.1.html
    [2] http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2013q2/007084.html

    Change-Id: I8b8316c9d3d011c2a687a3a1e2a4da5cf1b5d604

commit 2de8fad17402f38bbc30204ee2f4f99cf21cb69d
Author: OpenStack Proposal Bot <email address hidden>
Date: Mon Aug 10 06:11:06 2015 +0000

    Imported Translations from Transifex

    For more information about this automatic import see:
    https://wiki.openstack.org/wiki/Translations/Infrastructure

    Change-Id: I2b423e83a7d0ac8b23239f81fe33dd8382c6fff6

commit fef79dc7b9162e03c8891645494c115b52d4d014
Author: Henry Gessau <email address hidden>
Date: Mon Aug 3 23:30:34 2015 -0400

    Consistent layout and headings for devref

    The lack of convention for heading levels among the independently
    written devref documents was starting to make the Table of Contents
    look rather messy when rendered in HTML.

    This patch does not cover the "Neutron Internals" section since its
    layo...

tags: added: in-feature-pecan
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: liberty-3 → 7.0.0
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.