apt-cacher downloading packages from invalid proxy cache
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt-cacher (Ubuntu) |
Confirmed
|
Low
|
Unassigned |
Bug Description
Binary package hint: apt-cacher
Thanks for everyone involved in the apt-cacher product. It certainly is a huge bandwidth saver and is definitely the way to go when having multiple debian based servers and client machines in any organisation. I'm having problems today though whereby it seems that I'm getting an invalid or incomplete version of the latest thunderbird updates from transparent proxy servers out there on the internet and I'm trying to figure out how to handle this in a proper way in future. When doing the upgrade we get the following error:
# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
mozilla-
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 10.8MB/10.9MB of archives.
After unpacking 28.7kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://
Fetched 10.8MB in 0s (11.5MB/s)
Failed to fetch http://
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Client machine: Ubuntu 6.10 with kernel: 2.6.17-12-generic (We're having the same issues also with gutsy)
APT-CACHER server: Ubuntu 7.04 with kernel 2.6.20-15-server
When doing an md5sum of the thunderbird package on the apt-cacher server I do indeed get a different signature from the one in the package archives.
Actually there are two issues that I'm trying to address here:
1) How to clear the cached version of a invalid package on the apt-cacher repository
2) How to force a download on the client side without downloading from cache
The first issue I have dealt with by deleting the relevant header, private and package files in the /var/cache/
The 2nd issue I tried to deal with by specifying options to download files without caching as follows:
apt-get upgrade -o Acquire:
Debugging this with '-o Debug::
GET /apt-cacher/
Host: MYAPT.HOST.
Connection: keep-alive
Cache-Control: no-cache
Pragma: no-cache
User-Agent: Ubuntu APT-HTTP/1.3
Doing an ngrep on the apt-cacher server shows the request passed through to the proxy server as follows:
# ngrep -d eth0 -q -t -W byline -t '^(GET|PUT|POST) ' 'host MYAPT.HOST.IP'
interface: eth0 (##.###
filter: (ip or ip6) and ( host MYAPT.HOST.IP )
match: ^(GET|PUT|POST)
T 2007/10/24 13:55:52.226467 MY.CLIENT.IP:50530 -> MYAPT.HOST.IP:3142 [AP]
GET /apt-cacher/
Host: MYAPT.HOST.
Connection: keep-alive.
User-Agent: Ubuntu APT-HTTP/1.3.
.
T 2007/10/24 13:55:52.299239 MYAPT.HOST.IP:49303 -> MYPROXY.
GET http://
Keep-Alive: 300.
Connection: Keep-Alive.
Host: archive.ubuntu.com.
User-Agent: libwww-perl/5.805.
Clearly the Cache-Control and Pragma headers are not passed through to the proxy server. Doing a download via wget with the no-cache option bypasses the cache as expected and I get a proper download with the correct md5sum:
$ wget -c -S --no-cache http://
....
$ md5sum mozilla-
1d5f09005f41d82
Changed in apt-cacher: | |
importance: | Undecided → Low |
status: | New → Confirmed |
The following (perhaps temporary) fix forces the cache to refetch the object:
# diff -u /usr/share/ apt-cacher/ apt-cacher. orig /usr/share/ apt-cacher/ apt-cacher apt-cacher/ apt-cacher. orig 2007-10-24 14:57:12.000000000 +0200 apt-cacher/ apt-cacher 2007-10-24 14:48:10.000000000 +0200
--- /usr/share/
+++ /usr/share/
@@ -1587,7 +1587,7 @@
$response = $ua->head($url);
}
else {
- $response = $ua->get($url, ':content_cb' => \&get_callback, ':read_size_hint' => $getBufLen);
+ $response = $ua->get($url, ':content_cb' => \&get_callback, ':read_size_hint' => $getBufLen, 'Cache-Control' => 'no-cache', 'Pragma' => 'no-cache');
}
if( $do_hopping) {