OPNsense Forum

Archive => 23.1 Legacy Series => Topic started by: gpb on March 08, 2023, 01:15:42 AM

Title: VnStat query not working in 23.1.2
Post by: gpb on March 08, 2023, 01:15:42 AM
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.
Title: Re: VnStat query not working in 23.1.2
Post by: travioli on March 08, 2023, 04:58:33 AM
Can confirm, just upgraded to 23.1.2 and I'm seeing the exact same error.
Title: Re: VnStat query not working in 23.1.2
Post by: wuwzy on March 08, 2023, 05:23:03 AM
yes.  me too
Title: Re: VnStat query not working in 23.1.2
Post by: dirtyfreebooter on March 08, 2023, 06:16:44 AM
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
Title: Re: VnStat query not working in 23.1.2
Post by: shokker on March 08, 2023, 09:08:53 AM
It looks to be an upstream bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269966
Title: Re: VnStat query not working in 23.1.2
Post by: franco on March 08, 2023, 09:28:25 AM
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
Title: Re: VnStat query not working in 23.1.2
Post by: gpb on March 08, 2023, 03:13:32 PM
@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.
Title: Re: VnStat query not working in 23.1.2
Post by: dirtyfreebooter on March 08, 2023, 10:56:44 PM
filed upstream bug with vnstat https://github.com/vergoh/vnstat/issues/243
Title: Re: VnStat query not working in 23.1.2
Post by: gpb on March 08, 2023, 11:04:04 PM
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.
Title: Re: VnStat query not working in 23.1.2
Post by: gpb on March 09, 2023, 11:04:06 PM
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.
Title: Re: VnStat query not working in 23.1.2
Post by: franco on March 09, 2023, 11:07:53 PM
happy to hear :)


Cheers,
Franco
Title: Re: VnStat query not working in 23.1.2
Post by: dirtyfreebooter on March 09, 2023, 11:17:15 PM
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.
Title: Re: VnStat query not working in 23.1.2
Post by: CJ on March 10, 2023, 02:09:04 AM
Nice!  Now I don't have to choose between wireguard and vnstat. :)
Title: Re: VnStat query not working in 23.1.2
Post by: wuwzy on March 10, 2023, 10:52:17 AM
OPNsense 23.1.3-amd64.  repair the bug