Description of problem: When ovn-sbctl runs in the daemon mode, the `lflow-list/dump-flows` commands do not produce any output. Maybe other commands of ovn-snctl and ovn-nbctl have the same issue. Version-Release number of selected component (if applicable): ovn-sbctl 21.03.90 Open vSwitch Library 2.15.90 DB Schema 20.17.0 How reproducible: see below Steps to Reproduce: 1. create several of logical floes, e.g. `ovn-nbctl ls-add sw0` 2. validate that `ovn-sbctl lflow-list` returns the flows. 3. run ovn-sbctl as a daemon `export OVN_SB_DAEMON=$(ovn-sbctl --pidfile --detach)` 4 repeat the `ovn-sbctl lflow-list` call. It doesn't produce any output. Actual results: No logic flows is printed Expected results: Print logical flows. Additional info:
If you're looking for a sandbox reproducer: export OVN_SB_DAEMON=$(ovn-sbctl --pidfile --detach) ovn-nbctl ls-add sw ovn-nbctl lr-add ro1 ovn-nbctl lrp-add ro1 ro1-sw 00:00:00:00:00:01 10.0.0.1/24 ovn-nbctl lsp-add sw sw-ro1 ovn-nbctl lr-add ro2 ovn-nbctl lrp-add ro2 ro2-sw 00:00:00:00:00:02 20.0.0.1/24 ovn-nbctl --wait=sb lsp-add sw sw-ro2 ovn-nbctl ls-add ls1 ovn-nbctl lsp-add ls1 vm1 ovn-nbctl lsp-set-addresses vm1 "00:00:00:00:01:02 192.168.1.2" ovn-nbctl lrp-add ro1 ro1-ls1 00:00:00:00:01:01 192.168.1.1/24 ovn-nbctl lsp-add ls1 ls1-ro1 ovn-nbctl lsp-set-type ls1-ro1 router ovn-nbctl lsp-set-addresses ls1-ro1 router ovn-nbctl lsp-set-options ls1-ro1 router-port=ro1-ls1 ovn-nbctl ls-add ls2 ovn-nbctl lsp-add ls2 vm2 ovn-nbctl lsp-set-addresses vm2 "00:00:00:00:02:02 192.168.2.2" ovn-nbctl lrp-add ro2 ro2-ls2 00:00:00:00:02:01 192.168.2.1/24 ovn-nbctl lsp-add ls2 ls2-ro2 ovn-nbctl lsp-set-type ls2-ro2 router ovn-nbctl lsp-set-addresses ls2-ro2 router ovn-nbctl lsp-set-options ls2-ro2 router-port=ro2-ls2 ovn-nbctl lsp-set-type sw-ro1 router ovn-nbctl lsp-set-addresses sw-ro1 router ovn-nbctl lsp-set-options sw-ro1 router-port=ro1-sw ovn-nbctl lsp-set-type sw-ro2 router ovn-nbctl lsp-set-addresses sw-ro2 router ovn-nbctl --wait=sb lsp-set-options sw-ro2 router-port=ro2-sw Try running `ovn-sbctl lflow-list` and you'll see no output.
I'm pretty sure this issue here is that lflow-list uses printf to output the data. However, in daemon mode, the data needs to be sent to the sbctl client process to be output instead.
Verified on ovn-2021-20.06.0-4: [root@wsfd-advnetlab16 bz1965780]# rpm -qa | grep -E "openvswitch|ovn-2021" openvswitch-selinux-extra-policy-1.0-28.el8fdp.noarch ovn-2021-21.06.0-4.el8fdp.x86_64 openvswitch2.15-2.15.0-26.el8fdp.x86_64 ovn-2021-central-21.06.0-4.el8fdp.x86_64 ovn-2021-host-21.06.0-4.el8fdp.x86_64 [root@wsfd-advnetlab16 bz1965780]# cat rep.sh systemctl start openvswitch systemctl start ovn-northd ovn-nbctl set-connection ptcp:6641 ovn-sbctl set-connection ptcp:6642 ovs-vsctl set open . external_ids:system-id=hv1 external_ids:ovn-remote=tcp:1.1.171.25:6642 external_ids:ovn-encap-type=geneve external_ids:ovn-encap-ip=1.1.171.25 systemctl restart ovn-controller ovn-nbctl ls-add ls1 ovn-nbctl lsp-add ls1 ls1p1 ovn-nbctl lsp-set-addresses ls1p1 "00:00:00:01:01:01 192.168.1.1" ovs-vsctl add-port br-int ls1p1 -- set interface ls1p1 type=internal external_ids:iface-id=ls1p1 ovn-sbctl lflow-list export OVN_SB_DAEMON=$(ovn-sbctl --pidfile --detach) echo $OVN_SB_DAEMON ovn-sbctl lflow-list + export OVN_SB_DAEMON=/var/run/ovn/ovn-sbctl.33316.ctl + OVN_SB_DAEMON=/var/run/ovn/ovn-sbctl.33316.ctl + echo /var/run/ovn/ovn-sbctl.33316.ctl /var/run/ovn/ovn-sbctl.33316.ctl + ovn-sbctl lflow-list Datapath: "ls1" (2773fde0-72c6-48a2-91f7-bd0ae820aeb5) Pipeline: ingress table=0 (ls_in_port_sec_l2 ), priority=100 , match=(eth.src[40]), action=(drop;) ...... <=== flow is printed
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (ovn bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:2969