AttributeError: 'NoneType' object has no attribute 'db_find_rows'

Bug #1914857 reported by rj
20
This bug affects 5 people
Affects Status Importance Assigned to Milestone
networking-ovn
New
Undecided
Unassigned
neutron
New
Undecided
Unassigned

Bug Description

(neutron-server)[root@localhost /]# rpm -qa|egrep 'ovs|neutron'
python3-ovsdbapp-1.6.0-1.el8.noarch
openstack-neutron-common-17.0.0-1.el8.noarch
openstack-neutron-vpnaas-17.0.0-2.el8.noarch
python3-neutronclient-7.2.1-2.el8.noarch
python3-neutron-17.0.0-1.el8.noarch
python3-neutron-vpnaas-17.0.0-2.el8.noarch
openstack-neutron-17.0.0-1.el8.noarch
openstack-neutron-ml2-17.0.0-1.el8.noarch
python3-neutron-lib-2.6.1-2.el8.noarch
python3-neutron-dynamic-routing-17.0.0-2.el8.noarch

I found some error log in neutron-server.log:
2021-02-06 16:27:27.557 24 ERROR ovsdbapp.event [-] Unexpected exception in notify_loop: AttributeError: 'NoneType' object has no attribute 'db_find_rows'
2021-02-06 16:27:27.557 24 ERROR ovsdbapp.event Traceback (most recent call last):
2021-02-06 16:27:27.557 24 ERROR ovsdbapp.event File "/usr/lib/python3.6/site-packages/ovsdbapp/event.py", line 159, in notify_loop
2021-02-06 16:27:27.557 24 ERROR ovsdbapp.event match.run(event, row, updates)
2021-02-06 16:27:27.557 24 ERROR ovsdbapp.event File "/usr/lib/python3.6/site-packages/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovsdb_monitor.py", line 347, in run
2021-02-06 16:27:27.557 24 ERROR ovsdbapp.event self.driver.delete_mac_binding_entries(row.external_ip)
2021-02-06 16:27:27.557 24 ERROR ovsdbapp.event File "/usr/lib/python3.6/site-packages/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py", line 1010, in delete_mac_binding_entries
2021-02-06 16:27:27.557 24 ERROR ovsdbapp.event mac_binds = self._sb_ovn.db_find_rows(
2021-02-06 16:27:27.557 24 ERROR ovsdbapp.event AttributeError: 'NoneType' object has no attribute 'db_find_rows'
2021-02-06 16:27:27.557 24 ERROR ovsdbapp.event
2021-02-06 16:27:27.558 24 ERROR ovsdbapp.event [-] Unexpected exception in notify_loop: AttributeError: 'NoneType' object has no attribute 'db_find_rows'
2021-02-06 16:27:27.558 24 ERROR ovsdbapp.event Traceback (most recent call last):
2021-02-06 16:27:27.558 24 ERROR ovsdbapp.event File "/usr/lib/python3.6/site-packages/ovsdbapp/event.py", line 159, in notify_loop
2021-02-06 16:27:27.558 24 ERROR ovsdbapp.event match.run(event, row, updates)
2021-02-06 16:27:27.558 24 ERROR ovsdbapp.event File "/usr/lib/python3.6/site-packages/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovsdb_monitor.py", line 347, in run
2021-02-06 16:27:27.558 24 ERROR ovsdbapp.event self.driver.delete_mac_binding_entries(row.external_ip)
2021-02-06 16:27:27.558 24 ERROR ovsdbapp.event File "/usr/lib/python3.6/site-packages/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py", line 1010, in delete_mac_binding_entries
2021-02-06 16:27:27.558 24 ERROR ovsdbapp.event mac_binds = self._sb_ovn.db_find_rows(
2021-02-06 16:27:27.558 24 ERROR ovsdbapp.event AttributeError: 'NoneType' object has no attribute 'db_find_rows'
2021-02-06 16:27:27.558 24 ERROR ovsdbapp.event

how to fix this?

Revision history for this message
Lucas Alvares Gomes (lucasagomes) wrote :

Hi,

Do you have any steps to reproduce this ?

Cause looking at the traceback here, I seems like the self._sb_ovn is None, that means that the OVN driver is not yet connected to the OVN Southbound database.

Can you see in the logs if OVN eventually connected to it ?

One thing we could probably do in the driver is to check if the connection has already been established before trying to process these events.

Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Hi:

The point here is that the NB and the SB IDL instances are created always in the mech driver. The connection passed to those IDL classes will be tested in parent class ovs_idl.Backend init method [1]. If we cannot start the connection, an exception will be raised.

As Lucas asked, is it possible to reproduce it?

Regards.

[1]https://github.com/openstack/ovsdbapp/blob/aac2da8f0cb5adc006613e49d8d4fcf08531ef37/ovsdbapp/backend/ovs_idl/__init__.py#L38

Revision history for this message
rj (filiills01) wrote :

dear guys:
I don't know how to reproduce it,but I do have a full debug log,maybe you will find something in it.

Revision history for this message
Benjamin Reichel (breichel) wrote :

Hi,

i also see this problem. It always shows up when i restart neutron-server.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.