apt should honor http 302 (was: http 302 status reported as error)
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://
Failed to fetch http://
Failed to fetch http://
Failed to fetch http://
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.
Changed in update-manager: | |
importance: | Undecided → Wishlist |
status: | New → Confirmed |
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.