Squid Guard PHP error after upgrade to 23.01
-
I upgraded my Netgate 1541 to the pfSense Plus 23.01 today and I got a an alert after the update:
PHP ERROR: Type: 1, File: /usr/local/pkg/squidguard.inc, Line: 1150, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1150 Stack trace: #0 /usr/local/pkg/squidguard.inc(1046): convert_pfxml_to_sgxml_rewrite(Array) #1 /usr/local/pkg/squidguard.inc(93): convert_pfxml_to_sgxml() #2 /etc/inc/pkg-utils.inc(691): require_once('/usr/local/pkg/...') #3 /etc/rc.start_packages(66): sync_package('squidGuard') #4 {main} thrown @ 2023-02-25 13:24:36
I tried uninstalling squid proxy and squid guard, rebooting, and reinstalling. This did not resolve the issue. Squid proxy is still available from the services menu, but squidguard is not. I ended up reverting to 22.05 by switching boot environment.
-
@ben-ihelputech I created a topic a week ago and anyone could say something that help. I am still waiting.
-
Same problem...
-
@hugoeyng Could you please link your topic?
-
I would recommend a complete reset outlined here.
https://docs.netgate.com/pfsense/en/latest/troubleshooting/squid.html#complete-reset
-
@ben-ihelputech https://forum.netgate.com/topic/177948/the-firewall-encountered-an-error-after-upgrading-to-23-01
-
I tried updating my boot environment again and still ran into these errors:
PHP errors PHP ERROR: Type: 64, File: /usr/local/pkg/squid.inc, Line: 852, Message: Array and string offset access syntax with curly braces is no longer supported @ 2023-04-18 17:02:11 ... PHP ERROR: Type: 1, File: /usr/local/pkg/squidguard.inc, Line: 1150, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1150 Stack trace: #0 /usr/local/pkg/squidguard.inc(1046): convert_pfxml_to_sgxml_rewrite(Array) #1 /usr/local/pkg/squidguard.inc(93): convert_pfxml_to_sgxml() #2 /etc/inc/pkg-utils.inc(1068): require_once('/usr/local/pkg/...') #3 /etc/rc.packages(80): delete_package_xml('squidGuard', 'deinstall') #4 {main} thrown @ 2023-04-18 17:02:27 PHP ERROR: Type: 1, File: /usr/local/pkg/squidguard.inc, Line: 1150, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1150 Stack trace: #0 /usr/local/pkg/squidguard.inc(1046): convert_pfxml_to_sgxml_rewrite(Array) #1 /usr/local/pkg/squidguard.inc(93): convert_pfxml_to_sgxml() #2 /etc/inc/pkg-utils.inc(868): require_once('/usr/local/pkg/...') #3 /etc/rc.packages(76): install_package_xml('squidGuard') #4 {main} thrown @ 2023-04-18 17:02:28 PHP ERROR: Type: 1, File: /usr/local/pkg/squidguard.inc, Line: 1150, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1150 Stack trace: #0 /usr/local/pkg/squidguard.inc(1046): convert_pfxml_to_sgxml_rewrite(Array) #1 /usr/local/pkg/squidguard.inc(93): convert_pfxml_to_sgxml() #2 /etc/inc/pkg-utils.inc(691): require_once('/usr/local/pkg/...') #3 /etc/rc.start_packages(66): sync_package('squidGuard') #4 {main} thrown @ 2023-04-18 17:02:45
Seems like the function that parses custom squid integrations is not happy for some reason.
-
I did more testing today, and the error might be related to XMLRPC Sync. I have been trying to upgrade my secondary firewall before I upgrade my primary firewall. I have a suspicion that the older PHP 7 config from the primary firewall is trying to force itself onto the backup firewall. When I disable XMLRPC sync for Squid and SquidGuard, I am able to reinstall both packages on the backup firewall after upgrading with no issues.
-
I did a clean install of both firewalls (one at a time to maintain uptime). After reinstallation, when I enable XMLRPC sync, I get an error on SquidGuard, which crashes the service. The solution for right now is to manually sync the settings between both firewalls for SquidGuard, which prevents the error. This is less than ideal and I hope it gets patched soon.
[24-Apr-2023 11:29:33 America/Chicago] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1150 Stack trace: #0 /usr/local/pkg/squidguard.inc(1046): convert_pfxml_to_sgxml_rewrite(Array) #1 /usr/local/pkg/squidguard.inc(93): convert_pfxml_to_sgxml() #2 /usr/local/www/xmlrpc.php(147) : eval()'d code(1): require_once('/usr/local/pkg/...') #3 /usr/local/www/xmlrpc.php(147): eval() #4 /usr/local/share/pear/XML/RPC2/Server/CallHandler/Instance.php(141): pfsense_xmlrpc_server->exec_php('require_once('/...', 0) #5 /usr/local/share/pear/XML/RPC2/Backend/Php/Server.php(135): XML_RPC2_Server_Callhandler_Instance->__call('pfsense.exec_ph...', Array) #6 /usr/local/share/pear/XML/RPC2/Backend/Php/Server.php(99): XML_RPC2_Backend_Php_Server->getResponse() #7 /usr/local/www/xmlrpc.php(988): XML_RPC2_Backend_Php_Server->handleCall() #8 {main} thrown in /usr/local/pkg/squidguard.inc on line 1150 [24-Apr-2023 11:30:43 America/Chicago] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1150 Stack trace: #0 /usr/local/pkg/squidguard.inc(1046): convert_pfxml_to_sgxml_rewrite(Array) #1 /usr/local/pkg/squidguard.inc(93): convert_pfxml_to_sgxml() #2 /usr/local/www/xmlrpc.php(147) : eval()'d code(1): require_once('/usr/local/pkg/...') #3 /usr/local/www/xmlrpc.php(147): eval() #4 /usr/local/share/pear/XML/RPC2/Server/CallHandler/Instance.php(141): pfsense_xmlrpc_server->exec_php('require_once('/...', 0) #5 /usr/local/share/pear/XML/RPC2/Backend/Php/Server.php(135): XML_RPC2_Server_Callhandler_Instance->__call('pfsense.exec_ph...', Array) #6 /usr/local/share/pear/XML/RPC2/Backend/Php/Server.php(99): XML_RPC2_Backend_Php_Server->getResponse() #7 /usr/local/www/xmlrpc.php(988): XML_RPC2_Backend_Php_Server->handleCall() #8 {main} thrown in /usr/local/pkg/squidguard.inc on line 1150 [24-Apr-2023 11:31:54 America/Chicago] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1150 Stack trace: #0 /usr/local/pkg/squidguard.inc(1046): convert_pfxml_to_sgxml_rewrite(Array) #1 /usr/local/pkg/squidguard.inc(93): convert_pfxml_to_sgxml() #2 /usr/local/www/xmlrpc.php(147) : eval()'d code(1): require_once('/usr/local/pkg/...') #3 /usr/local/www/xmlrpc.php(147): eval() #4 /usr/local/share/pear/XML/RPC2/Server/CallHandler/Instance.php(141): pfsense_xmlrpc_server->exec_php('require_once('/...', 0) #5 /usr/local/share/pear/XML/RPC2/Backend/Php/Server.php(135): XML_RPC2_Server_Callhandler_Instance->__call('pfsense.exec_ph...', Array) #6 /usr/local/share/pear/XML/RPC2/Backend/Php/Server.php(99): XML_RPC2_Backend_Php_Server->getResponse() #7 /usr/local/www/xmlrpc.php(988): XML_RPC2_Backend_Php_Server->handleCall() #8 {main} thrown in /usr/local/pkg/squidguard.inc on line 1150 [24-Apr-2023 11:33:05 America/Chicago] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1150 Stack trace: #0 /usr/local/pkg/squidguard.inc(1046): convert_pfxml_to_sgxml_rewrite(Array) #1 /usr/local/pkg/squidguard.inc(93): convert_pfxml_to_sgxml() #2 /usr/local/www/xmlrpc.php(147) : eval()'d code(1): require_once('/usr/local/pkg/...') #3 /usr/local/www/xmlrpc.php(147): eval() #4 /usr/local/share/pear/XML/RPC2/Server/CallHandler/Instance.php(141): pfsense_xmlrpc_server->exec_php('require_once('/...', 0) #5 /usr/local/share/pear/XML/RPC2/Backend/Php/Server.php(135): XML_RPC2_Server_Callhandler_Instance->__call('pfsense.exec_ph...', Array) #6 /usr/local/share/pear/XML/RPC2/Backend/Php/Server.php(99): XML_RPC2_Backend_Php_Server->getResponse() #7 /usr/local/www/xmlrpc.php(988): XML_RPC2_Backend_Php_Server->handleCall() #8 {main} thrown in /usr/local/pkg/squidguard.inc on line 1150
-
Solved: Apply patches
-
Apply both Squid and Squidguard patch files with level 4 per the directions. I have been running them on a 2100 max and it works fine for day and a half now no issues.
-
@ben-ihelputech How do I apply the patches on my 2100MAX? I have the same errors and occasional crashes today after upgrading but am a casual home user.
Or how long before these appear in the package manager as an upgrade?
-
-
@ben-ihelputech Many thanks, that was quite helpful.