Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

On an Ubuntu 12.04 server, with squid-deb-proxy installed, client machines on the network will properly contact the server when installing packages, but squid never caches packages.

From /var/log/squid-deb-proxy/access.log:

1368371692.721    485 192.168.1.220 TCP_MISS/200 20304 GET http://us.archive.ubuntu.com/ubuntu/pool/universe/c/cowsay/cowsay_3.03+dfsg1-3_all.deb - DIRECT/91.189.91.13 application/x-debian-package
1368371721.534    264 192.168.1.210 TCP_MISS/200 20304 GET http://us.archive.ubuntu.com/ubuntu/pool/universe/c/cowsay/cowsay_3.03+dfsg1-3_all.deb - DIRECT/91.189.91.13 application/x-debian-package

Both 192.168.1.220 & .210 contacted the server (.210 is the server, but also has squid-deb-proxy-client installed), but .210 received TCP_MISS/200, instead of being served the cached package.

From /var/log/squid-deb-proxy/store.log:

1368371692.721 RELEASE -1 FFFFFFFF 1255C76AE7E24BA02B4ABB6A3E4AB535  200 1368371672 1293023126        -1 application/x-debian-package 19904/19904 GET http://us.archive.ubuntu.com/ubuntu/pool/universe/c/cowsay/cowsay_3.03+dfsg1-3_all.deb
1368371721.534 RELEASE -1 FFFFFFFF 3534FA3574ED95020E8C960C75129676  200 1368371700 1293023126        -1 application/x-debian-package 19904/19904 GET http://us.archive.ubuntu.com/ubuntu/pool/universe/c/cowsay/cowsay_3.03+dfsg1-3_all.deb

If I'm reading the store.log right, squid cached two copies of the exact same file. (I used cowsay to test; much larger files, like linux-headers-* also were never cached.)

The only changes from the default squid-deb-proxy.conf were to enable mirrors:

81,82c81,82
< http_access deny !to_ubuntu_mirrors
< #http_access allow !to_ubuntu_mirrors
---
> #http_access deny !to_ubuntu_mirrors
> http_access allow !to_ubuntu_mirrors
86,87c86,87
< cache deny !to_ubuntu_mirrors
< #cache allow !to_ubuntu_mirrors
---
> #cache deny !to_ubuntu_mirrors
> cache allow !to_ubuntu_mirrors

Lastly, the only errors I have seen in squid-specific logs are:

$ sudo cat /var/log/upstart/squid-deb-proxy.log.1
2013/05/09 09:27:05| Warning: empty ACL: acl blockedpkgs urlpath_regex "/etc/squid-deb-proxy/autogenerated/pkg-blacklist-regexp.acl"
2013/05/09 09:27:05| WARNING: (B) '::/0' is a subnetwork of (A) '::/0'
2013/05/09 09:27:05| WARNING: because of this '::/0' is ignored to keep splay tree searching predictable
2013/05/09 09:27:05| WARNING: You should probably remove '::/0' from the ACL named 'all'

Given that the clients are correctly contacting the server's proxy, why won't squid cache & return the packages?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

After starting from scratch (purging & re-installing), I finally discovered the problem.

The changes to squid-deb-proxy.conf (which I thought enabled mirrors) were the culprits.

I don't understand the comments in the file, like: "# uncomment the third and fouth line to permit any unlisted domain". There are only two lines underneath that comment, and uncommenting both lines would seem (to someone unversed in squid's configuration syntax) to negate each other. Reversing the options (commenting out the originally uncommented one, and activating the originally commented one) obviously did not work.

One other point: the autogenerated files are sensitive to backup files in the *.d/ directories. I noticed that /etc/squid-deb-proxy/autogenerated/mirror-dstdomain.acl had the contents of both mirror-dstdomain.acl.d/10-default and mirror-dstdomain.acl.d/10-default~ in it.

share|improve this answer
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.