Project

General

Profile

Actions

Regression #13950

closed

PHP error with pfBlockerNG

Added by Marcos M over 1 year ago. Updated about 1 year ago.

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

0%

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

Description

After restoring a config backup which contains pfBlockerNG-devel to a fresh install of 23.01, a crash/alert shows the following PHP error:

PHP ERROR: Type: 1, File: /usr/local/www/pfblockerng/pfblockerng.php, Line: 1980, Message: Uncaught TypeError: sort(): Argument #1 ($array) must be of type array, null given in /usr/local/www/pfblockerng/pfblockerng.php:1980
Stack trace:
#0 /usr/local/www/pfblockerng/pfblockerng.php(1980): sort(NULL, 2)
#1 /usr/local/pkg/pfblockerng/pfblockerng_install.inc(40): pfblockerng_get_countries()
#2 /etc/inc/pkg-utils.inc(781) : eval()'d code(1): include_once('/usr/local/pkg/...')
#3 /etc/inc/pkg-utils.inc(781): eval()
#4 /etc/inc/pkg-utils.inc(899): eval_once('include_once('/...')
#5 /etc/rc.packages(76): install_package_xml('pfBlockerNG-dev...')
#6 {main}
thrown @ 2023-02-12 19:51:26

It did not appear to prevent pfBlockerNG from functioning correctly, but I noticed that <include_file>/usr/local/pkg/pfblockerng/pfblockerng.inc</include_file> was missing from config.xml. Uninstalling -devel then installing the non-devel package did not result in any issues.

Actions #1

Updated by Marcos M over 1 year ago

Another report after upgrading to 23.01:

PHP ERROR: Type: 1, File: /usr/local/pkg/pfblockerng/pfblockerng.inc, Line: 1468, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/pfblockerng/pfblockerng.inc:1468
Stack trace:
#0 /usr/local/pkg/pfblockerng/pfblockerng.inc(7253): pfb_build_if_list(true, false)
#1 /usr/local/pkg/pfblockerng/pfblockerng.inc(10802): sync_package_pfblockerng()
#2 /etc/inc/pkg-utils.inc(781) : eval()'d code(1): pfblockerng_php_pre_deinstall_command()
#3 /etc/inc/pkg-utils.inc(781): eval()
#4 /etc/inc/pkg-utils.inc(1093): eval_once('pfblockerng_php...')
#5 /etc/rc.packages(80): delete_package_xml('pfBlockerNG-dev...', 'deinstall')
#6 {main}
thrown @ 2023-02-15 19:07:20

Actions #2

Updated by Danilo Zrenjanin about 1 year ago

Here is another after-clean install/restore:

[18-Feb-2023 10:23:27 America/Detroit] PHP Fatal error:  Uncaught TypeError: sort(): Argument #1 ($array) must be of type array, null given in /usr/local/www/pfblockerng/pfblockerng.php:1980
Stack trace:
#0 /usr/local/www/pfblockerng/pfblockerng.php(1980): sort(NULL, 2)
#1 /usr/local/pkg/pfblockerng/pfblockerng_install.inc(40): pfblockerng_get_countries()
#2 /etc/inc/pkg-utils.inc(781) : eval()'d code(1): include_once('/usr/local/pkg/...')
#3 /etc/inc/pkg-utils.inc(781): eval()
#4 /etc/inc/pkg-utils.inc(899): eval_once('include_once('/...')
#5 /etc/rc.packages(76): install_package_xml('pfBlockerNG-dev...')
#6 {main}
  thrown in /usr/local/www/pfblockerng/pfblockerng.php on line 1980

Actions #3

Updated by BBcan177 . about 1 year ago

This should be fixed in v3.2.0_2

Actions #4

Updated by Marcos M about 1 year ago

  • Tracker changed from Bug to Regression
  • Subject changed from PHP error when installing pfBlockerNG-devel to PHP error with pfBlockerNG
  • Status changed from New to Waiting on Merge
  • Affected Version set to 2.7.0
  • Affected Plus Version set to 23.01
Actions #5

Updated by Marcos M about 1 year ago

  • Status changed from Waiting on Merge to Feedback
Actions #6

Updated by Marcos M about 1 year ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF