amorenoz / ovsdb-mon

An OVSDB database visualization tool based on auto-generated schema bindings
Apache License 2.0
23 stars 4 forks source link

Issue running ovsdb-mon #36

Open gavmckee80 opened 1 year ago

gavmckee80 commented 1 year ago

Hi,

I am getting the following error when I run ovsdb-mon. Are there any additional logs I can provide?

gmckee@usc01a-lab-ovn04:~/Projects/ovsdb-mon/bin$ sudo ./ovsdb-mon -db unix:/var/run/ovn/ovnnb_db.sock
2022/12/07 21:37:43 libovsdb: trying to connect to DB unix:/var/run/ovn/ovnnb_db.sock
2022/12/07 21:37:43 libovsdb: connected to unix:/var/run/ovn/ovnnb_db.sock
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0x68338c]

goroutine 1 [running]:
main.(*OvsdbShell).exactFieldName(0xc00022bd70?, {0xc0000e2330?, 0xc000147870?}, {0xc000147a4c, 0x4})
    /home/gmckee/Projects/ovsdb-mon/cmd/ovsdb-mon/shell.go:381 +0x6c
main.(*OvsdbShell).Run(0xc000133260, {0x78ba40?, 0xc000133340?}, {0xc00009c170, 0x0, 0x0})
    /home/gmckee/Projects/ovsdb-mon/cmd/ovsdb-mon/shell.go:142 +0x1025
main.main()
    /home/gmckee/Projects/ovsdb-mon/cmd/ovsdb-mon/ovsdb-mon.go:68 +0x37c
gmckee@usc01a-lab-ovn04:~/Projects/ovsdb-mon/bin$ systemctl status ovn-ovsdb-server-nb.service
● 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-11-24 00:03:08 UTC; 1 week 6 days ago
   Main PID: 3139 (ovsdb-server)
      Tasks: 1 (limit: 9289)
     Memory: 2.4M
        CPU: 1h 12min 57.382s
     CGroup: /system.slice/ovn-ovsdb-server-nb.service
             └─3139 ovsdb-server -vconsole:off -vfile:info --log-file=/var/log/ovn/ovsdb-server-nb.log --remote=punix:/var/run/ovn/ovnnb_db.sock --p>

Dec 06 00:00:12 usc01a-lab-ovn04 ovsdb-server[3139]: ovs|00193|vlog|INFO|closing log file
Dec 06 00:00:12 usc01a-lab-ovn04 ovsdb-server[3139]: ovs|00194|vlog|INFO|opened log file /var/log/ovn/ovsdb-server-nb.log
Dec 06 01:39:55 usc01a-lab-ovn04 ovsdb-server[3139]: ovs|00195|jsonrpc|WARN|unix#803: send error: Broken pipe
Dec 06 01:39:55 usc01a-lab-ovn04 ovsdb-server[3139]: ovs|00196|reconnect|WARN|unix#803: connection dropped (Broken pipe)
Dec 06 01:42:55 usc01a-lab-ovn04 ovsdb-server[3139]: ovs|00197|jsonrpc|WARN|unix#806: send error: Broken pipe
Dec 06 01:42:55 usc01a-lab-ovn04 ovsdb-server[3139]: ovs|00198|reconnect|WARN|unix#806: connection dropped (Broken pipe)
Dec 07 00:00:13 usc01a-lab-ovn04 ovsdb-server[3139]: ovs|00199|vlog|INFO|closing log file
Dec 07 00:00:13 usc01a-lab-ovn04 ovsdb-server[3139]: ovs|00200|vlog|INFO|opened log file /var/log/ovn/ovsdb-server-nb.log
Dec 07 18:03:29 usc01a-lab-ovn04 ovsdb-server[3139]: ovs|00201|jsonrpc|WARN|tcp:172.16.49.9:40520: error parsing stream: line 1, column 0, byte 2: i>
Dec 07 18:03:29 usc01a-lab-ovn04 ovsdb-server[3139]: ovs|00202|reconnect|WARN|tcp:172.16.49.9:40520: connection dropped (Protocol error)

OVN Version 22.03.0

$ ovn-nbctl --version
ovn-nbctl 22.03.0
Open vSwitch Library 2.17.0
DB Schema 6.1.0
gavmckee80 commented 1 year ago

The issue was related to the fact that I didn't download my schema when doing the build

amorenoz commented 1 year ago

Hi @gavmckee80. Indeed, you need to build ovsdb-mon against your schema:

ovsdb-client get-schema unix:/var/run/ovn/ovnnb_db.sock OVN_Northbound > schemas/nb.ovsschema
make SCHEMA=schemas/nb.ovsschema

Also, you may try running the available container image using your podman or docker, something like this should work:

podman --detach --name ovsdb-mon --rm --network=host -v /var/run/ovn:/run/ovn quay.io/amorenoz/ovsdb-mon:latest
podman exec -it ovsdb-mon ovsdb-mon.OVN_Northbound