OPNsense Forum

English Forums => Web Proxy Filtering and Caching => Topic started by: ssbarnea on March 21, 2019, 03:02:13 pm

Title: New installation: squid fails to start: Unable to open HTTP Socket
Post by: ssbarnea on March 21, 2019, 03:02:13 pm
Something weird is happening with squid on my new opnsense deployment: it fails to (re)start because 3128 is kept by itself!

If I go to the CLI and kill the quid process, it will succeed starting, until I change something in UI and need to restart it.

And yes I do have both IPv4 and IPv6 setup on my network.

```
2019/03/21 13:53:10|    pinger: ICMPv6 socket opened
2019/03/21 13:53:10|    pinger: ICMP socket opened.
2019/03/21 13:53:10|    pinger: Initialising ICMP pinger ...
2019/03/21 13:53:10    kid1| Closing Pinger socket on FD 19
Page faults    with physical i/o: 0
Maximum Resident    Size: 221360 KB
CPU Usage:    0.044 seconds = 0.030 user + 0.015 sys
Squid Cache    (Version 3.5.28): Terminated abnormally.
FATAL: Unable    to open HTTP Socket
2019/03/21 13:53:10    kid1| Closing HTTP port 192.168.33.1:3128
2019/03/21 13:53:10    kid1| Adaptation support is off.
2019/03/21 13:53:10    kid1| Squid plugin modules loaded: 0
2019/03/21 13:53:10    kid1| Pinger socket opened on FD 19
2019/03/21 13:53:10    kid1| HTCP Disabled.
2019/03/21 13:53:10    kid1| commBind: Cannot bind socket FD 17 to 192.168.33.1:3128: (48) Address already in use
2019/03/21 13:53:10    kid1| Finished loading MIME types and icons.
2019/03/21 13:53:10    kid1| Set Current Directory to /var/squid/cache
2019/03/21 13:53:10    kid1| Using Least Load store dir selection
2019/03/21 13:53:10    kid1| Rebuilding storage in /var/squid/cache (dirty log)
2019/03/21 13:53:10    kid1| Max Swap size: 51200000 KB
2019/03/21 13:53:10    kid1| Max Mem size: 4194304 KB
2019/03/21 13:53:10    kid1| Using 262144 Store buckets
```
Title: Re: New installation: squid fails to start: Unable to open HTTP Socket
Post by: hbc on March 21, 2019, 03:28:08 pm
Code: [Select]
2019/03/21 13:53:10    kid1| commBind: Cannot bind socket FD 17 to 192.168.33.1:3128: (48) Address already in use
2019/03/21 13:53:10    kid1| Rebuilding storage in /var/squid/cache (dirty log

Are you sure that squid is really killed and not still shutting down? Address is still used and your cache log is dirty. Is /var/run/squid/squid.pid present? If yes, check its content and kill this pid.

You can also use /usr/local/etc/rc.d/squid status to check squid status and /usr/local/etc/rc.d/squid stop to end it.

My squid e.g. sometimes needs ages to stop. The waiting for pid message is shown sometimes for over 30 minutes till squid gets killed. So I have to bypass webtraffic during this periode.

Title: Re: New installation: squid fails to start: Unable to open HTTP Socket
Post by: bob@afrinet.eu on July 28, 2020, 12:40:25 pm
This is not good !

chown root:squid /usr/local/libexec/squid/pinger
chmod 4410 /usr/local/libexec/squid/pinger

Is way better.