[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#290694: apt-move broken due to inability of apt-get to handle chunked encoding...



For several releases of mozilla-firefox (to be precise once when mozilla-firefox_1.0.6-1 => -2 was released, once for 2 => 3, and finally this week 3 => 4) apt-move always fails to perform update, saying that mozilla-firefox's MD5Sum is invalid, and that HTTP headers are too complicated to understand them correctly on next file downloaded after mozilla-firefox_1.0.6.orig.tar.gz.

Problem is that apt-get uses rather questionable approach to truncate last byte from file it has locally and then ask server for this last byte. And for mozilla-firefox_1.0.6_orig.tar.gz last byte is CR - \r. This confuses apt-get's parser a lot, and it just skips '\r' of content. Instead it believes that 'H' from HTTP is payload, and it does have no idea what to do with 'TTP/1.1 ...' from next response:

HTTP/1.1 206 Partial Content\r\n
Date: Sat, 10 Sep 2005 02:17:15 GMT\r\n
Server: Apache/1.3.33 (Debian GNU/Linux)\r\n
Last-Modified: Wed, 20 Jul 2005 16:17:47 GMT\r\n
ETag: \"4100fe-2659f1e-42de792b\"\r\n
Accept-Ranges: bytes\r\n
Content-Length: 1\r\n
Content-Range: bytes 40214301-40214301/40214302\r\n
Keep-Alive: timeout=15, max=96\r\nConnection: Keep-Alive\r\n
Content-Type: application/x-tar\r\n
Content-Encoding: x-gzip\r\n
\r\n
\r
HTTP/1.1 206 Partial Content\r\n

Due to this it appends 'H' at the end of (previously completely valid) mozilla-firefox tarball, and immediately fails as md5sum does not match.

ppc:/usr/src/linus# apt-move sync

Updating from local Packages files...

Syncing mirror...
Reading package lists... Done
Building dependency tree... Done

Moving files...
Skipping files:
/var/cache/apt/archives/libgnome-perl_0.7009-4_i386.deb
/var/cache/apt/archives/libgtk-imlib-perl_0.7009-4_i386.deb
/var/cache/apt/archives/libgtk-perl_0.7009-4_i386.deb
/var/cache/apt/archives/libgtk-pixbuf-perl_0.7009-4_i386.deb
/var/cache/apt/archives/libswt-gtk-3.1-java_3.0+3.1M4-5_all.deb
/var/cache/apt/archives/libswt-gtk-3.1-jni_3.0+3.1M4-5_i386.deb
Moving Files:
Reading package lists... Done
Building dependency tree... Done
Need to get 44.3MB/45.2MB of source archives.
Get:1 http://ftp.nerim.net unstable/main ffmpeg 3:20050427-0sarge0.1 (dsc) [865B
]
Get:2 http://ftp.nerim.net unstable/main ffmpeg 3:20050427-0sarge0.1 (tar) [2338
kB]
Get:3 http://ftp.nerim.net unstable/main ffmpeg 3:20050427-0sarge0.1 (diff) [787
8B]
Get:4 http://ftp.debian.org sid/main libgtk-perl 0.7009-5 (dsc) [994B]
Get:5 http://ftp.debian.org sid/main libgtk-perl 0.7009-5 (tar) [447kB]
Get:6 http://ftp.debian.org sid/main libgtk-perl 0.7009-5 (diff) [113kB]
Get:7 http://ftp.debian.org sid/main mozilla-firefox 1.0.6-4 (dsc) [972B]
Get:8 http://ftp.debian.org sid/main mozilla-firefox 1.0.6-4 (tar) [40.2MB]
Err http://ftp.debian.org sid/main mozilla-firefox 1.0.6-4 (diff)
  0 Partial Content
Get:9 http://ftp.debian.org sid/main swt-gtk 3.1-1 (dsc) [785B]
Get:10 http://ftp.debian.org sid/main swt-gtk 3.1-1 (tar) [880kB]
Get:11 http://ftp.debian.org sid/main swt-gtk 3.1-1 (diff) [24.0kB]
Fetched 10B in 5s (2B/s)
Failed to fetch http://ftp.debian.org/debian/pool/main/m/mozilla-firefox/mozilla
-firefox_1.0.6.orig.tar.gz  MD5Sum mismatch
Failed to fetch http://ftp.debian.org/debian/pool/main/m/mozilla-firefox/mozilla
-firefox_1.0.6-4.diff.gz  0 Partial Content
E: Failed to fetch some archives.
Unknown error: runsync: 123.
ppc:/usr/src/linus#


Once I applied Geller Sandor's patch (thanks Sandor) from bug 290694 to apt-get 0.6.41, everything seems to be happy and apt-move does its job without complaining about invalid md5sums. So it would be great if that patch could be applied to the apt. Or some other equivalent to unbreak apt-get when it meets \r or \n at the beginning of the data payload.
					Thanks,
						Petr Vandrovec




Reply to: