Project

General

Profile

Actions

Regression #13984

closed

PHP errors with squid

Added by Jonathan Lee about 1 year ago. Updated 7 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Squid
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
23.05.1
Affected Version:
2.7.0
Affected Plus Version:
23.01
Affected Architecture:
All

Description

I am not running Squid Reverse proxy, only Squid Proxy for outbound traffic.

PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squid_reverse.inc:414
Stack trace:
#0 /usr/local/pkg/squid.inc(751): squid_reverse_enabled()
#1 /usr/local/www/pkg_edit.php(137) : eval()'d code(1): squid_validate_general(Array, Array)
#2 /usr/local/www/pkg_edit.php(137): eval()
#3 {main}
  thrown in /usr/local/pkg/squid_reverse.inc on line 414

Files

1676748490774-php_errors.txt (433 Bytes) 1676748490774-php_errors.txt Errors Generated Jonathan Lee, 02/18/2023 08:36 PM
1676745801458-4fe04a1e-f6e7-468c-8c67-07cae91cda68-image.png (39.4 KB) 1676745801458-4fe04a1e-f6e7-468c-8c67-07cae91cda68-image.png Error Generated Jonathan Lee, 02/18/2023 08:37 PM
1676773644397-bfd72a15-12d7-42f4-b2c2-6915a46e37c1-image.png (42.7 KB) 1676773644397-bfd72a15-12d7-42f4-b2c2-6915a46e37c1-image.png Config area showing Reverse proxy not configured Jonathan Lee, 02/18/2023 08:38 PM
1676770173796-137e899c-1a1c-4e9d-9c05-316f7e445d65-image.png (77.4 KB) 1676770173796-137e899c-1a1c-4e9d-9c05-316f7e445d65-image.png Error displayed Jonathan Lee, 02/18/2023 08:43 PM
patch_squid.txt (31.9 KB) patch_squid.txt Marcos M, 05/03/2023 03:39 AM
Screenshot 2023-05-02 223416.jpg (163 KB) Screenshot 2023-05-02 223416.jpg Jonathan Lee, 05/03/2023 05:34 AM
Error.jpg (108 KB) Error.jpg Jonathan Lee, 05/03/2023 05:52 AM
error2.jpg (131 KB) error2.jpg Jonathan Lee, 05/03/2023 05:52 AM
Screenshot 2023-05-02 231306.jpg (323 KB) Screenshot 2023-05-02 231306.jpg Optional SSL Intercept and Transparent mode Jonathan Lee, 05/03/2023 06:13 AM
Screenshot 2023-05-02 231358.jpg (205 KB) Screenshot 2023-05-02 231358.jpg Jonathan Lee, 05/03/2023 06:15 AM
Screenshot 2023-05-03 at 1.40.44 PM.png (689 KB) Screenshot 2023-05-03 at 1.40.44 PM.png Jonathan Lee, 05/03/2023 08:41 PM
Screenshot 2023-05-03 at 1.42.22 PM.png (491 KB) Screenshot 2023-05-03 at 1.42.22 PM.png Jonathan Lee, 05/03/2023 08:42 PM
Screenshot 2023-05-03 at 1.18.24 PM.png (431 KB) Screenshot 2023-05-03 at 1.18.24 PM.png Jonathan Lee, 05/03/2023 08:42 PM
Screenshot 2023-05-03 151837.jpg (89.7 KB) Screenshot 2023-05-03 151837.jpg Jonathan Lee, 05/03/2023 10:19 PM
patch_squidGuard.txt (21.2 KB) patch_squidGuard.txt Marcos M, 05/03/2023 11:43 PM
Screenshot_20230505-133608.png (309 KB) Screenshot_20230505-133608.png Jonathan Lee, 05/05/2023 08:36 PM
Screenshot 2023-06-08 at 1.42.35 PM.png (369 KB) Screenshot 2023-06-08 at 1.42.35 PM.png Error that keeps occuring Jonathan Lee, 06/11/2023 04:21 PM

Related issues

Related to Regression #13978: PHP errors with squidGuardResolvedMarcos M

Actions
Actions #1

Updated by Jonathan Lee about 1 year ago

System was not having issues under prior version of pfSense. After update PHP errors occur when you try to make changes to Squid Proxy configuration under the GUI of pfSense.

Actions #3

Updated by Jonathan Lee about 1 year ago

Resolve for this was found when working with members of the Netgate forum, resave the reverse proxy settings and after Squid settings can be changed again.

https://forum.netgate.com/topic/178036/23-01-squid-issue/4?_=1676779106375

