Project

General

Profile

Actions

Bug #13679

closed

Error in pfBlockerNG Post Install Script

Added by Christopher Cope about 2 years ago. Updated almost 2 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

Error installing pfBlockerNG-devel 3.1.0_10 on

23.01-DEVELOPMENT (amd64)
built on Fri Nov 18 06:04:48 UTC 2022
FreeBSD 14.0-CURRENT

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

Actions #1

Updated by Kris Phillips about 2 years ago

Unable to reproduce this. Installing the package shows normal for me. Here is the full log on 23.01 for Nov 18th builds:

Installing pfSense-pkg-pfBlockerNG-devel...

Updating pfSense-core repository catalogue...
pfSense-core repository is up to date.
Updating pfSense repository catalogue...
pfSense repository is up to date.
All repositories are up to date.
The following 14 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
gmp: 6.2.1 [pfSense]
grepcidr: 2.0 [pfSense]
iprange: 1.0.4 [pfSense]
jq: 1.6 [pfSense]
libmaxminddb: 1.6.0 [pfSense]
lighttpd: 1.4.67 [pfSense]
lua52: 5.2.4 [pfSense]
nettle: 3.8.1 [pfSense]
pfSense-pkg-pfBlockerNG-devel: 3.1.0_10 [pfSense]
py39-maxminddb: 2.2.0 [pfSense]
py39-sqlite3: 3.9.15_7 [pfSense]
rsync: 3.2.6 [pfSense]
whois: 5.5.7 [pfSense]
xxhash: 0.8.1_2 [pfSense]

Number of packages to be installed: 14

The process will require 18 MiB more space.
5 MiB to be downloaded.
[1/14] Fetching lighttpd-1.4.67.pkg: .......... done
[2/14] Fetching nettle-3.8.1.pkg: .......... done
[3/14] Fetching jq-1.6.pkg: .......... done
[4/14] Fetching grepcidr-2.0.pkg: ... done
[5/14] Fetching py39-sqlite3-3.9.15_7.pkg: ..... done
[6/14] Fetching xxhash-0.8.1_2.pkg: .......... done
[7/14] Fetching iprange-1.0.4.pkg: .... done
[8/14] Fetching py39-maxminddb-2.2.0.pkg: .... done
[9/14] Fetching rsync-3.2.6.pkg: .......... done
[10/14] Fetching gmp-6.2.1.pkg: .......... done
[11/14] Fetching pfSense-pkg-pfBlockerNG-devel-3.1.0_10.pkg: .......... done
[12/14] Fetching lua52-5.2.4.pkg: .......... done
[13/14] Fetching libmaxminddb-1.6.0.pkg: ..... done
[14/14] Fetching whois-5.5.7.pkg: ......... done
Checking integrity... done (0 conflicting)
[1/14] Installing gmp-6.2.1...
[1/14] Extracting gmp-6.2.1: .......... done
[2/14] Installing nettle-3.8.1...
[2/14] Extracting nettle-3.8.1: .......... done
[3/14] Installing xxhash-0.8.1_2...
[3/14] Extracting xxhash-0.8.1_2: .......... done
[4/14] Installing lua52-5.2.4...
[4/14] Extracting lua52-5.2.4: ......... done
[5/14] Installing libmaxminddb-1.6.0...
[5/14] Extracting libmaxminddb-1.6.0: .......... done
[6/14] Installing lighttpd-1.4.67...
===> Creating groups.
Using existing group 'www'.
===> Creating users
Using existing user 'www'.
[6/14] Extracting lighttpd-1.4.67: .......... done
[7/14] Installing jq-1.6...
[7/14] Extracting jq-1.6: .......... done
[8/14] Installing grepcidr-2.0...
[8/14] Extracting grepcidr-2.0: ..... done
[9/14] Installing py39-sqlite3-3.9.15_7...
[9/14] Extracting py39-sqlite3-3.9.15_7: ........ done
[10/14] Installing iprange-1.0.4...
[10/14] Extracting iprange-1.0.4: ..... done
[11/14] Installing py39-maxminddb-2.2.0...
[11/14] Extracting py39-maxminddb-2.2.0: .......... done
[12/14] Installing rsync-3.2.6...
[12/14] Extracting rsync-3.2.6: .......... done
[13/14] Installing whois-5.5.7...
[13/14] Extracting whois-5.5.7: .......... done
[14/14] Installing pfSense-pkg-pfBlockerNG-devel-3.1.0_10...
[14/14] Extracting pfSense-pkg-pfBlockerNG-devel-3.1.0_10: .......... done
Saving updated package information...
done.
Loading package configuration... done.
Configuring package components...
Loading package instructions...
Custom commands...
Executing custom_php_install_command()...
MaxMind GeoIP databases are not pre-installed during installation.
To utilize the MaxMind GeoIP functionalities, you will be required to register for a free MaxMind user account and access key. Review the IP tab: MaxMind Settings for more details.

