[Solved] VnStat doesn't work after 19.7.10 update

Started by nblom, January 29, 2020, 01:29:55 PM

Previous topic - Next topic
January 29, 2020, 01:29:55 PM Last Edit: January 29, 2020, 05:14:51 PM by nblom
I just updated my firewall to 19.7.10 and now all the tabs on the VnStat page are blank.

I get these errors in the log:

Jan 29 12:24:16 configd.py: [1a1322e2-d01c-45bb-bb9b-eaa065e6858b] Script action failed with Command '/usr/local/bin/vnstat -h' returned non-zero exit status 1. at Traceback (most recent call last): File "/usr/local/opnsense/service/modules/processhandler.py", line 484, in execute stdout=output_stream, stderr=error_stream) File "/usr/local/lib/python3.7/subprocess.py", line 363, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '/usr/local/bin/vnstat -h' returned non-zero exit status 1.
Jan 29 12:24:16 configd.py: [1a1322e2-d01c-45bb-bb9b-eaa065e6858b] request Vnstat hourly status
Jan 29 12:24:16 configd.py: [ef2cfbb7-2b7a-4569-91be-92e30f39f3db] Script action failed with Command '/usr/local/bin/vnstat -d' returned non-zero exit status 1. at Traceback (most recent call last): File "/usr/local/opnsense/service/modules/processhandler.py", line 484, in execute stdout=output_stream, stderr=error_stream) File "/usr/local/lib/python3.7/subprocess.py", line 363, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '/usr/local/bin/vnstat -d' returned non-zero exit status 1.
Jan 29 12:24:16 configd.py: [ef2cfbb7-2b7a-4569-91be-92e30f39f3db] request Vnstat daily status
Jan 29 12:24:16 configd.py: [98223e4d-785c-4974-b1b9-41ed7e62cff9] Script action failed with Command '/usr/local/bin/vnstat -m' returned non-zero exit status 1. at Traceback (most recent call last): File "/usr/local/opnsense/service/modules/processhandler.py", line 484, in execute stdout=output_stream, stderr=error_stream) File "/usr/local/lib/python3.7/subprocess.py", line 363, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '/usr/local/bin/vnstat -m' returned non-zero exit status 1.
Jan 29 12:24:16 configd.py: [98223e4d-785c-4974-b1b9-41ed7e62cff9] request Vnstat weekly status
Jan 29 12:24:13 configd.py: [4cc4bbc2-6a0f-464b-831c-e28d06977a39] Script action failed with Command '/usr/local/bin/vnstat -m' returned non-zero exit status 1. at Traceback (most recent call last): File "/usr/local/opnsense/service/modules/processhandler.py", line 484, in execute stdout=output_stream, stderr=error_stream) File "/usr/local/lib/python3.7/subprocess.py", line 363, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '/usr/local/bin/vnstat -m' returned non-zero exit status 1.
Jan 29 12:24:13 configd.py: [4cc4bbc2-6a0f-464b-831c-e28d06977a39] request Vnstat weekly status
Jan 29 12:24:13 configd.py: [d2f4cd91-e327-454f-b501-12fe4301ec93] Script action failed with Command '/usr/local/bin/vnstat -d' returned non-zero exit status 1. at Traceback (most recent call last): File "/usr/local/opnsense/service/modules/processhandler.py", line 484, in execute stdout=output_stream, stderr=error_stream) File "/usr/local/lib/python3.7/subprocess.py", line 363, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '/usr/local/bin/vnstat -d' returned non-zero exit status 1.
Jan 29 12:24:13 configd.py: [d2f4cd91-e327-454f-b501-12fe4301ec93] request Vnstat daily status
Jan 29 12:24:13 configd.py: [77465699-cfa8-4cca-97d9-86fc41ee01c6] Script action failed with Command '/usr/local/bin/vnstat -h' returned non-zero exit status 1. at Traceback (most recent call last): File "/usr/local/opnsense/service/modules/processhandler.py", line 484, in execute stdout=output_stream, stderr=error_stream) File "/usr/local/lib/python3.7/subprocess.py", line 363, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '/usr/local/bin/vnstat -h' returned non-zero exit status 1.


Thanks for any help!


I ran the command and got the same error messages in the Backend log.

I then ran these commands from the root shell:
root@OPNsense:~ # /usr/local/bin/vnstat -h
Error: Not all requested interfaces found in database or given interfaces aren't unique.
root@OPNsense:~ # /usr/local/bin/vnstat -d
Error: Not all requested interfaces found in database or given interfaces aren't unique.
root@OPNsense:~ #


This makes me think I have a corrupt (or outdated) vnStat DB. I did have to revert to factory settings on this box just the other day because I switched from vm nics to pci pass through (switched to igb in the vm itself). Did the vnStat db point to the vm nics and now can't find them? Does the vnStat db not get reset during factory reset?

How do I reset/fix the vnStat db?

Thanks!

It was the fact that I changed my interface names from vmx to igb.

vnStat was not cleared on the factory reset.

I backed up /var/lib/vnstat and then removed everything under that directory. Restarted/reconfigured vnstat in the UI and it worked.

I then re-upgraded vnstat to 2.6 and looked at the UI and it worked too.

Everything is good. Sorry for the confusion.