VnStat query not working in 23.1.2

Started by gpb, March 08, 2023, 01:15:42 AM

Previous topic - Next topic
Running a query in the VnStat tabs (hourly, daily, monthly, yearly) only returns the following message:

Error: Failed to get interface id from database (1): no such column: igb1
Error: Failed to fetch hourly data.


Not sure what happened here...hopefully not file corruption.  The upgrade went smooth and vnstat did not look to be updated in this release.  igb1 is my wan interface and that's all I capture.  Anyone else seeing this issue?  Thx.
HP T730/AMD  RX-427BB/8GB/500GB SSD
HP NC365T 4-PORT

Can confirm, just upgraded to 23.1.2 and I'm seeing the exact same error.


March 08, 2023, 06:16:44 AM #3 Last Edit: March 08, 2023, 06:19:37 AM by dirtyfreebooter
same here. i stopped the daemon, backed up the old database /var/lib/vnstat/vnstat.db and then deleted /var/lib/vnstat/vnstat.db, restarted daemon to start fresh and things started working again, but lost all my data.

the vnstat database is just sqlite db, i installed sqlite3 pkg, looking at the old database, i clearly see my pppoe0 interface in the interface table and see the stats in all the hourly, monthly, etc tables, not sure exactly what is happening

edit: spoke too soon, while it appeared to work at first, after a little time i got

Error: Failed to get interface id from database (1): no such column: pppoe0
Error: Failed to fetch monthly data.


the failure happens in web interface and on the command line via vnstat command


Does this bring it back then?

# opnsense-revert or 23.1.1 sqlite3

Unfortunately not much else we can do at the moment.


Cheers,
Franco

@franco...I tried reverting sqlite3 but didn't change anything.  It looks there might be a workaround (maybe you saw it in the link above...comment 6) but I'm not sure how to implement it.  If this is temporary it's just an inconvenience, nothing critical.  I don't need to revert opnsense but if you see a solution or workaround that's "easy"...well, you know...I'm happy to test.  :D

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269966#c6

@shokker thanks for tracking that down.

@dirtyfreebooter That's my worry losing historical data...I have a backup from a while ago...I need to set something up more frequent.  It looks like the timestamp on the file is current so maybe it's still recording just not query-able...wishful thinking.
HP T730/AMD  RX-427BB/8GB/500GB SSD
HP NC365T 4-PORT


Quote from: dirtyfreebooter on March 08, 2023, 10:56:44 PM
filed upstream bug with vnstat https://github.com/vergoh/vnstat/issues/243

Interesting...thanks for posting the bug report...sounds like an easy fix.
HP T730/AMD  RX-427BB/8GB/500GB SSD
HP NC365T 4-PORT

March 09, 2023, 11:04:06 PM #9 Last Edit: March 09, 2023, 11:07:03 PM by gpb
Confirmed the latest patch OPNsense 23.1.3-amd64 solved the issue (from the notes, "sqlite backs out disabling DQS option which broke software on multiple ends").  And vnStat was continuing to collect statistics.  Thanks @franco!

Edit: clarified sqlite update.
HP T730/AMD  RX-427BB/8GB/500GB SSD
HP NC365T 4-PORT


https://github.com/vergoh/vnstat/commit/2e66151541ffafd7de8778c14a66262a901716dc

vnstat author has already committed fix as well. hopefully new release soon as well.

---

also i can confirm that 23.1.3 also fixed vnstat for me.

Nice!  Now I don't have to choose between wireguard and vnstat. :)

OPNsense 23.1.3-amd64.  repair the bug