Bug #13619
closed
pfSense - Feature #13446: Upgrade PHP from 7.4 to 8.1
PHP Error in pfblockerNG-devel widget
Added by Brad Davis about 2 years ago.
Updated over 1 year ago.
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
- 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)
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?
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.
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.
- Parent task set to #13446
- Status changed from New to Feedback
widget is able to be added to the dashboard now, running ver 23.01.a.20221118.0600
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
- 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.
The change was just merged to Plus this morning, try the next build please.
- Status changed from New to Feedback
Tested on 23.01.a.20221124.0600 and I don't see any errors on the widget
- 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.
- % Done changed from 0 to 100
- Plus Target Version deleted (
23.01)
- Target version deleted (
2.7.0)
Also available in: Atom
PDF