Connection drop to ovn network from host

Hi, I have setup an ovn network and once I have established the connection to the ovn instance the connection drop suddenly. I cant figure out what is the problem. Can someone help me out what may be wrong with that configuration.
Regards.
Here are the informations.

Client side.
nc -l 1234
Host side.
nc -v 10.10.198.2 1234
Connection to 10.10.198.2 1234 port [tcp/*] succeeded!
lxc network ls
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
|  NAME   |   TYPE   | MANAGED |      IPV4       |           IPV6            | DESCRIPTION | USED BY |  STATE  |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
| br-int  | bridge   | NO      |                 |                           |             | 0       |         |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
| enp1s0  | physical | NO      |                 |                           |             | 0       |         |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
| lxdbr0  | bridge   | YES     | 10.109.131.1/24 | fd42:591f:483a:b70::1/64  |             | 2       | CREATED |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
| lxdovn1 | bridge   | NO      |                 |                           |             | 0       |         |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
| ovntest | ovn      | YES     | 10.10.198.1/24  | fd42:27a3:fa42:8782::1/64 |             | 1       | CREATED |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
| wlp2s0  | physical | NO      |                 |                           |             | 0       |         |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
lxc ls
+------+---------+--------------------+-----------------------------------------------+-----------+-----------+
| NAME |  STATE  |        IPV4        |                     IPV6                      |   TYPE    | SNAPSHOTS |
+------+---------+--------------------+-----------------------------------------------+-----------+-----------+
| c1   | RUNNING | 10.10.198.2 (eth0) | fd42:27a3:fa42:8782:216:3eff:fe05:72b9 (eth0) | CONTAINER | 0         |
+------+---------+--------------------+-----------------------------------------------+-----------+-----------+
lxc network show ovntest
config:
  bridge.mtu: "1500"
  ipv4.address: 10.10.198.1/24
  ipv4.nat: "true"
  ipv6.address: fd42:27a3:fa42:8782::1/64
  ipv6.nat: "true"
  network: lxdbr0
  volatile.network.ipv4.address: 10.109.131.200
  volatile.network.ipv6.address: fd42:591f:483a:b70:216:3eff:fecb:7795
description: ""
name: ovntest
type: ovn
used_by:
- /1.0/instances/c1
managed: true
status: Created
locations:
- none
ip r
default via 192.168.9.1 dev wlp2s0 proto dhcp metric 600
10.10.198.0/24 via 10.109.131.200 dev lxdbr0
10.109.131.0/24 dev lxdbr0 proto kernel scope link src 10.109.131.1
10.109.131.200 dev lxdbr0 proto static scope link
169.254.0.0/16 dev lxdbr0 scope link metric 1000
192.168.9.0/24 dev wlp2s0 proto kernel scope link src 192.168.9.200 metric 600

Sorry to bumping this thread again but, I have warnings like that.

● ovn-ovsdb-server-nb.service - Open vSwitch database server for OVN Northbound database
     Loaded: loaded (/lib/systemd/system/ovn-ovsdb-server-nb.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2022-07-28 22:27:59 +03; 13min ago
   Main PID: 19827 (ovsdb-server)
      Tasks: 1 (limit: 4528)
     Memory: 3.3M
     CGroup: /system.slice/ovn-ovsdb-server-nb.service
             └─19827 ovsdb-server -vconsole:off -vfile:info --log-file=/var/log/ovn/ovsdb-server-nb.log --remote=punix:/var/run/ovn/ovnnb_db.sock --pidfile=/var/run/ovn/ovnnb_db.pid --unixctl=/var/run/ovn/ovnnb_db.ctl --remote=db:OVN_Nor>

Jul 28 22:37:20 lxdserver ovsdb-server[19827]: ovs|00009|jsonrpc|WARN|unix#3: receive error: Connection reset by peer
Jul 28 22:37:20 lxdserver ovsdb-server[19827]: ovs|00010|reconnect|WARN|unix#3: connection dropped (Connection reset by peer)
Jul 28 22:37:20 lxdserver ovsdb-server[19827]: ovs|00011|jsonrpc|WARN|unix#4: receive error: Connection reset by peer
Jul 28 22:37:20 lxdserver ovsdb-server[19827]: ovs|00012|reconnect|WARN|unix#4: connection dropped (Connection reset by peer)
Jul 28 22:37:21 lxdserver ovsdb-server[19827]: ovs|00013|jsonrpc|WARN|unix#5: receive error: Connection reset by peer
Jul 28 22:37:21 lxdserver ovsdb-server[19827]: ovs|00014|reconnect|WARN|unix#5: connection dropped (Connection reset by peer)
Jul 28 22:38:09 lxdserver ovsdb-server[19827]: ovs|00015|jsonrpc|WARN|unix#6: receive error: Connection reset by peer
Jul 28 22:38:09 lxdserver ovsdb-server[19827]: ovs|00016|reconnect|WARN|unix#6: connection dropped (Connection reset by peer)
Jul 28 22:40:53 lxdserver ovsdb-server[19827]: ovs|00017|jsonrpc|WARN|unix#7: receive error: Connection reset by peer
Jul 28 22:40:53 lxdserver ovsdb-server[19827]: ovs|00018|reconnect|WARN|unix#7: connection dropped (Connection reset by peer)

Instead of this, removing /var/lib/ovn and restart the ovn-central service replies another error message.

indiana@lxdserver:~$ lxc launch images:ubuntu/20.04/cloud c1 -n ovntest
Creating c1
Starting c1                                 
Error: Failed to start device "eth0": Failed setting up OVN port: Could not find DHCPv4 options for instance port for subnet "10.202.120.0/24"
Try `lxc info --show-log local:c1` for more info

I have tested this issue at another server so ignore the ip address. But the situation is the same. Any idea and clue would be appreciated.

Humm, I found that in the lxd.log lastly.

time="2022-07-28T23:52:23+03:00" level=error msg="Failed initializing network" err="Failed starting: Failed adding OVS chassis \"8a30823a-177d-4f0f-b7ae-78bd7a0f509f\" with priority 1138 to chassis group \"lxd-net2\": Failed to run: ovn-nbctl --timeout=10 --db unix:/var/lib/snapd/hostfs/run/ovn/ovnnb_db.sock --wait=sb ha-chassis-group-add-chassis lxd-net2 8a30823a-177d-4f0f-b7ae-78bd7a0f509f 1138: 2022-07-28T20:52:23Z|00002|ovsdb_idl|WARN|NB_Global table in OVN_Northbound database lacks nb_cfg_timestamp column (database needs upgrade?)\n2022-07-28T20:52:23Z|00003|ovsdb_idl|WARN|NB_Global table in OVN_Northbound database lacks sb_cfg_timestamp column (database needs upgrade?)\novn-nbctl: lxd-net2: ha_chassi_group name not found" network=ovntest project=default

Regards.

I have corrected the ovn problem but still get the following error.

● ovn-ovsdb-server-nb.service - Open vSwitch database server for OVN Northbound database
     Loaded: loaded (/lib/systemd/system/ovn-ovsdb-server-nb.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-07-29 00:12:43 +03; 29min ago
   Main PID: 39757 (ovsdb-server)
      Tasks: 1 (limit: 4528)
     Memory: 2.7M
     CGroup: /system.slice/ovn-ovsdb-server-nb.service
             └─39757 ovsdb-server -vconsole:off -vfile:info --log-file=/var/log/ovn/ovsdb-server-nb.log --remote=punix:/var/run/ovn/ovnnb_db.sock --pidfile=/var/run/ovn/ovnnb_db.pid --unixctl=/var/run/ovn/ovnnb_db.ctl --remote=db:OVN_Nor>

Jul 29 00:22:45 lxdserver ovsdb-server[39757]: ovs|00058|jsonrpc|WARN|unix#41: receive error: Connection reset by peer
Jul 29 00:22:45 lxdserver ovsdb-server[39757]: ovs|00059|reconnect|WARN|unix#41: connection dropped (Connection reset by peer)
Jul 29 00:22:45 lxdserver ovsdb-server[39757]: ovs|00060|jsonrpc|WARN|unix#49: receive error: Connection reset by peer
Jul 29 00:22:45 lxdserver ovsdb-server[39757]: ovs|00061|reconnect|WARN|unix#49: connection dropped (Connection reset by peer)
Jul 29 00:24:11 lxdserver ovsdb-server[39757]: ovs|00062|jsonrpc|WARN|unix#71: receive error: Connection reset by peer
Jul 29 00:24:11 lxdserver ovsdb-server[39757]: ovs|00063|reconnect|WARN|unix#71: connection dropped (Connection reset by peer)
Jul 29 00:24:11 lxdserver ovsdb-server[39757]: ovs|00064|jsonrpc|WARN|unix#72: receive error: Connection reset by peer
Jul 29 00:24:11 lxdserver ovsdb-server[39757]: ovs|00065|reconnect|WARN|unix#72: connection dropped (Connection reset by peer)
Jul 29 00:24:11 lxdserver ovsdb-server[39757]: ovs|00066|jsonrpc|WARN|unix#75: send error: Broken pipe
Jul 29 00:24:11 lxdserver ovsdb-server[39757]: ovs|00067|reconnect|WARN|unix#75: connection dropped (Broken pipe)

I have now get the idea of ovn a little bit :face_with_spiral_eyes:, case solved soon. :slight_smile: Thanks and Regards.

How did you solve it?

Actually, I have reread that thread https://discuss.linuxcontainers.org/t/cant-make-ovn-network-forward-working-in-cluster-environment/13579/5 and define the ipv{4}.routes and lxc network forward as you describe then now everything works right now. I have missed the detail before because of my lack of ovn information and lxd network.
Here are my details.

localadmin@d0051:~$ lxc network ls
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
|  NAME   |   TYPE   | MANAGED |      IPV4       |           IPV6            | DESCRIPTION | USED BY |  STATE  |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
| br-int  | bridge   | NO      |                 |                           |             | 0       |         |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
| enp1s0  | physical | NO      |                 |                           |             | 0       |         |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
| lxdbr0  | bridge   | YES     | 10.109.131.1/24 | fd42:591f:483a:b70::1/64  |             | 2       | CREATED |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
| lxdovn1 | bridge   | NO      |                 |                           |             | 0       |         |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
| ovntest | ovn      | YES     | 10.10.198.1/24  | fd42:27a3:fa42:8782::1/64 |             | 3       | CREATED |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
| wlp2s0  | physical | NO      |                 |                           |             | 0       |         |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
localadmin@d0051:~$ lxc network show lxdbr0
config:
  ipv4.address: 10.109.131.1/24
  ipv4.dhcp.ranges: 10.109.131.10-10.109.131.100
  ipv4.nat: "true"
  ipv4.ovn.ranges: 10.109.131.200-10.109.131.250
  ipv4.routes: 10.109.131.5/32
  ipv6.address: fd42:591f:483a:b70::1/64
  ipv6.nat: "true"
description: ""
name: lxdbr0
type: bridge
used_by:
- /1.0/networks/ovntest
- /1.0/profiles/default
managed: true
status: Created
locations:
- none
localadmin@d0051:~$ lxc network forward ls ovntest
+----------------+-------------+------------------------+-------+
| LISTEN ADDRESS | DESCRIPTION | DEFAULT TARGET ADDRESS | PORTS |
+----------------+-------------+------------------------+-------+
| 10.109.131.5   |             | 10.10.198.2            | 0     |
+----------------+-------------+------------------------+-------+

But if you are talking about that problem, NB_Global table in OVN_Northbound database lacks nb_cfg_timestamp column (database needs upgrade?) then
I overcome as I delete the ovn network and define again.
Regards.