Bug #15157
closedPHP error when generating a notification after detecting a malformed configuration
Added by Ramon Alonso Costa 10 months ago. Updated 7 months ago.
100%
Description
I am having the following issue when trying to update the DNS Resolver backup. Below is the file with the error.
Files
PHP_errors.log (1.75 KB) PHP_errors.log | Ramon Alonso Costa, 01/12/2024 11:35 PM | ||
1147.diff (2.96 KB) 1147.diff | Steve Wheeler, 04/03/2024 05:57 PM |
Related issues
Updated by Kris Phillips 10 months ago
Ramon Alonso Costa wrote:
I am having the following issue when trying to update the DNS Resolver backup. Below is the file with the error.
Please clarify what you mean by "update the DNS Resolver backup". What is the process to reproduce the errors you're seeing?
This bug report has insufficient information to ascertain what could be going on here.
Updated by Jim Pingle 10 months ago
- Status changed from New to Incomplete
- Priority changed from High to Normal
[12-Jan-2024 20:27:55 America/Sao_Paulo] PHP Fatal error: Uncaught TypeError: array_path_enabled(): Argument #1 ($arr) must be of type array, int given, called in /etc/inc/config.lib.inc on line 1264 and defined in /etc/inc/util.inc:3748 Stack trace: #0 /etc/inc/config.lib.inc(1264): array_path_enabled(-1, 'notifications/s...', 'disable') #1 /etc/inc/notices.inc(379): config_path_enabled('notifications/s...', 'disable') #2 /etc/inc/notices.inc(662): notify_via_smtp('Netgate pfSense...') #3 /etc/inc/notices.inc(151): notify_all_remote('Netgate pfSense...') #4 /etc/inc/config.lib.inc(239): file_notice('config.xml', 'Netgate pfSense...', 'pfSenseConfigur...', '') #5 /etc/inc/config.lib.inc(695): restore_backup('/cf/conf/backup...') #6 /etc/inc/pfsense-utils.inc(947): write_config('Restored unboun...') #7 /usr/local/pfSense/include/www/backup.inc(300): restore_config_section('unbound', '\n<unbound>\n\t<en...') #8 /usr/local/www/diag_backup.php(63): execPost(Array, Array) #9 {main} thrown in /etc/inc/util.inc on line 3748
From the backtrace the backup being restored is broken in some way. The resulting config.xml is empty/corrupt. There should be a notice in the GUI with more information, and in the system log.
Updated by Robbe Van der Gucht 8 months ago
I have a similar stack trace for an issue that is maybe not completely the same.
After upgrading to version 2.7.2-RELEASE (community edition) using drag & drop to change the order of the Phase2 IPSec connections results in the stacktrace below. Go into the IPsec configuration, click on 'Show Phase 2 Entries' and then use the little anchor symbol to change the order of the connection by drag and dropping it.
[21-Feb-2024 10:54:18 Europe/Brussels] PHP Fatal error: Uncaught TypeError: array_path_enabled(): Argument #1 ($arr) must be of type array, int given, called in /etc/inc/config.lib.inc on line 1250 and defined in /etc/inc/util.inc:3662 Stack trace: #0 /etc/inc/config.lib.inc(1250): array_path_enabled(-1, 'notifications/s...', 'disable') #1 /etc/inc/notices.inc(379): config_path_enabled('notifications/s...', 'disable') #2 /etc/inc/notices.inc(662): notify_via_smtp('pfSense is rest...') #3 /etc/inc/notices.inc(151): notify_all_remote('pfSense is rest...') #4 /etc/inc/config.lib.inc(239): file_notice('config.xml', 'pfSense is rest...', 'pfSenseConfigur...', '') #5 /etc/inc/config.lib.inc(695): restore_backup('/cf/conf/backup...') #6 /usr/local/www/vpn_ipsec.php(264): write_config('Saved configura...') #7 {main} thrown in /etc/inc/util.inc on line 3662
Updated by David Cuadrado Sanchez 8 months ago
Good afternoon,
When I try to add a host to synchronize pfBlocker with other appliances, upon saving, I encounter this error, which I reproduce below:
Crash report begins. Anonymous machine information:
amd64
14.0-CURRENT
FreeBSD 14.0-CURRENT amd64 1400094 #1 plus-RELENG_23_09_1-n256200-3de1e293f3a: Wed Dec 6 21:00:32 UTC 2023 root@freebsd:/var/jenkins/workspace/pfSense-Plus-snapshots-23_09_1-main/obj/amd64/Obhu6gXB/var/jenkins/workspace/pfSense-Plus-snapshots-23_09_1
Crash report details:
PHP Errors:
[02-Apr-2024 18:06:39 Europe/Madrid] PHP Fatal error: Uncaught TypeError: array_path_enabled(): Argument #1 ($arr) must be of type array, int given, called in /etc/inc/config.lib.inc on line 1264 and defined in /etc/inc/util.inc:3748
Stack trace:
#0 /etc/inc/config.lib.inc(1264): array_path_enabled(-1, 'notifications/s...', 'disable')
#1 /etc/inc/notices.inc(379): config_path_enabled('notifications/s...', 'disable')
#2 /etc/inc/notices.inc(662): notify_via_smtp('Netgate pfSense...')
#3 /etc/inc/notices.inc(151): notify_all_remote('Netgate pfSense...')
#4 /etc/inc/config.lib.inc(239): file_notice('config.xml', 'Netgate pfSense...', 'pfSenseConfigur...', '')
#5 /etc/inc/config.lib.inc(695): restore_backup('/cf/conf/backup...')
#6 /usr/local/www/pfblockerng/pfblockerng_sync.php(140): write_config('[pfBlockerNG] s...')
#7 {main}
thrown in /etc/inc/util.inc on line 3748
No FreeBSD crash data found.
Furthermore, in the OpenVPN Client Export package, when adding a password to the certificate, I also encounter this other error, And the crash report:
Crash report begins. Anonymous machine information:
amd64
14.0-CURRENT
FreeBSD 14.0-CURRENT amd64 1400094 #1 RELENG_2_7_2-n255948-8d2b56da39c: Wed Dec 6 20:45:47 UTC 2023 root@freebsd:/var/jenkins/workspace/pfSense-CE-snapshots-2_7_2-main/obj/amd64/StdASW5b/var/jenkins/workspace/pfSense-CE-snapshots-2_7_2-main/sources/F
Crash report details:
PHP Errors:
[02-Apr-2024 17:13:14 Europe/Madrid] PHP Fatal error: Uncaught TypeError: array_path_enabled(): Argument #1 ($arr) must be of type array, int given, called in /etc/inc/config.lib.inc on line 1250 and defined in /etc/inc/util.inc:3662
Stack trace:
#0 /etc/inc/config.lib.inc(1250): array_path_enabled(-1, 'notifications/s...', 'disable')
#1 /etc/inc/notices.inc(379): config_path_enabled('notifications/s...', 'disable')
#2 /etc/inc/notices.inc(662): notify_via_smtp('pfSense is rest...')
#3 /etc/inc/notices.inc(151): notify_all_remote('pfSense is rest...')
#4 /etc/inc/config.lib.inc(239): file_notice('config.xml', 'pfSense is rest...', 'pfSenseConfigur...', '')
#5 /etc/inc/config.lib.inc(695): restore_backup('/cf/conf/backup...')
#6 /usr/local/www/vpn_openvpn_export.php(194): write_config('Save openvpn cl...')
#7 {main}
thrown in /etc/inc/util.inc on line 3662
No FreeBSD crash data found.
Could you please help me with this error? Despite my searches, I haven't found anything, and the OpenVPN certificate isn't working because no password seems to function.
Updated by David Cuadrado Sanchez 8 months ago
Robbe Van der Gucht wrote in #note-3:
I have a similar stack trace for an issue that is maybe not completely the same.
After upgrading to version 2.7.2-RELEASE (community edition) using drag & drop to change the order of the Phase2 IPSec connections results in the stacktrace below. Go into the IPsec configuration, click on 'Show Phase 2 Entries' and then use the little anchor symbol to change the order of the connection by drag and dropping it.
[...]
Good evening, have you solved this issue?
Updated by Robbe Van der Gucht 8 months ago
David Cuadrado Sanchez wrote in #note-5:
Robbe Van der Gucht wrote in #note-3:
I have a similar stack trace for an issue that is maybe not completely the same.
After upgrading to version 2.7.2-RELEASE (community edition) using drag & drop to change the order of the Phase2 IPSec connections results in the stacktrace below. Go into the IPsec configuration, click on 'Show Phase 2 Entries' and then use the little anchor symbol to change the order of the connection by drag and dropping it.
[...]Good evening, have you solved this issue?
No. I stopped re-ordering Phase2 connection, to avoid triggering the issue.
Updated by David Cuadrado Sanchez 8 months ago
Good afternoon, I have an update. I have noticed that if I don't use certain characters, such as Ñ and others, in both the Client Export and the SYNC tab of pfBlocker, in both password fields (certificate and firewall to which I want to synchronize the configuration), the error does not occur. Can anyone shed some light on this?
Updated by Steve Wheeler 8 months ago
- Project changed from pfSense Plus to pfSense
- Subject changed from Problem in Restore Backup to PHP error when a notification is shown for recovering after a bad config
- Category changed from Backup / Restore to Backup / Restore
- Target version set to 2.8.0
- Affected Plus Version deleted (
23.09.1) - Plus Target Version set to 24.07
- Affected Version set to 2.7.2
- Affected Architecture All added
The common PHP errors shown here are caused by trying to display a notification when the config file is unavailable. That happens when the created config is invalid or missing for some reason and pfSense recovers by restoring an older config.
That is masking the underlying errors that caused the bad config which are different for each case and should have a separate bug report.
Updated by Steve Wheeler 8 months ago
- File 1147.diff added
- Status changed from Incomplete to In Progress
Updated by Jim Pingle 8 months ago
- Assignee set to Steve Wheeler
- Plus Target Version changed from 24.07 to 24.03
Updated by Anonymous 8 months ago
- Status changed from In Progress to Feedback
- % Done changed from 0 to 100
Applied in changeset 7b920960e5f38aedd35316c762c5b0b6dbc84c60.
Updated by Georgiy Tyutyunnik 8 months ago
tested on:
24.03-BETA (amd64)
built on Fri Mar 22 17:08:00 UTC 2024
FreeBSD 15.0-CURRENT
patch fixes the actual crush, but reordering ipsec phase2 connections etc still doesn't work and causes config restore
Updated by Georgiy Tyutyunnik 8 months ago
- Related to Bug #15384: Reordering IPsec Phase 2 entries may result in a malformed configuration added
Updated by Steve Wheeler 8 months ago
Yes, with the notification error patched the real bugs generating a bad config should become apparent. Separate issues should be opened for them.
Updated by Jim Pingle 8 months ago
- Status changed from Feedback to Resolved
This seems to be solved now. Things that triggered it before no longer trigger it now.
Updated by Jim Pingle 7 months ago
- Subject changed from PHP error when a notification is shown for recovering after a bad config to PHP error when generating a notification after detecting a malformed configuration