[ovn] lsp_set_address Exception possible when passed empty list of addresses

Bug #1860560 reported by Terry Wilson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Terry Wilson

Bug Description

It is possible for maintenance.check_for_port_security_unknown_address() to pass addresses=[] to lsp_set_addresses() which will fail the regex check for it being a correct address. This matches the behavior of ovn-nbctl's lsp-set-addresses. We should ensure that we don't pass [] to lsp_set_addresses.

Example:

2020-01-17 16:52:32.786 53 ERROR futurist.periodics [req-0187e45b-682f-4c1d-ab26-20bc89c223e5 - - - - -] Failed to call periodic 'networking_ovn.common.maintenance.DBInconsistenciesPeriodics.check_for_port_security_unknown_address' (it runs every 600.00 seconds): TypeError: address must be router/unknown/dynamic/ethaddr ipaddr...
2020-01-17 16:52:32.786 53 ERROR futurist.periodics Traceback (most recent call last):
2020-01-17 16:52:32.786 53 ERROR futurist.periodics File "/usr/lib/python2.7/site-packages/futurist/periodics.py", line 290, in run
2020-01-17 16:52:32.786 53 ERROR futurist.periodics work()
2020-01-17 16:52:32.786 53 ERROR futurist.periodics File "/usr/lib/python2.7/site-packages/futurist/periodics.py", line 64, in __call__
2020-01-17 16:52:32.786 53 ERROR futurist.periodics return self.callback(*self.args, **self.kwargs)
2020-01-17 16:52:32.786 53 ERROR futurist.periodics File "/usr/lib/python2.7/site-packages/futurist/periodics.py", line 178, in decorator
2020-01-17 16:52:32.786 53 ERROR futurist.periodics return f(*args, **kwargs)
2020-01-17 16:52:32.786 53 ERROR futurist.periodics File "/usr/lib/python2.7/site-packages/networking_ovn/common/maintenance.py", line 447, in check_for_port_security_unknown_address
2020-01-17 16:52:32.786 53 ERROR futurist.periodics port.name, addresses=addresses).execute(check_error=True)
2020-01-17 16:52:32.786 53 ERROR futurist.periodics File "/usr/lib/python2.7/site-packages/ovsdbapp/schema/ovn_northbound/impl_idl.py", line 89, in lsp_set_addresses
2020-01-17 16:52:32.786 53 ERROR futurist.periodics return cmd.LspSetAddressesCommand(self, port, addresses)
2020-01-17 16:52:32.786 53 ERROR futurist.periodics File "/usr/lib/python2.7/site-packages/ovsdbapp/schema/ovn_northbound/commands.py", line 305, in __init__
2020-01-17 16:52:32.786 53 ERROR futurist.periodics "address must be router/unknown/dynamic/ethaddr ipaddr...")
2020-01-17 16:52:32.786 53 ERROR futurist.periodics TypeError: address must be router/unknown/dynamic/ethaddr ipaddr...

Tags: ovn
Changed in neutron:
assignee: nobody → Terry Wilson (otherwiseguy)
status: New → In Progress
Revision history for this message
Terry Wilson (otherwiseguy) wrote :
tags: added: ovn
Changed in neutron:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/703703
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=c6a5b284b54d59273a387aaf7723391e9100bf3c
Submitter: Zuul
Branch: master

commit c6a5b284b54d59273a387aaf7723391e9100bf3c
Author: Terry Wilson <email address hidden>
Date: Tue Jan 21 16:12:45 2020 -0600

    Ensure we don't pass empty addresses to lsp_set_addresses

    If we somehow have an empty set of addresses, lsp_set_addresses
    will fail. This instead calls db_clear() on the addresses field if
    we are trying to set it to empty.

    Closes-bug: #1860560

    Change-Id: Ied92eb85b74e63a7317d50970b5131fb49e3e4b0

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 16.0.0.0b1

This issue was fixed in the openstack/neutron 16.0.0.0b1 development milestone.

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.