RESOLVED TAC Ticket also 1445820528 stated upgrade did not fully complete for me to reinstall pfsense from USB

Actions #4

Updated by Marcos M 11 months ago

  • Tracker changed from Bug to Regression
  • Subject changed from Squid 23.01 PHP issues when saving changes to PHP errors with Squid
  • Description updated (diff)
  • Affected Version set to 2.7.0
  • Affected Architecture All added
  • Affected Architecture deleted (SG-2100)

Additional errors:

[29-Apr-2023 11:47:53 America/Barbados] PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1124
Stack trace:
#0 /usr/local/pkg/squidguard.inc(1045): convert_pfxml_to_sgxml_destination(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 in /usr/local/pkg/squidguard.inc on line 1124
[29-Apr-2023 11:51:46 America/Barbados] PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1124
Stack trace:
#0 /usr/local/pkg/squidguard.inc(1045): convert_pfxml_to_sgxml_destination(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 in /usr/local/pkg/squidguard.inc on line 1124
[29-Apr-2023 11:53:52 America/Barbados] PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1124
Stack trace:
#0 /usr/local/pkg/squidguard.inc(1045): convert_pfxml_to_sgxml_destination(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 in /usr/local/pkg/squidguard.inc on line 1124

Actions #5

Updated by Marcos M 11 months ago

  • Assignee set to Marcos M
Actions #6

Updated by Marcos M 11 months ago

  • File patch_squid.txt patch_squid.txt added
  • File patch_squidGuard.txt added
  • Subject changed from PHP errors with Squid to PHP errors with squid and squidGuard
  • Status changed from New to Pull Request Review

https://gitlab.netgate.com/pfSense/FreeBSD-ports/-/merge_requests/337

Patch for both squid and squidGuiard are attached; use the System Patches pacakge to apply it (set Path Strip Count to 4): https://docs.netgate.com/pfsense/en/latest/development/system-patches.html

Actions #7

Updated by Jonathan Lee 11 months ago

I appreciate all you do. Testing attached patches, I noticed you adjusted clam AV or Squids antivirus to store on the SDD system, that looks awesome. I am running a reboot now.

Actions #8

Updated by Jonathan Lee 11 months ago

One error after reboot

Actions #9

Updated by Jonathan Lee 11 months ago

I ran into an error and had to revert back. Attached is the error.

Actions #10

Updated by Jonathan Lee 11 months ago

<removed patch success details>

Actions #11

Updated by Jonathan Lee 11 months ago

Other Patch debug does not show 64 in debug

Actions #12

Updated by Jonathan Lee 11 months ago

It just dawned on me I use both modes on Squid transparently and SSL Intercept is this a problem with me using this patch? It works perfectly fine after I did a firmware reinstall again. Amazon fire is Transparent Xbox is and Imac and Windows 12 have certs and run in SSL intercept.

Actions #13

Updated by Marcos M 11 months ago

  • File deleted (patch_squidGuard.txt)
Actions #14

Updated by Marcos M 11 months ago

  • File patch_squidGuard.txt added

Thanks for the test (no need to post patch details). Feel free to try again with the updated squidGuard patch.

Actions #16

Updated by Jonathan Lee 11 months ago

I got another user https://forum.netgate.com/user/hugoeyng to test with their PHP errors this was his result.

Jonathan Lee The log:

Crash report begins. Anonymous machine information:

amd64
14.0-CURRENT
FreeBSD 14.0-CURRENT #0 plus-RELENG_23_01-n256037-6e914874a5e: Fri Feb 10 20:30:29 UTC 2023 root@freebsd:/var/jenkins/workspace/pfSense-Plus-snapshots-23_01-main/obj/amd64/VDZvZksF/var/jenkins/workspace/pfSense-Plus-snapshots-23_01-main/sources/FreeBS

Crash report details:

PHP Errors:
[03-May-2023 18:12:49 America/Sao_Paulo] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1184
Stack trace:
#0 /usr/local/pkg/squidguard.inc(1038): convert_pfxml_to_sgxml_time(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 in /usr/local/pkg/squidguard.inc on line 1184
[03-May-2023 18:34:31 America/Sao_Paulo] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1184
Stack trace:
#0 /usr/local/pkg/squidguard.inc(1038): convert_pfxml_to_sgxml_time(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 in /usr/local/pkg/squidguard.inc on line 1184
[03-May-2023 18:34:41 America/Sao_Paulo] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1184
Stack trace:
#0 /usr/local/pkg/squidguard.inc(1038): convert_pfxml_to_sgxml_time(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 in /usr/local/pkg/squidguard.inc on line 1184
[03-May-2023 18:34:42 America/Sao_Paulo] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1193
Stack trace:
#0 /usr/local/pkg/squidguard.inc(1047): convert_pfxml_to_sgxml_time(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 in /usr/local/pkg/squidguard.inc on line 1193

