rgeissert / http-redirector

Debian mirrors HTTP redirector
http://httpredir.debian.org/
88 stars 8 forks source link

301 redirection issue #53

Closed renard closed 10 years ago

renard commented 10 years ago

Hi use http://http.debian.net as an archive mirror. I configured my source.list according the docs to:

deb http://http.debian.net/debian-archive/debian lenny main contrib non-free

The result of apt-get update is:

Ign http://http.debian.net lenny Release.gpg
Ign http://http.debian.net lenny Release
Ign http://http.debian.net lenny/main Packages
Ign http://http.debian.net lenny/contrib Packages
Ign http://http.debian.net lenny/non-free Packages
Ign http://http.debian.net lenny/main Packages
Ign http://http.debian.net lenny/contrib Packages
Ign http://http.debian.net lenny/non-free Packages
Err http://http.debian.net lenny/main Packages
  301 Moved Permanently [IP: 46.4.205.44 80]
Err http://http.debian.net lenny/contrib Packages
  301 Moved Permanently [IP: 46.4.205.44 80]
Err http://http.debian.net lenny/non-free Packages
  301 Moved Permanently [IP: 46.4.205.44 80]
W: Failed to fetch http://http.debian.net/debian-archive/debian/dists/lenny/main/binary-amd64/Packages  301 Moved Permanently [IP: 46.4.205.44 80]

W: Failed to fetch http://http.debian.net/debian-archive/debian/dists/lenny/contrib/binary-amd64/Packages  301 Moved Permanently [IP: 46.4.205.44 80]

W: Failed to fetch http://http.debian.net/debian-archive/debian/dists/lenny/non-free/binary-amd64/Packages  301 Moved Permanently [IP: 46.4.205.44 80]

E: Some index files failed to download, they have been ignored, or old ones used instead.

If I change my source.list to

deb http://debian.mirror.cambrium.nl/debian-archive/debian lenny main contrib non-free

The result is correct:

Hit http://debian.mirror.cambrium.nl lenny Release.gpg
Hit http://debian.mirror.cambrium.nl lenny Release
Ign http://debian.mirror.cambrium.nl lenny/main Packages/DiffIndex
Ign http://debian.mirror.cambrium.nl lenny/contrib Packages/DiffIndex
Ign http://debian.mirror.cambrium.nl lenny/non-free Packages/DiffIndex
Hit http://debian.mirror.cambrium.nl lenny/main Packages
Hit http://debian.mirror.cambrium.nl lenny/contrib Packages
Hit http://debian.mirror.cambrium.nl lenny/non-free Packages
Reading package lists… Done

I guess this is because the Packages file doesn't exist anymore for old archive distribution, thus apt only gets a 301 redirection and does not handle correctly the 404 afterwards.

rgeissert commented 10 years ago

Actually, the problem is that lenny's apt didn't support redirections. You can still use httpdn with a lenny (or older) install if you put in front a proxy that resolves the redirections for it.