Adding pfBlockerNG Widget to the Dashboard... done.

Creating Firewall filter service... done.
Renew Firewall filter executables... done.
Starting Firewall filter Service... done.

Creating DNSBL service... done.
Renew DNSBL lighttpd executable... done.
Starting DNSBL Service... done.

Upgrading previous settings:
Adv. Inbound firewall rule settings... saving new changes ... done.
OpenVPN/IPSec interface selections... no changes required ... done.
Proofpoint/ET IQRisk settings... no changes required ... done.
General Tab -> IP Tab settings... no changes required ... done.
pfBlockerNGSuppress Alias -> IPv4 Suppression Customlist... no changes required ... done.
Upgrading previous EasyLists to new format... no changes required ... done.
Upgrading previous Firefox DoH to new format... no changes required ... done.
MaxMind License Key configuration setting... no changes required ... done.
Upgrading... done

Custom commands completed ... done.
Executing custom_php_resync_config_command()...done.
Menu items... done.
Services... done.
Writing configuration... done. =====
Message from grepcidr-2.0:

--
===> NOTICE:

The grepcidr port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://docs.freebsd.org/en/articles/contributing/#ports-contributing =====
Message from rsync-3.2.6:

--
Some scripts provided by rsync such as rrsync requires
python which is not installed by default

Cleaning up cache... done.

Success

Actions #2

Updated by Lev Prokofev about 2 years ago

No errors on 23.01-DEVELOPMENT (amd64) built on Fri Nov 11

@>>> Installing pfSense-pkg-pfBlockerNG-devel...
Updating pfSense-core repository catalogue...
pfSense-core repository is up to date.
Updating pfSense repository catalogue...
pfSense repository is up to date.
All repositories are up to date.
The following 13 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
gmp: 6.2.1 [pfSense]
grepcidr: 2.0 [pfSense]
iprange: 1.0.4 [pfSense]
jq: 1.6 [pfSense]
lighttpd: 1.4.67 [pfSense]
lua52: 5.2.4 [pfSense]
nettle: 3.8.1 [pfSense]
pfSense-pkg-pfBlockerNG-devel: 3.1.0_10 [pfSense]
py39-maxminddb: 2.2.0 [pfSense]
py39-sqlite3: 3.9.15_7 [pfSense]
rsync: 3.2.6 [pfSense]
whois: 5.5.7 [pfSense]
xxhash: 0.8.1_2 [pfSense]

Number of packages to be installed: 13

The process will require 18 MiB more space.
5 MiB to be downloaded.
[1/13] Fetching lighttpd-1.4.67.pkg: .......... done
[2/13] Fetching nettle-3.8.1.pkg: .......... done
[3/13] Fetching jq-1.6.pkg: .......... done
[4/13] Fetching grepcidr-2.0.pkg: ... done
[5/13] Fetching py39-sqlite3-3.9.15_7.pkg: ..... done
[6/13] Fetching xxhash-0.8.1_2.pkg: .......... done
[7/13] Fetching iprange-1.0.4.pkg: .... done
[8/13] Fetching py39-maxminddb-2.2.0.pkg: .... done
[9/13] Fetching rsync-3.2.6.pkg: .......... done
[10/13] Fetching gmp-6.2.1.pkg: .......... done
[11/13] Fetching pfSense-pkg-pfBlockerNG-devel-3.1.0_10.pkg: .......... done
[12/13] Fetching lua52-5.2.4.pkg: .......... done
[13/13] Fetching whois-5.5.7.pkg: ......... done
Checking integrity... done (0 conflicting)
[1/13] Installing gmp-6.2.1...
[1/13] Extracting gmp-6.2.1: .......... done
[2/13] Installing nettle-3.8.1...
[2/13] Extracting nettle-3.8.1: .......... done
[3/13] Installing xxhash-0.8.1_2...
[3/13] Extracting xxhash-0.8.1_2: .......... done
[4/13] Installing lua52-5.2.4...
[4/13] Extracting lua52-5.2.4: ......... done
[5/13] Installing lighttpd-1.4.67...
===> Creating groups.
Using existing group 'www'.
===> Creating users
Using existing user 'www'.
[5/13] Extracting lighttpd-1.4.67: .......... done
[6/13] Installing jq-1.6...
[6/13] Extracting jq-1.6: .......... done
[7/13] Installing grepcidr-2.0...
[7/13] Extracting grepcidr-2.0: ..... done
[8/13] Installing py39-sqlite3-3.9.15_7...
[8/13] Extracting py39-sqlite3-3.9.15_7: ........ done
[9/13] Installing iprange-1.0.4...
[9/13] Extracting iprange-1.0.4: ..... done
[10/13] Installing py39-maxminddb-2.2.0...
[10/13] Extracting py39-maxminddb-2.2.0: .......... done
[11/13] Installing rsync-3.2.6...
[11/13] Extracting rsync-3.2.6: .......... done
[12/13] Installing whois-5.5.7...
[12/13] Extracting whois-5.5.7: .......... done
[13/13] Installing pfSense-pkg-pfBlockerNG-devel-3.1.0_10...
[13/13] Extracting pfSense-pkg-pfBlockerNG-devel-3.1.0_10: .......... done
Saving updated package information...
done.
Loading package configuration... done.
Configuring package components...
Loading package instructions...
Custom commands...
Executing custom_php_install_command()...
MaxMind GeoIP databases are not pre-installed during installation.
To utilize the MaxMind GeoIP functionalities, you will be required to register for a free MaxMind user account and access key. Review the IP tab: MaxMind Settings for more details.