No FreeBSD crash data found.

Actions #17

Updated by Marcos M 11 months ago

  • File deleted (patch_squidGuard.txt)
Actions #18

Updated by Marcos M 11 months ago

This should resolve the error, thanks!

Actions #19

Updated by Jonathan Lee 11 months ago

Thanks, I appreciate you. I posted the information about this to the Netgate forum again.

Actions #20

Updated by Jonathan Lee 11 months ago

This patch fixed the issue with the other user ben and the HA use, but the other user Hugo still has issues reinstalling Squidguard. It has been running for me for a couple days no issues. I appreciate you fixing this. Squidguard works great once it's running.

PHP ERROR: Type: 1, File: /usr/local/pkg/squidguard.inc, Line: 1193, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1193

Install log:

Installing pfSense-pkg-squidGuard...

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 3 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
db5: 5.3.28_9 [pfSense]
pfSense-pkg-squidGuard: 1.16.18_20 [pfSense]
squidGuard: 1.4_15 [pfSense]

Number of packages to be installed: 3

The process will require 15 MiB more space.
41 KiB to be downloaded.
[1/1] Fetching squidGuard-1.4_15.pkg: ...... done
Checking integrity... done (0 conflicting)
[1/3] Installing db5-5.3.28_9...
[1/3] Extracting db5-5.3.28_9: .......... done
[2/3] Installing squidGuard-1.4_15...
[2/3] Extracting squidGuard-1.4_15: ...... done
[3/3] Installing pfSense-pkg-squidGuard-1.16.18_20...
[3/3] Extracting pfSense-pkg-squidGuard-1.16.18_20: .......... done
Saving updated package information...
done.
Loading package configuration... done.
Configuring package components...
Loading package instructions...

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1193
Stack trace:
#0 /usr/local/pkg/squidguard.inc(1047): convert_pfxml_to_sgxml_time(Array)
#1 /usr/local/pkg/squidguard.inc(93): convert_pfxml_to_sgxml()
#2 /etc/inc/pkg-utils.inc(870): require_once('/usr/local/pkg/...')
#3 /etc/rc.packages(76): install_package_xml('squidGuard')
#4 {main}
thrown in /usr/local/pkg/squidguard.inc on line 1193
PHP ERROR: Type: 1, File: /usr/local/pkg/squidguard.inc, Line: 1193, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1193
Stack trace:
#0 /usr/local/pkg/squidguard.inc(1047): convert_pfxml_to_sgxml_time(Array)
#1 /usr/local/pkg/squidguard.inc(93): convert_pfxml_to_sgxml()
#2 /etc/inc/pkg-utils.inc(870): require_once('/usr/local/pkg/...')
#3 /etc/rc.packages(76): install_package_xml('squidGuard')
#4 {main}
thrownpkg-static: POST-INSTALL script failed =====
Message from db5-5.3.28_9:

--
===> NOTICE:

The db5 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
--
===> NOTICE:

This port is deprecated; you may wish to reconsider installing it:

EOLd, potential security issues, maybe use db18 instead.

It is scheduled to be removed on or after 2022-06-30. =====
Message from squidGuard-1.4_15:

Actions #21

Updated by Marcos M 11 months ago

The patch can't be applied to non-existent files, hence (re)installing the package will trigger issues resolved by the patch (since the patch is not applied at that point).

Actions #22

Updated by Jonathan Lee 11 months ago

Thanks for your reply.

For those logs you reviewed the user could not reinstall the package as it would not fully install because of the PHP errors start to surface during the package reinstall on his system. Therefore I added this Remine # to github https://github.com/pfsense/FreeBSD-ports/commits/devel/www/pfSense-pkg-squidGuard so that it is added to the package that is pulled. Again, I do not really know where to add in the comments on that side for requests so I added it to the https://github.com/pfsense/FreeBSD-ports/commit/830696d2248aede2a021d02917931b77b94ebfbb "fix dependency package" area, I am hoping that helps fix the package with your patch so that it is added to it. Or to bring some visibility to the issues.

Actions #23

Updated by EDUARDO RODRIGUEZ ROMERO 10 months ago

I have the same problem with the squidguard package, i try to reinstall the squidguard package and i received the error:

