Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I often need to setup new Debian servers, so I'm trying to setup a Squid proxy to cache apt-get updates/upgrades. But I always have a problem with some specific files it can retrieve.

Details:

  • i'm behing a proxy which is the only way to get access to internet. I don't know what software is used.
  • working on a ESX 5 : both squid server and clients
  • tried with squeeze and wheezy Debian release, booting on netinst CD or on network (PXE), with preseed configuration file or not
  • my Squid configuration looks like (parts of it)

    cache_peer      upstream_proxy.internal.domain.tld  parent  8080    0       no-query no-digest default
    cache_replacement_policy        heap LFUDA
    cache_dir ufs /var/spool/squid3 1000 16 256
    maximum_object_size     200 MB
    refresh_pattern .              0       20%     4320 refresh-ims
    

When running Debian installation, at first it works well (squid delivers packages correctly) but at one moment it tries to retrieve Packages.gz file and this one never gets delivered. I see the following entries in access.log (not sure if they always appears or not, seems not)

1370855387.060 950995 <internal IP> TCP_MISS/200 679695 GET http://ftp.fr.debian.org/debian/dists/squeeze/main/binary-amd64/Packages.gz - DEFAULT_PARENT/upstream_proxy.internal.domain.tld application/x-gzip
1370855542.916 947999 <internal IP> TCP_MISS/200 2247441 GET http://ftp.fr.debian.org/debian/dists/squeeze/main/binary-amd64/Packages.gz - DEFAULT_PARENT/upstream_proxy.internal.domain.tld application/x-gzip

If I use my upstream proxy directly in my Debian installer all works fine, so it must be a configuration problem but I can't figure what.

Anyone has an idea of what can be the problem or how I can debug it?

share|improve this question
    
why aren't you using the "right tool for the job" and running apt-cacher-ng instead? –  the-wabbit Jun 10 '13 at 10:14
    
everytime i tried apt-cacher-ng or other apt dedicated tools i got problems too. –  daks Jun 10 '13 at 11:49
    
which kind of problems exactly? –  the-wabbit Jun 10 '13 at 12:06
    
can't remember exactly now, but apt-get update/upgrade fails on clients –  daks Jun 10 '13 at 12:12
    
I'm finally back to test apt-cacher-ng. At first it seems to work well. I hope version change between squeeze and wheezy (from 0.5 to 0.7) made a lot of improvements in the software and solved lot of bugs. –  daks Jun 11 '13 at 8:40
add comment

1 Answer

Your log entries are showing that the file is retrieved after a relatively long period of time (951 seconds / 947 seconds) but has differing length (679695 vs. 2247441 bytes) despite of the identical URI, which would indicate a problem. The transfer might be timing out after ~950 seconds and aborting - possibly forced by the upstream proxy.

Check if you can retrieve the file successfully in sane time when not using Squid:

export http_proxy="http://upstream_proxy.internal.domain.tld:8080"
wget http://ftp.fr.debian.org/debian/dists/squeeze/main/binary-amd64/Packages.gz

and work from there isolating the issue. A tcpdump of the transfer between your Squid proxy instance and the remote proxy might help unclouding matters. Also, if available, check with the administrators / the technical support staff for the proxy you are using for possible causes for issues.

share|improve this answer
    
Retrieving this file directly via the upstream proxy works well, using wget, firefox or even the debian installer. Could it be a timeout problem on squid? –  daks Jun 10 '13 at 12:21
    
@daks the Squid "read timeout" is 15 minutes by default, which would somewhat fit into the picture. When the timeout expires, it should be logged according to the docs - check Squid's cache.log if you can find anything about that. Also, the question why it would time out (i.e. why the upstream proxy is not delivering any data after the initial couple of Kilobytes) would be unanswered yet. –  the-wabbit Jun 10 '13 at 13:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.