PHP Fatal Error
-
But not the error in /etc/inc/notices.inc:101 ?
-
@stephenw10 This is the error:
[06-Aug-2023 10:05:02 America/New_York] PHP Fatal error: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in /etc/inc/config.lib.inc:172 Stack trace: #0 /etc/inc/config.lib.inc(172): fwrite(false, 'a:40:{s:7:"vers...') #1 /etc/inc/config.lib.inc(147): generate_config_cache(Array) #2 /etc/inc/config.inc(141): parse_config() #3 /etc/inc/gwlb.inc(25): require_once('/etc/inc/config...') #4 /etc/inc/functions.inc(35): require_once('/etc/inc/gwlb.i...') #5 /etc/inc/notices.inc(26): require_once('/etc/inc/functi...') #6 /usr/local/pkg/nut/nut_email.php(24): require_once('/etc/inc/notice...') #7 {main} thrown in /etc/inc/config.lib.inc on line 172 [06-Aug-2023 10:05:02 America/New_York] PHP Fatal error: Uncaught ValueError: Path cannot be empty in /etc/inc/notices.inc:101 Stack trace: #0 /etc/inc/notices.inc(101): fopen('', 'w') #1 /etc/inc/config.lib.inc(1148): file_notice('phperror', 'PHP ERROR: Type...', 'PHP errors') #2 [internal function]: pfSense_clear_globals() #3 {main} thrown in /etc/inc/notices.inc on line 101
-
I installed all patches and get still this error:
PHP ERROR: Type: 1, File: /etc/inc/config.lib.inc, Line: 172, Message: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in /etc/inc/config.lib.inc:172
Stack trace:
#0 /etc/inc/config.lib.inc(172): fwrite(false, 'a:44:{s:7:"vers...')
#1 /etc/inc/config.lib.inc(147): generate_config_cache(Array)
#2 /etc/inc/config.inc(141): parse_config()
#3 /etc/inc/gwlb.inc(25): require_once('/etc/inc/config...')
#4 /etc/inc/functions.inc(35): require_once('/etc/inc/gwlb.i...')
#5 /usr/local/sbin/pfSsh.php(29): require_once('/etc/inc/functi...')
#6 {main}
thrown @ 2023-09-05 06:00:03 -
Doesn't this look like PHP error after reboot ?
-
There is another change I committed a couple weeks ago that might help with that,
596a88fa42f0ac77bd2fc2be87b54457df11f64b
but I'm not sure if it applies cleanly on a patched or unpatched release. You can try, though.But the problem is still someone trying to do a function as a non-privileged user that should be performed by root.
-
Thanks @jimp
As mentioned previously, I saw this on my 6100 (with the NUT package and an APC UPS) many times when running 23.01. FYI, I never saw it with 23.05 over several months, but saw it again with 23.05.1 (coinidence?).
Anyway, I just installed all recommended patches plus commit 596a88fa42f0ac77bd2fc2be87b54457df11f64b and will report back if I experience this issue again.
-
I am still having issues as well. Watching the thread closely.
-
I'm here with a simliar error. Found after ACME reissued a new Cert
/etc/rc.restart_webgui Restarting webConfigurator...Error: cannot open certificate file in system_webgui_start(). Fatal error: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in /etc/inc/rrd.inc:1027 Stack trace: #0 /etc/inc/rrd.inc(1027): fwrite(false, '#!/bin/sh\n\nexpo...') #1 /etc/rc.restart_webgui(44): enable_rrd_graphing() #2 {main} thrown in /etc/inc/rrd.inc on line 1027 PHP ERROR: Type: 1, File: /etc/inc/rrd.inc, Line: 1027, Message: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in /etc/inc/rrd.inc:1027 Stack trace: #0 /etc/inc/rrd.inc(1027): fwrite(false, '#!/bin/sh\n\nexpo...') #1 /etc/rc.restart_webgui(44): enable_rrd_graphing() #2 {main} thrown
Running on Proxmox - PfSense+ 23.05.1 with ZFS
-
Have you only seen that one time? If you remove the error does it return? Can you trigger it repeatably?
-
@stephenw10 it is a permanent failure. The new LE Cert is not in use because of that error.
-
So it regenerates exactly the same error everytime the ACME cert renew script runs?
And this just started happening, it didn't start after upgrading for example?
-
@stephenw10 No, the cert is issued correctly. It is just not used anymore be the pfsense webserver. Sometimes i need to restart the webgui with /etc/rc.restart_webgui after a new cert has been issued periodically. So i did and then this error comes up. Now it comes again and again with the restart of the webgui. And after the upgrade to 23.5.01 the old cert was still in use. Only now after the new one has been issued this happens.
-
How are you triggering a restart of the GUI from ACME?
-
@jimp i dosen't, i do it manually via cli command
-
If you are trying that from your own non-root user then I could see it generating a PHP error because it lacks the privileges.
But ACME is capable of restarting the GUI on its own properly as a part of the renewal process, it's one of the given examples in the settings for each certificate:
Only root/admin could run that at the CLI over SSH, other accounts would need to run it through
sudo
. -
@jimp you are right but anyway sometimes i had to restart it (with root) manually from the cli. Now i just noticed the unsecure warning by accessing https of the pfsense. So i have checked acme and found a correct reissued cert. Then i tried to restart the webgui to exclude that point and this error occured.
now this is a yellow warning in the webgui:
Crash report begins. Anonymous machine information: amd64 14.0-CURRENT FreeBSD 14.0-CURRENT #1 plus-RELENG_23_05_1-n256108-459fc493a87: Wed Jun 28 04:26:04 UTC 2023 root@freebsd:/var/jenkins/workspace/pfSense-Plus-snapshots-23_05_1-main/obj/amd64/f2Em2w3l/var/jenkins/workspace/pfSense-Plus-snapshots-23_05_1-main/sources/ Crash report details: PHP Errors: [17-Oct-2023 10:04:51 Europe/Berlin] PHP Fatal error: Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in /etc/inc/rrd.inc:1027 Stack trace: #0 /etc/inc/rrd.inc(1027): fwrite(false, '#!/bin/sh\n\nexpo...') #1 /etc/rc.restart_webgui(44): enable_rrd_graphing() #2 {main} thrown in /etc/inc/rrd.inc on line 1027 No FreeBSD crash data found.
also the new reissued cert is not being used by the webserver.
-
How are you restarting the GUI? From what user?
-
@stephenw10 as i said root
-
Ok, but using what command? Option 11 from the console menu?
-
@stephenw10 sorry but again as i wrote with
/etc/rc.restart_webgui