LLDP agent driver exception on empty bridge

Bug #1802118 reported by Steven Webster
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Steven Webster

Bug Description

Brief Description
-----------------
A sysinv agent exception may be seen every 6 minutes if a user/process creates an empty bridge with no attached ports. This would not normally be the case in the default StarlingX network topology, but may
be seen by developers/experimenters of other future features.

Severity
--------
Major

Steps to Reproduce
------------------
ovs-vsctl add-br br0
wait up to 6 minutes and monitor the sysinv.log

Expected Behavior
------------------
No exception to occur.
The LLDP agent code should be more robust to handle unexpected json output.

Actual Behavior
----------------
An exception occurs in the default sysinv LLDP agent driver.

Reproducibility
---------------
100% Reproducible

System Configuration
--------------------
Any

Branch/Pull Time/Commit
-----------------------
master 11/7/2018

Timestamp/Logs
--------------

2018-11-06 20:23:18.360 8968 ERROR sysinv.agent.lldp.manager [-] Sysinv LLDP agent driver 'ovs' failed in lldp_agents_list
2018-11-06 20:23:18.360 8968 ERROR sysinv.agent.lldp.manager [-] string index out of range
2018-11-06 20:23:18.360 8968 TRACE sysinv.agent.lldp.manager Traceback (most recent call last):
2018-11-06 20:23:18.360 8968 TRACE sysinv.agent.lldp.manager File "/usr/lib64/python2.7/site-packages/sysinv/agent/lldp/manager.py", line 140, in lldp_agents_list
2018-11-06 20:23:18.360 8968 TRACE sysinv.agent.lldp.manager raise_orig_exc=True)
2018-11-06 20:23:18.360 8968 TRACE sysinv.agent.lldp.manager File "/usr/lib64/python2.7/site-packages/sysinv/agent/lldp/manager.py", line 75, in _call_drivers_and_return_array
2018-11-06 20:23:18.360 8968 TRACE sysinv.agent.lldp.manager ret = ret + method()
2018-11-06 20:23:18.360 8968 TRACE sysinv.agent.lldp.manager File "/usr/lib64/python2.7/site-packages/sysinv/agent/lldp/drivers/ovs/driver.py", line 161, in lldp_agents_list
2018-11-06 20:23:18.360 8968 TRACE sysinv.agent.lldp.manager self.lldp_ovs_update_flows()
2018-11-06 20:23:18.360 8968 TRACE sysinv.agent.lldp.manager File "/usr/lib64/python2.7/site-packages/sysinv/agent/lldp/drivers/ovs/driver.py", line 114, in lldp_ovs_update_flows
2018-11-06 20:23:18.360 8968 TRACE sysinv.agent.lldp.manager port_bridge_map = self.lldp_ovs_get_port_bridge_map()
2018-11-06 20:23:18.360 8968 TRACE sysinv.agent.lldp.manager File "/usr/lib64/python2.7/site-packages/sysinv/agent/lldp/drivers/ovs/driver.py", line 78, in lldp_ovs_get_port_bridge_map
2018-11-06 20:23:18.360 8968 TRACE sysinv.agent.lldp.manager value = port[1]
2018-11-06 20:23:18.360 8968 TRACE sysinv.agent.lldp.manager IndexError: string index out of range

Changed in starlingx:
status: New → In Progress
assignee: nobody → Steven Webster (swebster-wr)
Ghada Khalil (gkhalil)
tags: added: stx.2019.03 stx.networking
Changed in starlingx:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to stx-config (master)

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

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

Reviewed: https://review.openstack.org/617848
Committed: https://git.openstack.org/cgit/openstack/stx-config/commit/?id=5cd3d0dc02a90a83a958949859c8c8743408d81c
Submitter: Zuul
Branch: master

commit 5cd3d0dc02a90a83a958949859c8c8743408d81c
Author: Steven Webster <email address hidden>
Date: Wed Oct 31 17:01:54 2018 -0400

    Make LLDP OVS agent driver more robust to json output

    An issue was seen recently in which a bridge with a single port caused
    an exception in the LLDP driver, as the json output did not match what
    was expected. In this case, the port was a simple uuid/value list
    rather than a list of uuid/value lists.

    ie.

    ["br-ex",["uuid","val1"]]

    vs

    ["br-int",["set",[["uuid","val2"],["uuid","val3"]]]]

    This commit adds a fix to handle both cases, and also adds
    robustness to gracefully catch similar issues of unexpected json
    output.

    Closes-Bug: #1802118
    Change-Id: I73189f138a543f34e467f51e18544b521a00457c
    Signed-off-by: Steven Webster <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Ken Young (kenyis)
tags: added: stx.2019.05
removed: stx.2019.03
Ken Young (kenyis)
tags: added: stx.2.0
removed: stx.2019.05
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.