Upgrading pfSense-pkg-squidGuard...

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.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be REINSTALLED:
pfSense-pkg-squidGuard-1.16.18_20 [pfSense]

Number of packages to be reinstalled: 1
[1/1] Reinstalling pfSense-pkg-squidGuard-1.16.18_20...
[1/1] Extracting pfSense-pkg-squidGuard-1.16.18_20: .......... done
Removing squidGuard components...
Menu items... done.
Services... done.
Loading package instructions...

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1193
Stack trace:
#0 /usr/local/pkg/squidguard.inc(1047): convert_pfxml_to_sgxml_time(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 in /usr/local/pkg/squidguard.inc on line 1193
PHP ERROR: Type: 1, File: /usr/local/pkg/squidguard.inc, Line: 1193, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1193
Stack trace:
#0 /usr/local/pkg/squidguard.inc(1047): convert_pfxml_to_sgxml_time(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}
thrownpkg-static: DEINSTALL script failed
Saving updated package information...
overwrite!
Loading package configuration... done.
Configuring package components...
Loading package instructions...

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1193
Stack trace:
#0 /usr/local/pkg/squidguard.inc(1047): convert_pfxml_to_sgxml_time(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 in /usr/local/pkg/squidguard.inc on line 1193
PHP ERROR: Type: 1, File: /usr/local/pkg/squidguard.inc, Line: 1193, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/pkg/squidguard.inc:1193
Stack trace:
#0 /usr/local/pkg/squidguard.inc(1047): convert_pfxml_to_sgxml_time(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}
thrownpkg-static: POST-INSTALL script failed

Cleaning up cache... done.

Success

Actions #24

Updated by EDUARDO RODRIGUEZ ROMERO 10 months ago

Can please somebody help me. This is really important for me because at this moment i dont have any restriction for the user internet navigation.

Thanks a lot

Actions #25

Updated by EDUARDO RODRIGUEZ ROMERO 10 months ago

I just found the problem and the solution.

Problem:

The squidguardtime settings it's empty

Solution:

Take a backup configuration (DiagnosticsBackup -> RestoreBackup -> Restore -> Download configuration as XML)

Edit the xml file and search "<squidguardtime>", delete the tag "<squidguardtime></squidguardtime>", save the file with another name, example "config-good.xml".

Restore the new configuration file (DiagnosticsBackup -> RestoreBackup -> Restore -> Configuration file), select the file "config-good.xml" and then press the button "Restore Configuration"

After that, the system will restart, reinstall the packages and everything will be fine. DonĀ“t neeed to do anything else.

Let me know if everything it's fine.

Actions #26

Updated by Marcos M 10 months ago

  • Status changed from Pull Request Review to Feedback
  • Target version set to 2.7.0
  • Plus Target Version set to 23.01

Fixed on squid 0.4.46 and squidGuard 1.16.19; these should be available on the next ports build.

Actions #27

Updated by Marcos M 10 months ago

  • Subject changed from PHP errors with squid and squidGuard to PHP errors with squid
Actions #28

Updated by Marcos M 10 months ago

Actions #29

Updated by Jim Pingle 10 months ago

  • Target version deleted (2.7.0)
  • Plus Target Version deleted (23.01)
Actions #30

Updated by Jonathan Lee 10 months ago

If this is fixed can this be closed?

Actions #31

Updated by Jonathan Lee 10 months ago

https://redmine.pfsense.org/issues/14426

Hello Marcos I found you some more PHP issues with this under Squid reports view. After viewing for 2 mins or so it always occurs with new Squid version.

PHP Errors:
[08-Jun-2023 12:12:33 US/Pacific] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/sqstat/sqstat.php:137
Stack trace:
#0 /usr/local/www/sqstat/sqstat.php(63): sqstat_resultHTML('')
#1 /usr/local/www/sqstat/sqstat.php(38): sqstat_AJAX_response(Array)
#2 {main}
thrown in /usr/local/www/sqstat/sqstat.php on line 137

RISC:

ARM Cortex-A53 r0p4
2 CPUs :
CPU 0: ARM Cortex-A53 r0p4 affinity: 0
CPU 1: ARM Cortex-A53 r0p4 affinity: 1

This occurs all the time.

Actions #32

Updated by Jonathan Lee 9 months ago

@Marcos

Thanks for looking into this.

Actions #33

Updated by Marcos M 7 months ago

  • Status changed from Feedback to Resolved
  • Plus Target Version set to 23.05.1
Actions

Also available in: Atom PDF