Bug 1608408 - Listing ports fails when stray subnet is present in db
Summary: Listing ports fails when stray subnet is present in db
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-provider-ovn
Classification: oVirt
Component: provider
Version: 1.2.7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ovirt-4.2.6
: ---
Assignee: Marcin Mirecki
QA Contact: Michael Burman
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-25 13:19 UTC by Marcin Mirecki
Modified: 2018-09-03 15:07 UTC (History)
5 users (show)

Fixed In Version: ovirt-provider-ovn-1.2.14
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-03 15:07:58 UTC
oVirt Team: Network
Embargoed:
rule-engine: ovirt-4.2+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 93328 0 master MERGED Stray subnet should not interfere with listing ports 2021-02-03 13:20:27 UTC

Description Marcin Mirecki 2018-07-25 13:19:52 UTC
Listing ports fails when stray subnet is present in db.

Stray subnets can appear in the db if the user deletes
a network outside of the provider. This leaves some
references in the db in a corrupted state. Deleting
entities outside of the provider is not supported,
but it should not affect working with other entities
present in the db.

The relevant log messages:

ElementNotFoundError: Cannot find Logical_Switch with name=7aead74b-9b81-4206-8ba3-5e0aa9b183aa
2018-07-25 13:48:51,100 root From: 10.35.128.15:54124 Request: GET /v2.0/ports?id=19ca17aa-7519-4a2a-8c2b-eabfc669b8ff
2018-07-25 13:48:51,103 requests.packages.urllib3.connectionpool Starting new HTTPS connection (1): mburman-4-upgrade-env.scl.lab.tlv.redhat.com
2018-07-25 13:48:51,146 requests.packages.urllib3.connectionpool "POST /ovirt-engine/sso/oauth/token-info HTTP/1.1" 200 323
2018-07-25 13:48:51,450 ovsdbapp.backend.ovs_idl.transaction Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ovsdbapp/backend/ovs_idl/connection.py", line 100, in run
    txn.results.put(txn.do_commit())
  File "/usr/lib/python2.7/site-packages/ovsdbapp/backend/ovs_idl/transaction.py", line 86, in do_commit
    command.run_idl(txn)
  File "/usr/lib/python2.7/site-packages/ovsdbapp/backend/ovs_idl/command.py", line 246, in run_idl
    self.result = self.api.lookup(self.table, self.record)
  File "/usr/lib/python2.7/site-packages/ovsdbapp/backend/ovs_idl/__init__.py", line 103, in lookup
    return self._lookup(table, record)
  File "/usr/lib/python2.7/site-packages/ovsdbapp/backend/ovs_idl/__init__.py", line 143, in _lookup
    row = idlutils.row_by_value(self, rl.table, rl.column, record)
  File "/usr/lib/python2.7/site-packages/ovsdbapp/backend/ovs_idl/idlutils.py", line 63, in row_by_value
    raise RowNotFound(table=table, col=column, match=match)
RowNotFound: Cannot find Logical_Switch with name=7aead74b-9b81-4206-8ba3-5e0aa9b183aa

Comment 1 Michael Burman 2018-08-15 13:58:37 UTC
Verified on - ovirt-provider-ovn-1.2.14-1.el7ev.noarch with
4.2.6.3_SNAPSHOT-94.gbbcd5cb.0.scratch.master.el7ev
vdsm-4.20.37-1.el7ev.x86_64
openvswitch-ovn-central-2.9.0-55.el7fdp.x86_64
openvswitch-ovn-common-2.9.0-55.el7fdp.x86_64

- Note that if removing a logical switch(network), but leaving it's subnet stray, we still see this multiple errors in the ovirt-provider.log


2018-08-15 16:43:34,898 ovsdbapp.backend.ovs_idl.command Error executing command
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ovsdbapp/backend/ovs_idl/command.py", line 35, in execute
    txn.add(self)
  File "/usr/lib64/python2.7/contextlib.py", line 24, in __exit__
    self.gen.next()
  File "/usr/lib/python2.7/site-packages/ovsdbapp/api.py", line 94, in transaction
    self._nested_txn = None
  File "/usr/lib/python2.7/site-packages/ovsdbapp/api.py", line 54, in __exit__
    self.result = self.commit()
  File "/usr/lib/python2.7/site-packages/ovsdbapp/backend/ovs_idl/transaction.py", line 62, in commit
    raise result.ex
RowNotFound: Cannot find Logical_Switch with name=4cc5441d-d3b7-48e3-a31e-e17b75ad5f16

- But now all the other entities in db are not affected and we still may continue working and run VMs with ovn networks. 
Marcin, the errors(about missing ls) in the provider.log are expected correct?

Comment 2 Marcin Mirecki 2018-08-27 07:59:41 UTC
The error is raised, but we handle it.
I would rather leave this in the log, it shows us that there are some problems with the db consistency, which would otherwise go unnoticed forever.


Note You need to log in before you can comment on or make changes to this bug.