PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/firewall_rules.php:805
-
Just upgraded my pfsense box from 22.05 to 23.01. I've been getting fatal php errors when trying to view the floating firewall rules page:
Crash report details: PHP Errors: [17-Feb-2023 17:43:12 America/Los_Angeles] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/firewall_rules.php:805 Stack trace: #0 {main} thrown in /usr/local/www/firewall_rules.php on line 805
That line in firewall_rules.php is:
if ($config['openvpn']['openvpn-server'] || $config['openvpn']['openvpn-client'])
I used to have openvpn setup, but I removed the config a while back and setup wireguard instead. I figured I'd see what would happen if I went through the wizard again and setup another openvpn server. With a new openvpn server and interface created, the firewall floating rules page errors disappear. Deleting the openvpn server causes the php errors to occur again.
It displays 8 (out of 13) rules then the error and nothing else. This is what's actually displayed on the floating rules page instead of the next floating rule in the list. The rule is a pass rule... nothing to do with openvpn:
So now after writing this whole post and creating/deleting an openvpn server several times, I decided to delete the next 3 floating rules (two were pass rules. the 3rd was a block rule. all used ip aliases). This time when I deleted the openvpn server the errors did not return when viewing the floating rules page. I've since moved the referenced ips I had in the floating firewall rules to rules within pfBlocker, which is how I should have been handling these to begin with.
So problem solved I guess? Not sure why it was getting hung up on those particular rules to begin with. Posting this in case anyone else runs into this same problem. You're welcome. ;)
-
Created a bug to track it: https://redmine.pfsense.org/issues/13982
That shouldn't happen.
-
@stephenw10 Looks the same as my issue and the issue from other users. We all get these PHP Fatal error but only with different pages in the WebGUI. Mine was in the DHCP Server tab, another @furom has it with the interface tab. This guy here has it with the firewall tab.
-
-
@mrsunfire Those are all different errors that just have similar failure modes.
-
@stephenw10 I am having a similar issue with Squid when I save changes on the general tab
-
seen that i have same issue ...fatal error on firewall rules, and the bad thing all rules not running as well after upgrade 23.01
telegram keep sending notification PHP Error
-
That is the same bug: https://redmine.pfsense.org/issues/13953
So you can workaround it by removing the OpenVPN group from the interfaces that floating rule is working on. Or by adding an OpenVPN instance even if it does nothing.
Steve
-
@stephenw10 hello Stephen, what about the issue with is there any work around?
-
I don't know about that but it's a different bug it should be in a new thread. Unless one exists.
-
Sorry that is on a couple different threads, I have one here
https://forum.netgate.com/topic/178036/23-01-squid-issue/3?_=1676773067228
It is PHP errors when you save configuration changes