Non-existent i18n files lead to needless server failover

Bug #366293 reported by Daniel Richard G.
10
Affects Status Importance Assigned to Milestone
apt-cacher (Debian)
Fix Released
Unknown
apt-cacher (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: apt-cacher

I have an apt-cacher setup in which the main path_map element lists two servers, in the following order:

    ubuntu.media.mit.edu/ubuntu
    us.archive.ubuntu.com/ubuntu

I.e. a random mirror server, and the official Ubuntu US archive server.

Yesterday (April 23), I invoked "apt-get update" on a system pointed at this apt-cacher server, and inexplicably, it hung while downloading the first Translation-en_US.bz2 file. Run the update again, another hang at that same point.

Half an hour of investigation later, I found the problem. There are two things going on here:

1. There is no Translation-en_US file. It is not present (e.g. for the Jaunty main repository) in either of

    http://ubuntu.media.mit.edu/ubuntu/dists/jaunty/main/i18n/
    http://us.archive.ubuntu.com/ubuntu/dists/jaunty/main/i18n/

apt-cacher fails to find the file at the first location, so it tries the second one, and when that turns up nothing it gives up (and so does apt-get, continuing on to the next file).

2. The US archive server is, of course, being completely hammered by the release of Jaunty on the 23rd. It is taking an unusually long time to respond to even minor HTTP requests.

Indeed, if I run "apt-get update" with LANG=C, then no i18n files are downloaded, and the whole update procedure breezes through like it usually does.

So it seems to me that this is a corner case that apt-cacher ought to handle more gracefully. There was no need for apt-get to hang while updating; no need for apt-cacher to fail over to another server for a file that need not exist (as opposed to, say, a package file, whose non-existence would necessarily be an error). Addressing this behavior would not only make updating on release day feasible, it would also make updating on other days faster, and reduce 404s on the archive server, as the needless failover could be avoided altogether.

Revision history for this message
Mary Gardiner (puzzlement) wrote :

I can't tell if these are exactly the same, but this sounds similar to Debian bug 517761: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=517761

Revision history for this message
Mary Gardiner (puzzlement) wrote :

I converted the patch from Debian bug 517761 to apply against Jaunty's apt-cacher, but unfortunately it doesn't seem to fix this problem, at least not if I'm experiencing the same thing.

Revision history for this message
Daniel Richard G. (skunk) wrote :

Hmm... I don't think this is the same bug. Given the "Connection reset by peer" errors in the Debian bug, and the maintainer's trouble in reproducing it, it looks like more of a network-fault kind of issue. This bug is getting at a problem with the program's behavior as intended.

Revision history for this message
Lucas Albers (lalbers) wrote :

I think this is the bug:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=517761

and for 1.6.7 applying this patch:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=517761#54

made it to work the clients I tested it against, which were:

hardy, intrepid, jaunty desktop versions.

Revision history for this message
Lucas Albers (lalbers) wrote :

It looks like it is trying to grab files that don't exist on the repository.
the behavior is different if you are using synaptic versus aptitude from the command line.

Revision history for this message
Lucas Albers (lalbers) wrote :

Just to to be explicit, I get failures on the client when running against apt-cacher 1.6.7. , I am not experiencing failover, as I only have a single apt-cacher.

Revision history for this message
Daniel Richard G. (skunk) wrote :

Revisiting this problem again, I'm now seeing the same error as in the Debian bug report:

(This is with apt 0.7.20.2ubuntu6 and apt-cacher 1.6.8)

--------8<--------
# apt-get update
Hit http://ubuntu.apt-cacher.local jaunty Release.gpg
Ign http://ubuntu.apt-cacher.local jaunty/main Translation-en_US
Err http://ubuntu.apt-cacher.local jaunty/restricted Translation-en_US
  Error reading from server - read (104 Connection reset by peer)
Ign http://ubuntu.apt-cacher.local jaunty/universe Translation-en_US
Err http://ubuntu.apt-cacher.local jaunty/multiverse Translation-en_US
  Error reading from server - read (104 Connection reset by peer)
Get:1 http://ubuntu.apt-cacher.local jaunty-updates Release.gpg [189B]
Ign http://ubuntu.apt-cacher.local jaunty-updates/main Translation-en_US
Err http://ubuntu.apt-cacher.local jaunty-updates/restricted Translation-en_US
  Error reading from server - read (104 Connection reset by peer)
[...]
Fetched 510kB in 42s (11.9kB/s)
W: Failed to fetch http://ubuntu.apt-cacher.local/ubuntu/dists/jaunty/restricted/i18n/Translation-en_US.bz2 Error reading from server - read (104 Connection reset by peer)

W: Failed to fetch http://ubuntu.apt-cacher.local/ubuntu/dists/jaunty/multiverse/i18n/Translation-en_US.bz2 Error reading from server - read (104 Connection reset by peer)
[...]
-------->8--------

I don't remember what was the exact error I was seeing before (it was something that looked less like a network issue). Mary, please scratch what I said earlier---this appears to be the same issue as the Debian bug.

Revision history for this message
Daniel Richard G. (skunk) wrote :

I've managed to track down the bug, and have put together a (preliminary) patch fix. Details at the Debian BTS:

    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=517761#69

Changed in apt-cacher (Debian):
status: Unknown → Fix Committed
Changed in apt-cacher (Debian):
status: Fix Committed → Fix Released
Revision history for this message
Stefano Rivera (stefanor) wrote :

Should be fixed by apt-cacher 1.7.1, just synced into precise.

Changed in apt-cacher (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.