apt should honor http 302 (was: http 302 status reported as error)

Bug #184354 reported by MichaelRasmussen
6
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Binary package hint: update-manager

adept_updater launches Distribution Upgrade tool for "Upgrading Kubuntu to Version 7.10" During the Preparing the upgrade step it reports "Errror during update A problem occured during the update. This is usually some sort of network problem, please check your network connection and retry."

The listed errors are:
Failed to fetch http://medibuntu.sos-sts.com/repo/dists/feisty/free/binary-i386/Packages.gz 302 Found
Failed to fetch http://medibuntu.sos-sts.com/repo/dists/feisty/non-free/binary-i386/Packages.gz 302 Found
Failed to fetch http://medibuntu.sos-sts.com/repo/dists/feisty/free/source/Sources.gz 302 Found
Failed to fetch http://medibuntu.sos-sts.com/repo/dists/feisty/non-free/source/Sources.gz 302 Found

302 responses are http temporary redirects, the Distribution upgrade tool should fetch the package from the redirected location and go on its way. There is no error to present to the user.

After closing the error dialog, the program exits. The 302 responses are preventing a successful upgrade.

Michael Vogt (mvo)
Changed in update-manager:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Gary Shi (garyshi) wrote :

This bug is a major problem for our situation. I'm from Shanghai Linux User Group of China, we're the maintainer of China's formal ubuntu mirror (cn.archive.ubuntu.com), and an important debian mirror (still not formal, but might be if we can overcome the bandwidth problem). But bandwidth is expensive here, and we SHLUG don't have a lot of money to buy enough bandwidth for whole China's ubuntu and debian user. So we're proposing a distributed architecture, to make use of idle bandwidth from servers of our friends/companies. We plan to serve meta files directly from our primary server, and forward request to deb packages to other servers with HTTP 302 reply. So we have to get this bug fixed.

I made a patch for apt-0.7.6ubuntu14.1 to handle this problem, it's a little tricky because:
1. the original code doesn't contain logic for redirection, so I added a redirection loop in HttpMethod::Loop;
2. the protocol between apt and methods/http requires the URI returned must be the same as the requested, so I have to cheat apt about the actual URI.

The patch also contains some debug info (to /tmp/apt-http.log), and the indentation is optimized for "diff" purpose.

Revision history for this message
Zhichang Yu (yuzhichang) wrote :

Apt in Ubuntu 9.04 has fixed this BUG. See http://bazaar.launchpad.net/~ubuntu-core-dev/apt/ubuntu/revision/1688.
This ticket should be closed.

Revision history for this message
Julian Andres Klode (juliank) wrote :

Closed as it has been fixed as mentioned in previous comment.

Changed in apt (Ubuntu):
status: Confirmed → 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.