Adding pfBlockerNG Widget to the Dashboard... done.

Creating Firewall filter service... done.
Renew Firewall filter executables... done.
Starting Firewall filter Service... done.

Creating DNSBL service... done.
Renew DNSBL lighttpd executable... done.
Starting DNSBL Service... done.

Upgrading previous settings:
Adv. Inbound firewall rule settings... saving new changes ... done.
OpenVPN/IPSec interface selections... no changes required ... done.
Proofpoint/ET IQRisk settings... no changes required ... done.
General Tab -> IP Tab settings... no changes required ... done.
pfBlockerNGSuppress Alias -> IPv4 Suppression Customlist... no changes required ... done.
Upgrading previous EasyLists to new format... no changes required ... done.
Upgrading previous Firefox DoH to new format... no changes required ... done.
MaxMind License Key configuration setting... no changes required ... done.
Upgrading... done

Custom commands completed ... done.
Executing custom_php_resync_config_command()...done.
Menu items... done.
Services... done.
Writing configuration... done. =====
Message from grepcidr-2.0:

--
===> NOTICE:

The grepcidr port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://docs.freebsd.org/en/articles/contributing/#ports-contributing =====
Message from rsync-3.2.6:

--
Some scripts provided by rsync such as rrsync requires
python which is not installed by default

Cleaning up cache... done.

Success
@

Actions #3

Updated by Chris W about 2 years ago

I hit this today upgrading from 22.05 to 23.01.a.20221118.0600 with pfBlocker-devel 3.1.0_10. After logging into the GUI when the upgrade's reboot finishes, this was presented as a notification:

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}
thrown @ 2022-11-19 16:16:59
Actions #4

Updated by Reid Linnemann about 2 years ago

Chris W wrote in #note-3:

I hit this today upgrading from 22.05 to 23.01.a.20221118.0600 with pfBlocker-devel 3.1.0_10. After logging into the GUI when the upgrade's reboot finishes, this was presented as a notification:

[...]

This is an artifact of the prior revision package php uninstall scripts being run in the newly installed php 8.1 and generating new errors. This is not fatal, and the new version of the package will have installed. For now errors like this on upgrade are to be expected, but this is not the same as what is reported by the issue author.

Actions #5

Updated by Reid Linnemann about 2 years ago

I think I see why you've run into this where others haven't. Around the line in question:

// Replace 'default' DNSBL active blocked webpage
if (!file_exists('/usr/local/www/pfblockerng/www/dnsbl_active.php') ||
    (isset($config['installedpackages']['pfblockerngdnsblsettings']) &&
    $config['installedpackages']['pfblockerngdnsblsettings']['config'][0]['dnsbl_webpage'] == 'dnsbl_default.php')) {  // error is hit here
    @copy('/usr/local/www/pfblockerng/www/dnsbl_default.php', '/usr/local/www/pfblockerng/www/dnsbl_active.php');
}

It's my expectation that you have a config section for pfblockerdnsblsettings, but no <config> elements inside it. As a result, the attempt to set the first element in the 'config' array fails because that array doesn't exist and attempting to index that key yields an empty string. What should be done here is something like this:

// Replace 'default' DNSBL active blocked webpage
if (!file_exists('/usr/local/www/pfblockerng/www/dnsbl_active.php') ||
    config_get_path('installedpackages/pfblockerngdnsblsettings/config/0/dnsblwebpage', '') == 'dnsbl_default.php') {
    @copy('/usr/local/www/pfblockerng/www/dnsbl_default.php', '/usr/local/www/pfblockerng/www/dnsbl_active.php');
}

The entire file probably warrants a once-over for converting direct $config accesses to use the interface functions.

Actions #6

Updated by Reid Linnemann about 2 years ago

  • Assignee changed from Christopher Cope to Reid Linnemann
Actions #7

Updated by Reid Linnemann almost 2 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

Should be fixed in CE as of 18035e

Actions #8

Updated by Christopher Cope almost 2 years ago

  • Status changed from Feedback to Resolved

Tested version 3.1.0_15 on

23.01-BETA (amd64)
built on Fri Dec 16 06:05:35 UTC 2022
FreeBSD 14.0-CURRENT
No more errors. Marking resoled.

Actions

Also available in: Atom PDF