Re: Squid 3.2 Cannot bind socket

From: Menil Jean-Philippe <jean-philippe.menil_at_univ-nantes.fr>
Date: Thu, 02 Dec 2010 13:12:30 +0100

Le 30/11/2010 16:54, Alex Rousskov a écrit :
> On 11/30/2010 07:34 AM, Jean-Philippe Menil wrote:
>> Le 28/11/2010 18:14, Alex Rousskov a écrit :
>>> On 11/26/2010 12:36 AM, Jean-Philippe Menil wrote:
>>>> Le 26/11/2010 06:51, Jean-Philippe Menil a écrit :
>>>>> Hi,
>>>>>
>>>>> i recently installed squid 3.2 with "workers 2".
>>>>> However, i see the following in the cache.log:
>>>>>
>>>>> 2010/11/23 16:10:49 kid1| Ready to serve requests.
>>>>> 2010/11/23 16:10:49 kid1| commBind: Cannot bind socket FD 12 to [::]:
>>>>> (2) No such file or directory
>>>>> 2010/11/23 16:10:49 kid3| Loaded Icons.
>>>>> 2010/11/23 16:10:49 kid3| Squid modules loaded: 0
>>>>> 2010/11/23 16:10:49 kid3| Adaptation support is off.
>>>>> 2010/11/23 16:10:49 kid3| Ready to serve requests.
>>>>> 2010/11/23 16:10:49 kid3| commBind: Cannot bind socket FD 10 to [::]:
>>>>> (2) No such file or directory
>>>>>
>>>>> First, i think it was related to ipv6, but after recompiling squid
>>>>> with
>>>>> "--disable-ipv6", i observe the same error.
>>>
>>>
>>>> it seems not related to ipv6 afteward.
>>>>
>>>> In the suqid.conf, if i had the following:
>>>>
>>>> if ${process_name} = 1
>>>> http_port 3129
>>>> endif
>>>>
>>>> if ${process_name} = 2
>>>> http_port 3130
>>>> endif
>>>>
>>>> Squid odes not start:
>>>>
>>>> Starting Squid HTTP Proxy 3.x: squid3Creating Squid HTTP Proxy 3.x
>>>> cache
>>>> structure ... (warning).
>>>> FATAL: String is not a integer number: 'squid'
>>>
>>> This failure is expected, for the reported reason.
>>>
>>>
>>>> But if i had the following otpions:
>>>>
>>>> if ${process_number} = 1
>>>> http_port 3129
>>>> endif
>>>>
>>>> if ${process_number} = 2
>>>> http_port 3130
>>>> endif
>>>>
>>>>
>>>> Squid is starting with the following logs:
>>>>
>>>> 2010/11/26 07:32:06 kid3| Took 0.00 seconds ( 0.00 entries/sec).
>>>> FATAL: No port defined
>>>
>>> This one looks like a Squid bug. The coordinator process (kid3 if you
>>> have two workers) quits because it does not have an http_port number
>>> specified. However, the coordinator process does not need and does not
>>> use http_ports! We will remove the unneeded check for the coordinator.
>>>
>>> Meanwhile, please add an http_port line for coordinator or, better, use
>>> an else syntax:
>>>
>>> if ${process_number} = 1
>>> http_port 3129
>>> else
>>> http_port 3130
>>> endif
>>>
>>> Another option is to use process number of the port itself and avoid all
>>> conditionals. For example,
>>>
>>> http_port 313${process_number}
>>>
>>> Needless to say, this last approach would require appropriate changes in
>>> your network and/or client configuration.
>>>
>>> HTH,
>>>
>>> Alex.
>> Hi,
>>
>> thanks for your response.
>>
>> I tried your else syntax, and i have the same result.
>> Squid process are running, whitout listening on tcp port:
>
> IIRC, your previous result was a FATAL message, so things have changed,
> but the primary problem is still there.
>
>> inmon:~# netstat -lataupen
>> udp 0 0 0.0.0.0:33041 0.0.0.0:* 13 5055 1208/(squid-2)
>> udp 0 0 0.0.0.0:41132 0.0.0.0:* 13 5038 1209/(squid-1)
>> udp 0 0 0.0.0.0:50132 0.0.0.0:* 13 5019 1207/(squid-coord-3
>> udp6 0 0 :::54532 :::* 13 5018 1207/(squid-coord-3
>> udp6 0 0 :::35879 :::* 13 5054 1208/(squid-2)
>> udp6 0 0 :::40376 :::* 13 5037 1209/(squid-1)
>>
>> Here is the cache.log:
>>
>> 2010/11/30 14:26:18 kid3| Creating Swap Directories
>> 2010/11/30 14:26:18 kid1| Creating Swap Directories
>> 2010/11/30 14:26:18 kid2| Creating Swap Directories
>> 2010/11/30 14:26:18 kid3| Starting Squid Cache version 3.2.0.3 for
>> x86_64-pc-linux-gnu...
>> 2010/11/30 14:26:18 kid3| Process ID 1207
>> 2010/11/30 14:26:18 kid3| With 65535 file descriptors available
>> 2010/11/30 14:26:18 kid3| Initializing IP Cache...
>> 2010/11/30 14:26:18 kid3| DNS Socket created at [::], FD 7
>> 2010/11/30 14:26:18 kid3| DNS Socket created at 0.0.0.0, FD 8
>> 2010/11/30 14:26:18 kid3| Adding domain univ-nantes.prive from
>> /etc/resolv.conf
>> 2010/11/30 14:26:18 kid3| Adding nameserver 172.20.12.11 from
>> /etc/resolv.conf
>> 2010/11/30 14:26:18 kid3| Adding nameserver 172.20.12.22 from
>> /etc/resolv.conf
>> 2010/11/30 14:26:18 kid3| Adding nameserver 172.20.12.23 from
>> /etc/resolv.conf
>> 2010/11/30 14:26:18 kid3| User-Agent logging is disabled.
>> 2010/11/30 14:26:18 kid3| Logfile: opening log
>> daemon:/var/log/squid3/access.log
>> 2010/11/30 14:26:18 kid3| Logfile Daemon: opening log
>> /var/log/squid3/access.log
>> 2010/11/30 14:26:18 kid1| Starting Squid Cache version 3.2.0.3 for
>> x86_64-pc-linux-gnu...
>> 2010/11/30 14:26:18 kid1| Process ID 1209
>> 2010/11/30 14:26:18 kid1| With 65535 file descriptors available
>> 2010/11/30 14:26:18 kid1| Initializing IP Cache...
>> 2010/11/30 14:26:18 kid1| DNS Socket created at [::], FD 7
>> 2010/11/30 14:26:18 kid1| DNS Socket created at 0.0.0.0, FD 8
>> 2010/11/30 14:26:18 kid1| Adding domain univ-nantes.prive from
>> /etc/resolv.conf
>> 2010/11/30 14:26:18 kid1| Adding nameserver 172.20.12.11 from
>> /etc/resolv.conf
>> 2010/11/30 14:26:18 kid1| Adding nameserver 172.20.12.22 from
>> /etc/resolv.conf
>> 2010/11/30 14:26:18 kid1| Adding nameserver 172.20.12.23 from
>> /etc/resolv.conf
>> 2010/11/30 14:26:18 kid1| User-Agent logging is disabled.
>> 2010/11/30 14:26:18 kid1| Logfile: opening log
>> daemon:/var/log/squid3/access.log
>> 2010/11/30 14:26:18 kid1| Logfile Daemon: opening log
>> /var/log/squid3/access.log
>> 2010/11/30 14:26:18 kid2| Starting Squid Cache version 3.2.0.3 for
>> x86_64-pc-linux-gnu...
>> 2010/11/30 14:26:18 kid2| Process ID 1208
>> 2010/11/30 14:26:18 kid2| With 65535 file descriptors available
>> 2010/11/30 14:26:18 kid2| Initializing IP Cache...
>> 2010/11/30 14:26:18 kid2| DNS Socket created at [::], FD 7
>> 2010/11/30 14:26:18 kid2| DNS Socket created at 0.0.0.0, FD 8
>> 2010/11/30 14:26:18 kid2| Adding domain univ-nantes.prive from
>> /etc/resolv.conf
>> 2010/11/30 14:26:18 kid2| Adding nameserver 172.20.12.11 from
>> /etc/resolv.conf
>> 2010/11/30 14:26:18 kid2| Adding nameserver 172.20.12.22 from
>> /etc/resolv.conf
>> 2010/11/30 14:26:18 kid2| Adding nameserver 172.20.12.23 from
>> /etc/resolv.conf
>> 2010/11/30 14:26:18 kid2| User-Agent logging is disabled.
>> 2010/11/30 14:26:18 kid2| Logfile: opening log
>> daemon:/var/log/squid3/access.log
>> 2010/11/30 14:26:18 kid2| Logfile Daemon: opening log
>> /var/log/squid3/access.log
>> 2010/11/30 14:26:18 kid3| Unlinkd pipe opened on FD 14
>> 2010/11/30 14:26:18 kid3| Local cache digest enabled; rebuild/rewrite
>> every 3600/3600 sec
>> 2010/11/30 14:26:18 kid3| Store logging disabled
>> 2010/11/30 14:26:18 kid3| Swap maxSize 0 + 262144 KB, estimated 20164
>> objects
>> 2010/11/30 14:26:18 kid3| Target number of buckets: 1008
>> 2010/11/30 14:26:18 kid3| Using 8192 Store buckets
>> 2010/11/30 14:26:18 kid3| Max Mem size: 262144 KB
>> 2010/11/30 14:26:18 kid3| Max Swap size: 0 KB
>> 2010/11/30 14:26:18 kid3| Using Least Load store dir selection
>> 2010/11/30 14:26:18 kid3| Set Current Directory to /var/cache
>> 2010/11/30 14:26:18 kid3| Loaded Icons.
>> 2010/11/30 14:26:18 kid3| Squid modules loaded: 0
>> 2010/11/30 14:26:18 kid3| Adaptation support is off.
>> 2010/11/30 14:26:18 kid3| Ready to serve requests.
>> 2010/11/30 14:26:18 kid3| commBind: Cannot bind socket FD 10 to [::]:
>> (2) No such file or directory
>> 2010/11/30 14:26:18 kid1| Unlinkd pipe opened on FD 14
>> 2010/11/30 14:26:18 kid1| Local cache digest enabled; rebuild/rewrite
>> every 3600/3600 sec
>> 2010/11/30 14:26:18 kid1| Store logging disabled
>> 2010/11/30 14:26:18 kid1| Swap maxSize 0 + 262144 KB, estimated 20164
>> objects
>> 2010/11/30 14:26:18 kid1| Target number of buckets: 1008
>> 2010/11/30 14:26:18 kid1| Using 8192 Store buckets
>> 2010/11/30 14:26:18 kid1| Max Mem size: 262144 KB
>> 2010/11/30 14:26:18 kid1| Max Swap size: 0 KB
>> 2010/11/30 14:26:18 kid1| Using Least Load store dir selection
>> 2010/11/30 14:26:18 kid1| Set Current Directory to /var/cache
>> 2010/11/30 14:26:18 kid1| Loaded Icons.
>> 2010/11/30 14:26:18 kid1| HTCP Disabled.
>> 2010/11/30 14:26:18 kid1| Squid modules loaded: 0
>> 2010/11/30 14:26:18 kid1| Adaptation support is off.
>> 2010/11/30 14:26:18 kid1| Ready to serve requests.
>> 2010/11/30 14:26:18 kid1| commBind: Cannot bind socket FD 12 to [::]:
>> (2) No such file or directory
>> 2010/11/30 14:26:18 kid2| Unlinkd pipe opened on FD 14
>> 2010/11/30 14:26:18 kid2| Local cache digest enabled; rebuild/rewrite
>> every 3600/3600 sec
>> 2010/11/30 14:26:18 kid2| Store logging disabled
>> 2010/11/30 14:26:18 kid2| Swap maxSize 0 + 262144 KB, estimated 20164
>> objects
>> 2010/11/30 14:26:18 kid2| Target number of buckets: 1008
>> 2010/11/30 14:26:18 kid2| Using 8192 Store buckets
>> 2010/11/30 14:26:18 kid2| Max Mem size: 262144 KB
>> 2010/11/30 14:26:18 kid2| Max Swap size: 0 KB
>> 2010/11/30 14:26:18 kid2| Using Least Load store dir selection
>> 2010/11/30 14:26:18 kid2| Set Current Directory to /var/cache
>> 2010/11/30 14:26:18 kid2| Loaded Icons.
>> 2010/11/30 14:26:18 kid2| HTCP Disabled.
>> 2010/11/30 14:26:18 kid2| Squid modules loaded: 0
>> 2010/11/30 14:26:18 kid2| Adaptation support is off.
>> 2010/11/30 14:26:18 kid2| Ready to serve requests.
>> 2010/11/30 14:26:18 kid2| commBind: Cannot bind socket FD 12 to [::]:
>> (2) No such file or directory
>> 2010/11/30 14:26:19 kid3| storeLateRelease: released 0 objects
>> 2010/11/30 14:26:20 kid1| storeLateRelease: released 0 objects
>> 2010/11/30 14:26:20 kid2| storeLateRelease: released 0 objects
>>
>> i'm a bit disapointed.
>
> Me too. Please enable full debugging (debug_options ALL,9), start Squid,
> and post the corresponding cache.log (as an attachment and compressed if
> needed). You may want to convert this into a bug report.
>
> FWIW, the if-else configuration works fine here, even with four workers:
>
>> 2010/11/30 08:55:24 kid1| Accepting HTTP connections at [::]:3129, FD 11.
>> 2010/11/30 08:55:24 kid3| Accepting HTTP connections at [::]:3130, FD 11.
>> 2010/11/30 08:55:24 kid4| Accepting HTTP connections at [::]:3130, FD 11.
>> 2010/11/30 08:55:24 kid2| Accepting HTTP connections at [::]:3130, FD 11.
>
> I hope debugging logs will expose the problem you are facing.
>
>
> BTW, is there a reason you want to use different ports for different
> workers? It is fine to do that if you actually need it, of course. Just
> keep in mind that workers can share listening ports.
>
> Thank you,
>
> Alex.
>
>
Hi,

finally, with the debug option you send me, i'm able to see more clearly.

Squid was'nt starting normally, because he want to create the
coordinator.ipc and suiq-*.ipc int he /usr/var/run.
This directory doesn't exist. After create it, and set the right
permissions; squid start successfully.

I have compiled squid with theses options:

--datadir=/usr/share/squid3 \
                --sysconfdir=/etc/squid3 \
                --mandir=/usr/share/man \
                --with-cppunit-basedir=/usr \
                --enable-inline \
                --enable-async-io=8 \
                --enable-storeio="ufs,aufs,diskd" \
                --enable-removal-policies="lru,heap" \
                --enable-delay-pools \
                --enable-cache-digests \
                --enable-underscores \
                --enable-icap-client \
                --enable-follow-x-forwarded-for \
                --enable-useragent-log \
                --enable-auth \
         
--enable-auth-basic="LDAP,MSNT,NCSA,PAM,SASL,SMB,YP,getpwnam,multi-domain-NTLM"
\
                --enable-auth-ntlm="SMB" \
                --enable-auth-digest="ldap,password" \
                --enable-auth-negotiate="squid_kerb_auth" \
         
--enable-external-acl-helpers="ip_user,ldap_group,session,unix_group,wbinfo_group"
\
                 --enable-arp-acl \
                 --enable-esi \
                --enable-snmp \
                --disable-translation \
                --disable-ident-lookups \
                --disable-ipv6 \
                --with-logdir=/var/log/squid3 \
                --with-pidfile=/var/run/squid3.pid \
                --with-filedescriptors=65536 \
                --with-large-files \
                --without-netfilter-conntrack \
                --with-default-user=proxy

I think, it's related to the prefix or the cppinit-basedir?

Received on Thu Dec 02 2010 - 12:18:18 MST

This archive was generated by hypermail 2.2.0 : Fri Dec 03 2010 - 12:00:03 MST