Bug #13619
closedpfSense - Feature #13446: Upgrade PHP from 7.4 to 8.1
PHP Error in pfblockerNG-devel widget
100%
Description
pfSense-pkg-pfBlockerNG-devel-3.1.0_10
Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/widgets/widgets/pfblockerng.widget.php:303 Stack trace: #0 /usr/local/www/widgets/widgets/pfblockerng.widget.php(472): pfBlockerNG_update_table() #1 /usr/local/www/widgets/widgets/pfblockerng.widget.php(948): pfBlockerNG_get_header() #2 /usr/local/www/index.php(430): include('/usr/local/www/...') #3 {main} thrown in /usr/local/www/widgets/widgets/pfblockerng.widget.php on line 303 PHP ERROR: Type: 1, File: /usr/local/www/widgets/widgets/pfblockerng.widget.php, Line: 303, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/widgets/widgets/pfblockerng.widget.php:303 Stack trace: #0 /usr/local/www/widgets/widgets/pfblockerng.widget.php(472): pfBlockerNG_update_table() #1 /usr/local/www/widgets/widgets/pfblockerng.widget.php(948): pfBlockerNG_get_header() #2 /usr/local/www/index.php(430): include('/usr/local/www/...') #3 {main} thrown
Files
Updated by Jim Pingle about 2 years ago
- Project changed from pfSense to pfSense Packages
- Subject changed from Error in pfblockerNG-devel widget to PHP Error in pfblockerNG-devel widget
- Category changed from Package System to pfBlockerNG
- Release Notes deleted (
Default)
Updated by BBcan177 . about 2 years ago
Its calling:
foreach (pfSense_get_pf_rules() as $prule) { $prule_id = $prule['tracker'];
Seems like some rules are missing the ['tracker'] key?
Can add a check to see if tracker exists before proceeding?
Updated by Marcos M about 2 years ago
Seems like some rules are missing the ['tracker'] key?
If I remember correctly while working on #13156, that is indeed the case. I did not write this with PHP8.1 in mind. The whole widget code should probably be reviewed for PHP8.1 compatibility issues.
Updated by Reid Linnemann about 2 years ago
BBcan177 . wrote in #note-2:
Its calling:
[...]
Seems like some rules are missing the ['tracker'] key?
Can add a check to see if tracker exists before proceeding?
No, this error is indicative of $prule being type string rather than array, which would hint that pfSense_get_pf_rules() is not doing what is expected by this script.
Updated by Reid Linnemann about 2 years ago
- Status changed from New to Feedback
This should be fixed as of 223d90f
Updated by Jordan G about 2 years ago
widget is able to be added to the dashboard now, running ver 23.01.a.20221118.0600
Updated by Alex Casanova about 2 years ago
With 23.01.a.20221118.0600 I these errors
Please find attached the logs:
Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/pfblockerng/pfblockerng_install.inc:109 Stack trace: #0 /etc/inc/pkg-utils.inc(787) : eval()'d code(1): include_once() #1 /etc/inc/pkg-utils.inc(787): eval() #2 /etc/inc/pkg-utils.inc(905): eval_once('include_once('/...') #3 /etc/rc.packages(76): install_package_xml('pfBlockerNG-dev...') #4 {main} thrown in /usr/local/pkg/pfblockerng/pfblockerng_install.inc on line 109 PHP ERROR: Type: 1, File: /usr/local/pkg/pfblockerng/pfblockerng_install.inc, Line: 109, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/pfblockerng/pfblockerng_install.inc:109 Stack trace: #0 /etc/inc/pkg-utils.inc(787) : eval()'d code(1): include_once() #1 /etc/inc/pkg-utils.inc(787): eval() #2 /etc/inc/pkg-utils.inc(905): eval_once('include_once('/...') #3 /etc/rc.packages(76): install_package_xml('pfBlockerNG-dev...') #4 {main} thrownpkg-static: POST-INSTALL script failed
Updated by Marcos M about 2 years ago
- Status changed from Feedback to New
There's a separate redmine for that one:
https://redmine.pfsense.org/issues/13679
Still seeing this on latest snap/pfB version within the widget window itself.
Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/widgets/widgets/pfblockerng.widget.php:303 Stack trace: #0 /usr/local/www/widgets/widgets/pfblockerng.widget.php(472): pfBlockerNG_update_table() #1 /usr/local/www/widgets/widgets/pfblockerng.widget.php(948): pfBlockerNG_get_header() #2 /usr/local/www/index.php(430): include('/usr/local/www/...') #3 {main} thrown in /usr/local/www/widgets/widgets/pfblockerng.widget.php on line 303 PHP ERROR: Type: 1, File: /usr/local/www/widgets/widgets/pfblockerng.widget.php, Line: 303, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/widgets/widgets/pfblockerng.widget.php:303 Stack trace: #0 /usr/local/www/widgets/widgets/pfblockerng.widget.php(472): pfBlockerNG_update_table() #1 /usr/local/www/widgets/widgets/pfblockerng.widget.php(948): pfBlockerNG_get_header() #2 /usr/local/www/index.php(430): include('/usr/local/www/...') #3 {main} thrown
Note that this happened after upgrading. It prevented the navigation menu from being clicked. After manually going to a different page, clearing the alter, then going back to the dashboard, the widget loaded correctly.
Updated by Reid Linnemann about 2 years ago
The change was just merged to Plus this morning, try the next build please.
Updated by Reid Linnemann about 2 years ago
- Status changed from New to Feedback
Updated by aleksei prokofiev almost 2 years ago
Tested on 23.01.a.20221124.0600 and I don't see any errors on the widget
Updated by Marcos M almost 2 years ago
- Status changed from Feedback to Resolved
The package version was bumped (now today on 3.1.0_11) to include the fix for this issue on pfSense+. I'm no longer seeing the issue here after snapshot upgrades like I was seeing before.