--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: apt: inconsistent exit code from "apt(-get) update" on network error
- From: Tom GL <tom.gl@free.fr>
- Date: Thu, 12 Mar 2020 15:56:47 +0100
- Message-id: <7994563f-54f2-a006-4f1f-d214c2f48f83@free.fr>
Package: apt
Version: 2.0.0
Severity: minor
In case of some network issue which prevent updating package indexes,
"apt(-get) update" will sometime exit with code 0 and warning message,
and sometime with exit code 100 and an error message.
I don't really mind if it's a warning or an error in the end (for my use
case, it's an error, but I can grep for the warning message and treat it
as an error myself), but this slight inconsistency in the exit code
sounds like a (minor) bug.
Here is my test case: I build an up-to-date Debian Sid Docker image,
which includes apt 2.0.0, and I run it with the network interface turned
off.
Depending on the specific $http_proxy value I pass, "apt-get update"
will exit either 0 or 100.
$ cat Dockerfile
FROM debian:sid
RUN apt-get update && apt-get -y dist-upgrade -V
$ docker build -t debian:sid-apt-2.0 .
$ docker run --rm --cap-add=NET_ADMIN -i \
-e http_proxy=http://1.2.3.4:1234 \
debian:sid-apt-2.0 \
<<<'ip link set eth0 down ; apt-get update ; echo $?'
Ign:1 http://deb.debian.org/debian sid InRelease
Err:2 http://deb.debian.org/debian sid Release
Cannot initiate the connection to 1.2.3.4:1234 (1.2.3.4). - connect
(101: Network is unreachable)
Reading package lists...
E: The repository 'http://deb.debian.org/debian sid Release' does not
have a Release file.
100
$ docker run --rm --cap-add=NET_ADMIN -i \
-e http_proxy=http://wherever:1234 \
debian:sid-apt-2.0 \
<<<'ip link set eth0 down ; apt-get update ; echo $?'
Err:1 http://deb.debian.org/debian sid InRelease
Temporary failure resolving 'wherever'
Reading package lists...
W: Failed to fetch http://deb.debian.org/debian/dists/sid/InRelease
Temporary failure resolving 'wherever'
W: Some index files failed to download. They have been ignored, or old
ones used instead.
0
$ docker run --rm --cap-add=NET_ADMIN -i \
debian:sid-apt-2.0 \
<<<'ip link set eth0 down ; apt-get update ; echo $?'
Err:1 http://deb.debian.org/debian sid InRelease
Temporary failure resolving 'deb.debian.org'
Reading package lists...
W: Failed to fetch http://deb.debian.org/debian/dists/sid/InRelease
Temporary failure resolving 'deb.debian.org'
W: Some index files failed to download. They have been ignored, or old
ones used instead.
0
(and I get similar results if I use apt instead of apt-get)
-- Package-specific info:
-- apt-config dump --
APT "";
APT::Architecture "amd64";
APT::Build-Essential "";
APT::Build-Essential:: "build-essential";
APT::Install-Recommends "1";
APT::Install-Suggests "0";
APT::Sandbox "";
APT::Sandbox::User "_apt";
APT::NeverAutoRemove "";
APT::NeverAutoRemove:: "^firmware-linux.*";
APT::NeverAutoRemove:: "^linux-firmware$";
APT::NeverAutoRemove:: "^linux-image-[a-z0-9]*$";
APT::NeverAutoRemove:: "^linux-image-[a-z0-9]*-[a-z0-9]*$";
APT::VersionedKernelPackages "";
APT::VersionedKernelPackages:: "linux-.*";
APT::VersionedKernelPackages:: "kfreebsd-.*";
APT::VersionedKernelPackages:: "gnumach-.*";
APT::VersionedKernelPackages:: ".*-modules";
APT::VersionedKernelPackages:: ".*-kernel";
APT::Never-MarkAuto-Sections "";
APT::Never-MarkAuto-Sections:: "metapackages";
APT::Never-MarkAuto-Sections:: "contrib/metapackages";
APT::Never-MarkAuto-Sections:: "non-free/metapackages";
APT::Never-MarkAuto-Sections:: "restricted/metapackages";
APT::Never-MarkAuto-Sections:: "universe/metapackages";
APT::Never-MarkAuto-Sections:: "multiverse/metapackages";
APT::Move-Autobit-Sections "";
APT::Move-Autobit-Sections:: "oldlibs";
APT::Move-Autobit-Sections:: "contrib/oldlibs";
APT::Move-Autobit-Sections:: "non-free/oldlibs";
APT::Move-Autobit-Sections:: "restricted/oldlibs";
APT::Move-Autobit-Sections:: "universe/oldlibs";
APT::Move-Autobit-Sections:: "multiverse/oldlibs";
APT::AutoRemove "";
APT::AutoRemove::SuggestsImportant "false";
APT::Update "";
APT::Update::Post-Invoke "";
APT::Update::Post-Invoke:: "rm -f /var/cache/apt/archives/*.deb
/var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true";
APT::Architectures "";
APT::Architectures:: "amd64";
APT::Compressor "";
APT::Compressor::. "";
APT::Compressor::.::Name ".";
APT::Compressor::.::Extension "";
APT::Compressor::.::Binary "";
APT::Compressor::.::Cost "0";
APT::Compressor::zstd "";
APT::Compressor::zstd::Name "zstd";
APT::Compressor::zstd::Extension ".zst";
APT::Compressor::zstd::Binary "false";
APT::Compressor::zstd::Cost "60";
APT::Compressor::lz4 "";
APT::Compressor::lz4::Name "lz4";
APT::Compressor::lz4::Extension ".lz4";
APT::Compressor::lz4::Binary "false";
APT::Compressor::lz4::Cost "50";
APT::Compressor::gzip "";
APT::Compressor::gzip::Name "gzip";
APT::Compressor::gzip::Extension ".gz";
APT::Compressor::gzip::Binary "gzip";
APT::Compressor::gzip::Cost "100";
APT::Compressor::gzip::CompressArg "";
APT::Compressor::gzip::CompressArg:: "-6n";
APT::Compressor::gzip::UncompressArg "";
APT::Compressor::gzip::UncompressArg:: "-d";
APT::Compressor::xz "";
APT::Compressor::xz::Name "xz";
APT::Compressor::xz::Extension ".xz";
APT::Compressor::xz::Binary "xz";
APT::Compressor::xz::Cost "200";
APT::Compressor::xz::CompressArg "";
APT::Compressor::xz::CompressArg:: "-6";
APT::Compressor::xz::UncompressArg "";
APT::Compressor::xz::UncompressArg:: "-d";
APT::Compressor::bzip2 "";
APT::Compressor::bzip2::Name "bzip2";
APT::Compressor::bzip2::Extension ".bz2";
APT::Compressor::bzip2::Binary "bzip2";
APT::Compressor::bzip2::Cost "300";
APT::Compressor::bzip2::CompressArg "";
APT::Compressor::bzip2::CompressArg:: "-6";
APT::Compressor::bzip2::UncompressArg "";
APT::Compressor::bzip2::UncompressArg:: "-d";
APT::Compressor::lzma "";
APT::Compressor::lzma::Name "lzma";
APT::Compressor::lzma::Extension ".lzma";
APT::Compressor::lzma::Binary "xz";
APT::Compressor::lzma::Cost "400";
APT::Compressor::lzma::CompressArg "";
APT::Compressor::lzma::CompressArg:: "--format=lzma";
APT::Compressor::lzma::CompressArg:: "-6";
APT::Compressor::lzma::UncompressArg "";
APT::Compressor::lzma::UncompressArg:: "--format=lzma";
APT::Compressor::lzma::UncompressArg:: "-d";
Dir "/";
Dir::State "var/lib/apt";
Dir::State::lists "lists/";
Dir::State::cdroms "cdroms.list";
Dir::State::extended_states "extended_states";
Dir::State::status "/var/lib/dpkg/status";
Dir::Cache "var/cache/apt";
Dir::Cache::archives "archives/";
Dir::Cache::srcpkgcache "";
Dir::Cache::pkgcache "";
Dir::Etc "etc/apt";
Dir::Etc::sourcelist "sources.list";
Dir::Etc::sourceparts "sources.list.d";
Dir::Etc::main "apt.conf";
Dir::Etc::netrc "auth.conf";
Dir::Etc::netrcparts "auth.conf.d";
Dir::Etc::parts "apt.conf.d";
Dir::Etc::preferences "preferences";
Dir::Etc::preferencesparts "preferences.d";
Dir::Etc::trusted "trusted.gpg";
Dir::Etc::trustedparts "trusted.gpg.d";
Dir::Bin "";
Dir::Bin::methods "/usr/lib/apt/methods";
Dir::Bin::solvers "";
Dir::Bin::solvers:: "/usr/lib/apt/solvers";
Dir::Bin::planners "";
Dir::Bin::planners:: "/usr/lib/apt/planners";
Dir::Bin::dpkg "/usr/bin/dpkg";
Dir::Bin::gzip "/bin/gzip";
Dir::Bin::bzip2 "/bin/bzip2";
Dir::Bin::xz "/usr/bin/xz";
Dir::Bin::lz4 "/usr/bin/lz4";
Dir::Bin::zstd "/usr/bin/zstd";
Dir::Bin::lzma "/usr/bin/xz";
Dir::Media "";
Dir::Media::MountPath "/media/apt";
Dir::Log "var/log/apt";
Dir::Log::Terminal "term.log";
Dir::Log::History "history.log";
Dir::Log::Planner "eipp.log.xz";
Dir::Ignore-Files-Silently "";
Dir::Ignore-Files-Silently:: "~$";
Dir::Ignore-Files-Silently:: "\.disabled$";
Dir::Ignore-Files-Silently:: "\.bak$";
Dir::Ignore-Files-Silently:: "\.dpkg-[a-z]+$";
Dir::Ignore-Files-Silently:: "\.ucf-[a-z]+$";
Dir::Ignore-Files-Silently:: "\.save$";
Dir::Ignore-Files-Silently:: "\.orig$";
Dir::Ignore-Files-Silently:: "\.distUpgrade$";
Acquire "";
Acquire::AllowInsecureRepositories "0";
Acquire::AllowWeakRepositories "0";
Acquire::AllowDowngradeToInsecureRepositories "0";
Acquire::cdrom "";
Acquire::cdrom::mount "/media/cdrom/";
Acquire::IndexTargets "";
Acquire::IndexTargets::deb "";
Acquire::IndexTargets::deb::Packages "";
Acquire::IndexTargets::deb::Packages::MetaKey
"$(COMPONENT)/binary-$(ARCHITECTURE)/Packages";
Acquire::IndexTargets::deb::Packages::flatMetaKey "Packages";
Acquire::IndexTargets::deb::Packages::ShortDescription "Packages";
Acquire::IndexTargets::deb::Packages::Description
"$(RELEASE)/$(COMPONENT) $(ARCHITECTURE) Packages";
Acquire::IndexTargets::deb::Packages::flatDescription "$(RELEASE) Packages";
Acquire::IndexTargets::deb::Packages::Optional "0";
Acquire::IndexTargets::deb::Translations "";
Acquire::IndexTargets::deb::Translations::MetaKey
"$(COMPONENT)/i18n/Translation-$(LANGUAGE)";
Acquire::IndexTargets::deb::Translations::flatMetaKey "$(LANGUAGE)";
Acquire::IndexTargets::deb::Translations::ShortDescription
"Translation-$(LANGUAGE)";
Acquire::IndexTargets::deb::Translations::Description
"$(RELEASE)/$(COMPONENT) Translation-$(LANGUAGE)";
Acquire::IndexTargets::deb::Translations::flatDescription "$(RELEASE)
Translation-$(LANGUAGE)";
Acquire::IndexTargets::deb-src "";
Acquire::IndexTargets::deb-src::Sources "";
Acquire::IndexTargets::deb-src::Sources::MetaKey
"$(COMPONENT)/source/Sources";
Acquire::IndexTargets::deb-src::Sources::flatMetaKey "Sources";
Acquire::IndexTargets::deb-src::Sources::ShortDescription "Sources";
Acquire::IndexTargets::deb-src::Sources::Description
"$(RELEASE)/$(COMPONENT) Sources";
Acquire::IndexTargets::deb-src::Sources::flatDescription "$(RELEASE)
Sources";
Acquire::IndexTargets::deb-src::Sources::Optional "0";
Acquire::Changelogs "";
Acquire::Changelogs::URI "";
Acquire::Changelogs::URI::Origin "";
Acquire::Changelogs::URI::Origin::Debian
"https://metadata.ftp-master.debian.org/changelogs/@CHANGEPATH@_changelog";
Acquire::Changelogs::URI::Origin::Ubuntu
"https://changelogs.ubuntu.com/changelogs/pool/@CHANGEPATH@/changelog";
Acquire::Changelogs::AlwaysOnline "";
Acquire::Changelogs::AlwaysOnline::Origin "";
Acquire::Changelogs::AlwaysOnline::Origin::Ubuntu "1";
Acquire::GzipIndexes "true";
Acquire::Languages "";
Acquire::Languages:: "none";
Acquire::CompressionTypes "";
Acquire::CompressionTypes::xz "xz";
Acquire::CompressionTypes::bz2 "bzip2";
Acquire::CompressionTypes::lzma "lzma";
Acquire::CompressionTypes::gz "gzip";
Acquire::CompressionTypes::lz4 "lz4";
Acquire::CompressionTypes::zst "zstd";
DPkg "";
DPkg::Path "/usr/sbin:/usr/bin:/sbin:/bin";
DPkg::Pre-Install-Pkgs "";
DPkg::Pre-Install-Pkgs:: "/usr/sbin/dpkg-preconfigure --apt || true";
DPkg::Post-Invoke "";
DPkg::Post-Invoke:: "rm -f /var/cache/apt/archives/*.deb
/var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true";
Binary "apt-config";
Binary::apt "";
Binary::apt::APT "";
Binary::apt::APT::Color "1";
Binary::apt::APT::Cache "";
Binary::apt::APT::Cache::Show "";
Binary::apt::APT::Cache::Show::Version "2";
Binary::apt::APT::Cache::AllVersions "0";
Binary::apt::APT::Cache::ShowVirtuals "1";
Binary::apt::APT::Cache::Search "";
Binary::apt::APT::Cache::Search::Version "2";
Binary::apt::APT::Cache::ShowDependencyType "1";
Binary::apt::APT::Cache::ShowVersion "1";
Binary::apt::APT::Get "";
Binary::apt::APT::Get::Upgrade-Allow-New "1";
Binary::apt::APT::Get::Update "";
Binary::apt::APT::Get::Update::InteractiveReleaseInfoChanges "1";
Binary::apt::APT::Cmd "";
Binary::apt::APT::Cmd::Show-Update-Stats "1";
Binary::apt::APT::Cmd::Pattern-Only "1";
Binary::apt::APT::Keep-Downloaded-Packages "0";
Binary::apt::DPkg "";
Binary::apt::DPkg::Progress-Fancy "1";
Binary::apt::DPkg::Lock "";
Binary::apt::DPkg::Lock::Timeout "-1";
CommandLine "";
CommandLine::AsString "apt-config dump";
-- (no /etc/apt/preferences present) --
-- (no /etc/apt/preferences.d/* present) --
-- /etc/apt/sources.list --
# deb http://snapshot.debian.org/archive/debian/20200224T000000Z sid main
deb http://deb.debian.org/debian sid main
-- (no /etc/apt/sources.list.d/* present) --
-- System Information:
Debian Release: bullseye/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.4.0-148-generic (SMP w/4 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect
Versions of packages apt depends on:
ii adduser 3.118
ii debian-archive-keyring 2019.1
ii gpgv 2.2.19-1
ii libapt-pkg6.0 2.0.0
ii libc6 2.29-10
ii libgcc-s1 10-20200222-1
ii libgnutls30 3.6.12-2
ii libseccomp2 2.4.2-2
ii libstdc++6 10-20200222-1
Versions of packages apt recommends:
ii ca-certificates 20190110
Versions of packages apt suggests:
pn apt-doc <none>
pn aptitude | synaptic | wajig <none>
pn dpkg-dev <none>
pn gnupg | gnupg2 | gnupg1 <none>
pn powermgmt-base <none>
-- no debconf information
--- End Message ---
--- Begin Message ---
Source: apt
Source-Version: 2.1.16
Done: Julian Andres Klode <jak@debian.org>
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 594813@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Julian Andres Klode <jak@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: SHA512
Format: 1.8
Date: Fri, 08 Jan 2021 21:49:15 +0100
Source: apt
Architecture: source
Version: 2.1.16
Distribution: unstable
Urgency: medium
Maintainer: APT Development Team <deity@lists.debian.org>
Changed-By: Julian Andres Klode <jak@debian.org>
Closes: 188161 211075 594813 649588 969932 973305
Changes:
apt (2.1.16) unstable; urgency=medium
.
[ Faidon Liambotis ]
* Various fixes to http and connect method
- basehttp: also consider Access when a Server's URI
- connect: convert a C-style string to std::string
- connect: use ServiceNameOrPort, not Port, as the cache key
.
[ Julian Andres Klode ]
* patterns: Add dependency patterns ?depends, ?conflicts, etc.
Note that the -broken- variants are not implemented yet.
* Rewrite of the kernel autoremoval code:
- Determine autoremovable kernels at run-time (LP: #1615381), this fixes the
issue where apt could consider a running kernel autoremovable
- Automatically remove unused kernels on apt {full,dist}-upgrade.
This helps ensuring that we don't run out of /boot space.
- Only keep up to 3 (not 4) kernels.
Ubuntu boot partitions were sized for 3 kernels, not 4.
* Bump codenames to bullseye/hirsute and adjust -security codename for
bullseye (Closes: #969932)
* Ignore failures from immediate configuration. This does not change the
actual installation ordering - we never passed the return code to the
caller and installation went underway anyway if it could be ordered at a
later stage, this just removes spurious after-the-fact errors.
(Closes: #973305, #188161, #211075, #649588) (LP: #1871268)
* Add support for Phased-Update-Percentage, previously used only by
update-manager.
* Implement update --error-on=any so that scripts can reliably check for
transient failures as well. (Closes: #594813)
.
[ Demi M. Obenour ]
* test/integration/framework: Be compatible with Bash
.
[ Vangelis Skarmoutsos ]
* Greek program translation update
Checksums-Sha1:
36c442af8f390f912d5708a7bc160b1ed8caef0d 2784 apt_2.1.16.dsc
75b426e31453b8af90a9557b0f9c9c3e03e1fdf5 2191892 apt_2.1.16.tar.xz
409320f90a5e88b25f108aecfba553cff020f703 7500 apt_2.1.16_source.buildinfo
Checksums-Sha256:
bfd7131905a3037a6283e44046ff995cd8a29f27ebd64b24022c23ee5db9a658 2784 apt_2.1.16.dsc
32ab26926b05dd15ed09b5b844eb7c780ae5c9c62e6bf7cf8e4333f5e25fb4a8 2191892 apt_2.1.16.tar.xz
7f12ff6faffade64be0779fc946159389241f4f5f85f4bcff176d6a94faedbdc 7500 apt_2.1.16_source.buildinfo
Files:
c1d0b94a337d210841e2483183410c3e 2784 admin important apt_2.1.16.dsc
aa52ed26ee2e74b823fd8e2825b9e76d 2191892 admin important apt_2.1.16.tar.xz
68fab02971bb43edcb7422391421160e 7500 admin important apt_2.1.16_source.buildinfo
-----BEGIN PGP SIGNATURE-----
iQJDBAEBCgAtFiEET7WIqEwt3nmnTHeHb6RY3R2wP3EFAl/4z44PHGpha0BkZWJp
YW4ub3JnAAoJEG+kWN0dsD9xqqMP/1zfNKKDO/zhs0VATzCM6PIy7btd8ZhSyTCI
Eo4bPcA5S3vSvb6arr+qvE8Hiox3FiGPzkd1zL3m9VaCol0dR5OBEMgr/l5gzX6s
8MXMEoeCkALK3UN9b456/+RH1Av/GJWnEqrFQoJQaeHRisJFjPxFP2yjkYI2ixOM
yOzKIVjRdkV5euDhA/TpTHKtKl63q0yQE5yfIoGwnIKb9vcCzZ+MrdLep6hCSRc9
hXjy/+5OyAWDktlP9odYgSrTefocjSoD9OrNEZut/h+0Xz2lhVyh0kA+ubeH5s7j
nue0uKc4QssZz15yZGVyup0ZxGenUZf0AUwSegXKu3Ui0GY6vt+4fh1wtxeLVJiP
gwja2F63SDQDYWNf08Y2FC20x1xpf1ogC5dNDtP6+jbw/XHtk0CZj+ES9ky5qUdL
o0iq1IdpdY+Kxi6koL2vfT70jwL7ZW+QTbnKdYL2MGhZMgK8YdFK28x98BYrP+oY
RD23tUum57RSOkokKJPqRaoHkiqcnrXwQ1lYdRLHkmfFwRTc9f2QJEhQTREsCFbq
IUrnagYZB+Pi9T7wEzqcdw3to1AowU9hzkYqGimRqKNqxC0ZiHkFF7HmIDdVBJbQ
3OSCFcnDbxwlFxp0l7HfI3u+aZSFUNS3vIMsI9GuCybmvydmkEI8ry+vjwfGtmfN
TtWcmhk/
=dOI/
-----END PGP SIGNATURE-----
--- End Message ---