Status Traffic Totals (vnstat) errors on devel snapshots
-
Since I updated from stable to development a few weeks ago, I’m seeing the following error related to the Status Traffic Totals (vnstat) package. This is still there after updating to 2.7.0.a.20221216.0600.
This happens once at each boot and shutdown/restart.
PHP ERROR: Type: 1, File: /usr/local/pkg/status_traffic_totals.inc, Line: 189, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/status_traffic_totals.inc:189 Stack trace: #0 /usr/local/pkg/status_traffic_totals.inc(76): vnstat_portlist() #1 /usr/local/pkg/status_traffic_totals.inc(226): vnstat_create_nic_dbs() #2 /etc/inc/pkg-utils.inc(707) : eval()'d code(1): vnstat_sync() #3 /etc/inc/pkg-utils.inc(707): eval() #4 /etc/rc.start_packages(66): sync_package('Traffic Totals') #5 {main} thrown @ 2022-12-18 07:29:54
Any ideas on how to fix it or diagnose it further?
-
Performed a clean install of 2.7.0.a.20221216.0600
Upon package installation and clicking on Status/Traffic Totals I get the following crash report.
Crash report begins. Anonymous machine information: amd64 14.0-CURRENT FreeBSD 14.0-CURRENT #0 devel-main-n255822-bd5b6c0d6cc: Fri Dec 16 06:30:22 UTC 2022 root@freebsd:/var/jenkins/workspace/pfSense-CE-snapshots-master-main/obj/amd64/hGmhV9E3/var/jenkins/workspace/pfSense-CE-snapshots-master-main/sources/FreeBSD-src-dev Crash report details: PHP Errors: [18-Dec-2022 00:17:58 America/Chicago] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/status_traffic_totals.inc:189 Stack trace: #0 /usr/local/www/status_traffic_totals.php(53): vnstat_portlist() #1 {main} thrown in /usr/local/pkg/status_traffic_totals.inc on line 189 No FreeBSD crash data found.
-
@pfsvrb
I also tried doing a clean install on the earliest available 2.7.0 build on the mirror from November 15th 2022. Once installed it gives the same error after trying to add the Traffic Totals package.I'm not a pro at this but if I cat out the /usr/local/pkg/status_traffic_totals.inc line 189, I see the following:
if (is_array($config['openvpn']["openvpn-{$mode}"])) {
So it seems to be choking on this. Maybe some OpenVPN options changed with the FreeBSD 14 migration?
-
I opened a Redmine issue for this, that OpenVPN interface code is problematic for sure, but there might be other things that need updated for PHP 8.1 as well.