--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: apt: HTTP 406 Not Acceptable with alternates breaks update
- From: "Dominik Schulz \(tex\)" <lkml@ds.gauner.org>
- Date: Mon, 03 Jun 2013 17:53:11 +0200
- Message-id: <20130603155311.15655.28844.reportbug@msmagic>
Package: apt
Version: 0.8.16~exp12ubuntu10.10
Severity: normal
Tags: patch
apt-get update breaks when the server replies with a "HTTP/1.1 406 Not
Acceptable" to a Range/If-Range request.
The proper solution would be to handle the Alternates header in the
response but as this would introduce a lot of additional complexity
the attached patch offers a option to disable Range requests instead.
Please consider applying the patch.
-- Package-specific info:
-- (no /etc/apt/preferences present) --
-- (/etc/apt/sources.list present, but not submitted) --
-- System Information:
Debian Release: wheezy/sid
APT prefers precise-updates
APT policy: (500, 'precise-updates'), (500, 'precise-security'), (500, 'precise'), (100, 'precise-backports')
Architecture: amd64 (x86_64)
Kernel: Linux 3.2.0-29-generic (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages apt depends on:
ii dpkg 1.16.1.2ubuntu7.1
ii gnupg 1.4.11-3ubuntu2.2
ii libapt-pkg4.12 0.8.16~exp12ubuntu10.10
ii libc6 2.15-0ubuntu10.4
ii libgcc1 1:4.6.3-1ubuntu5
ii libstdc++6 4.6.3-1ubuntu5
ii ubuntu-keyring 2011.11.21.1
apt recommends no packages.
Versions of packages apt suggests:
ii apt-doc <none>
ii aptitude 0.6.6-1ubuntu1.2
ii bzip2 1.0.6-1
ii dpkg-dev 1.16.1.2ubuntu7.1
ii python-apt 0.8.3ubuntu7.1
ii xz-lzma [lzma] 5.1.1alpha+20110809-3
-- no debconf information
>From e44f7f4b889f8e0113ab1441fbb9c5bbf8a389bc Mon Sep 17 00:00:00 2001
From: Dominik Schulz <dominik.schulz@gauner.org>
Date: Mon, 3 Jun 2013 16:49:15 +0200
Subject: [PATCH] Add Acquire::http::SendRange option
This commit adds the option Acquire::http::SendRange which allows for
disabling sending of Range/If-Range headers. Support for these headers
is not fully implemented and may break the update process. By providing
this option the operator gains control over this behavior while
not changing any defaults for the majority of our users.
---
methods/http.cc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/methods/http.cc b/methods/http.cc
index db1085a..baaf7e9 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -740,7 +740,10 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out)
// Check for a partial file
struct stat SBuf;
- if (stat(Itm->DestFile.c_str(),&SBuf) >= 0 && SBuf.st_size > 0)
+ if (
+ _config->FindB("Acquire::http::SendRange", true) == true
+ && stat(Itm->DestFile.c_str(),&SBuf) >= 0 && SBuf.st_size > 0
+ )
{
// In this case we send an if-range query with a range header
sprintf(Buf,"Range: bytes=%lli-\r\nIf-Range: %s\r\n",(long long)SBuf.st_size - 1,
--
1.7.9.5
--- End Message ---
--- Begin Message ---
Source: apt
Source-Version: 0.9.7.9+deb7u7
We believe that the bug you reported is fixed in the latest version of
apt, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 710924@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Michael Vogt <mvo@debian.org> (supplier of updated apt package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Fri, 17 Oct 2014 09:03:58 +0200
Source: apt
Binary: apt libapt-pkg4.12 libapt-inst1.5 apt-doc libapt-pkg-dev libapt-pkg-doc apt-utils apt-transport-https
Architecture: source all amd64
Version: 0.9.7.9+deb7u7
Distribution: stable
Urgency: medium
Maintainer: APT Development Team <deity@lists.debian.org>
Changed-By: Michael Vogt <mvo@debian.org>
Description:
apt - commandline package manager
apt-doc - documentation for APT
apt-transport-https - https download transport for APT
apt-utils - package managment related utility programs
libapt-inst1.5 - deb package format runtime library
libapt-pkg-dev - development files for APT's libapt-pkg and libapt-inst
libapt-pkg-doc - documentation for APT development
libapt-pkg4.12 - package managment runtime library
Closes: 710924
Changes:
apt (0.9.7.9+deb7u7) stable; urgency=medium
.
[ David Kalnischkies ]
* methods/http.cc:
- retry without partial data after a 416 response (closes: 710924)
.
[ Michael Vogt ]
* debian/rules:
- add missing dh_clean
Checksums-Sha1:
787059eda61767b687d5bf3c67607c5a7b098551 2347 apt_0.9.7.9+deb7u7.dsc
d518942db16d2743c111c97c1621228db5a22618 3239065 apt_0.9.7.9+deb7u7.tar.gz
afe5329263da34bb229b8197ceef95ea5beec271 261908 apt-doc_0.9.7.9+deb7u7_all.deb
be92baf4cb9659ea01f62cd38dd0fc4af11325d0 963932 libapt-pkg-doc_0.9.7.9+deb7u7_all.deb
2a7879f9c1e224eb811a70f6acb768bcece3b8ff 891492 libapt-pkg4.12_0.9.7.9+deb7u7_amd64.deb
267d977bac7d15254e67660a91535a3a24b4b8e9 167048 libapt-inst1.5_0.9.7.9+deb7u7_amd64.deb
164396982f9a2887896dcc8f7af7bbbea07ab6df 1262138 apt_0.9.7.9+deb7u7_amd64.deb
1513189ab7c634e113f8333b908edb8bc5821fde 187440 libapt-pkg-dev_0.9.7.9+deb7u7_amd64.deb
db21527e94e2ed67776a917a7697d0f348aea9be 377948 apt-utils_0.9.7.9+deb7u7_amd64.deb
e3f294c095cea9e04b284d73e735126a9861d84e 109262 apt-transport-https_0.9.7.9+deb7u7_amd64.deb
Checksums-Sha256:
7835d9f97acf8adcad7eee0eca2990eaef72ffe21272302d3c36d8053d6baf82 2347 apt_0.9.7.9+deb7u7.dsc
16816387711ee428d94a940bd3223fb7149c39666dd1cdc9633fbfbbe8933cb8 3239065 apt_0.9.7.9+deb7u7.tar.gz
ed2b9ce68db86e907a546b94aa1959d8845180a01a10dbd3ca5de1f5ada7c973 261908 apt-doc_0.9.7.9+deb7u7_all.deb
dbcfab480d0f3b171b50f0acec8122e69e6a08d23486e263ad2b9048413d94b7 963932 libapt-pkg-doc_0.9.7.9+deb7u7_all.deb
85bd45d965efc10a57030be3503f5d3857e0dbd165e61a091f12c0965e98fe66 891492 libapt-pkg4.12_0.9.7.9+deb7u7_amd64.deb
39bb55d7b55a95cf23dfe6b062becaf2244b41206200a50eb650bc60e5fdb4cf 167048 libapt-inst1.5_0.9.7.9+deb7u7_amd64.deb
4958d74826d95a4b08f51a9010552e912c5c7066d48716b6f7ca681347a29294 1262138 apt_0.9.7.9+deb7u7_amd64.deb
c560dcc83961a0e371adfad007d9088ac9eb92ee4026a9d17d49608937c67026 187440 libapt-pkg-dev_0.9.7.9+deb7u7_amd64.deb
4da70f31433a4c6dd61113703bbd57319ee70ca126e41dca8745d37efc5c892f 377948 apt-utils_0.9.7.9+deb7u7_amd64.deb
b5b51a04959d8876c1963d089259342dcaf7df057e9031f0420fd28591252764 109262 apt-transport-https_0.9.7.9+deb7u7_amd64.deb
Files:
a17f8c3c250415515845cad32df7512d 2347 admin important apt_0.9.7.9+deb7u7.dsc
1335edd44c5c31a58d92f8184101b29b 3239065 admin important apt_0.9.7.9+deb7u7.tar.gz
eb12653f96041edb502c65b4d41b4922 261908 doc optional apt-doc_0.9.7.9+deb7u7_all.deb
828b4bd1eae39b82a75dc47fd1d2e3ab 963932 doc optional libapt-pkg-doc_0.9.7.9+deb7u7_all.deb
0b01a2d5627961128a61a45167c39e2a 891492 libs important libapt-pkg4.12_0.9.7.9+deb7u7_amd64.deb
636b072ed0e3696abeed1a681af7a5cb 167048 libs important libapt-inst1.5_0.9.7.9+deb7u7_amd64.deb
be1fdc55f2d897a391f527514e46ea93 1262138 admin important apt_0.9.7.9+deb7u7_amd64.deb
f230336bcb8baf674f1739dccd4f112d 187440 libdevel optional libapt-pkg-dev_0.9.7.9+deb7u7_amd64.deb
4003afc5261f319dd9223b2db71b2b5e 377948 admin important apt-utils_0.9.7.9+deb7u7_amd64.deb
b93e8396183252e8fea3f75d1b493425 109262 admin optional apt-transport-https_0.9.7.9+deb7u7_amd64.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAEBCAAGBQJUQMiQAAoJEJjKuzq9TKWeuCsQAKN+CM/JTO3ook3afoJQuXOL
+Gw3OICMunjiwAruhGkXJHkHmu/FGg1an6gM3WywDkrrML+rwzsHxTjij1meYmNn
+heCm+O4lxo0F7sbL9lyMTRagWLCSLzKohqPjCvM376H/NNzSEYJvitJl4X4fh1C
6sXKCs8sIMv3Sf4TGiUr3OrrxiJdd6q2R7Aut+ipLQYQysObQNVSTBkt216oZOoq
RwOqa/tsjtXUC7EOJbM1m5KdpnGKq1vIuZNE5Y6RgVho6EGFoQ6nkZ3+7gSDF0n7
0tUcmCicqe4xmVkBnaH+O21SIcq3PiG1iw4gbgpf8d1aUCfdR360o6dGmiNo0jbu
zBqfu78MaIb0dIxy3O3hXtvQz9iRZU4AVhppgbGM2ekv0CQ2lDcKSYt+7sgjTtDQ
9LTzlnYTqP5kX5PX9kLvx55WoJ0E4ELMvM8kc+NOZ/pV27GA8wf43W3ampA5ozG4
o4HPPNl4BCTDMdZfcaODreu/GgyFiBPllLyqMn4UhpYogZ2OjR/A3NnU0yfHvKuf
I4NtWLHB3jdJ0GheBjY5xiyWTNlbSYup0j523jBdBPjSjpOIWG9ofRuds9V5u5lj
d2yobuoiKjbB9VJIQYFair/ra1cdrzYqZxDO9tYA0quUQj9yvD+YOw34pHV5SV0K
2NfElgOPn3AG9Tp/N+6u
=0HgP
-----END PGP SIGNATURE-----
--- End Message ---