Project

General

Profile

Actions

Bug #13619

closed
BD RL

pfSense - Feature #13446: Upgrade PHP from 7.4 to 8.1

PHP Error in pfblockerNG-devel widget

Bug #13619: PHP Error in pfblockerNG-devel widget

Added by Brad Davis almost 4 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Category:
pfBlockerNG
Target version:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
Affected Architecture:

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

clipboard-202211271021-lhh79.png (49.3 KB) clipboard-202211271021-lhh79.png aleksei prokofiev, 11/27/2022 01:21 AM

JP Updated by Jim Pingle almost 4 years ago Actions #1

  • 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)

B. Updated by BBcan177 . almost 4 years ago Actions #2

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?

MM Updated by Marcos M almost 4 years ago Actions #3

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.

RL Updated by Reid Linnemann almost 4 years ago Actions #4

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.

JP Updated by Jim Pingle almost 4 years ago Actions #5

  • Parent task set to #13446

RL Updated by Reid Linnemann almost 4 years ago Actions #6

  • Status changed from New to Feedback

This should be fixed as of 223d90f

JG Updated by Jordan G almost 4 years ago Actions #7

widget is able to be added to the dashboard now, running ver 23.01.a.20221118.0600

AC Updated by Alex Casanova almost 4 years ago Actions #8

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

MM Updated by Marcos M almost 4 years ago Actions #9

  • 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.

RL Updated by Reid Linnemann almost 4 years ago Actions #10

The change was just merged to Plus this morning, try the next build please.

RL Updated by Reid Linnemann almost 4 years ago Actions #11

  • Status changed from New to Feedback

AP Updated by aleksei prokofiev almost 4 years ago Actions #12

Tested on 23.01.a.20221124.0600 and I don't see any errors on the widget

MM Updated by Marcos M almost 4 years ago Actions #13

  • 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.

JP Updated by Jim Pingle almost 4 years ago Actions #14

  • % Done changed from 0 to 100

JP Updated by Jim Pingle over 3 years ago Actions #15

  • Plus Target Version deleted (23.01)

JP Updated by Jim Pingle over 3 years ago Actions #16

  • Target version deleted (2.7.0)
Actions

Also available in: Atom