apt-get update silently fails fetching security updates

Bug #1742695 reported by Roman Fiedler
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Triaged
Wishlist
Unassigned

Bug Description

On Ubuntu Xenial, apt-get fails silently when security update server cannot be reached. This state could be detected by scanning the apt-get output afterwards. But manually adding workarounds to each apt-get invocation in production automation is prone to error, thus leaving machines without security updates.

Expected behaviour (e.g.):
* 0 - all OK
* 1 - temporary failure (e.g. network)
* 2 - permanent failure

Test:
* Change your update server IP in /etc/hosts to something unreachable
* Run apt-get update (might take a while)
* Check exit status

$ lsb_release -r -d
Description: Ubuntu 16.04.3 LTS
Release: 16.04
rfiedler@n3ahit1403:~$

ii apt 1.2.24 amd64 commandline package manager

Revision history for this message
Julian Andres Klode (juliank) wrote :

Really? It should print that it could not reach the server. Transient errors like that are ignored success-state wise so you don't end up with tons of error messages when you are offline or your connection is broken. I want to rework this eventually to give more control on what constitutes an error, but that's a long way off.

Changed in apt (Ubuntu):
status: New → Incomplete
Revision history for this message
Roman Fiedler (roman-fiedler-deactivatedaccount) wrote :

Here the output:

# apt-get update
....
Err:3 http://mirror.[domain]/ubuntu xenial-security InRelease
  Unable to connect to mirror.[domain]:80:
Reading package lists... Done
...
W: Failed to fetch http://mirror.[domain]/ubuntu/dists/xenial-security/InRelease Unable to connect to mirror.[domain]:80:
W: Some index files failed to download. They have been ignored, or old ones used instead.
# echo $?
0

Revision history for this message
Roman Fiedler (roman-fiedler-deactivatedaccount) wrote :
Changed in apt (Ubuntu):
status: Incomplete → New
Revision history for this message
Julian Andres Klode (juliank) wrote :

So, that's not a bug then. I eventually want to add a feature where you can switch between a one-source-must-update and a all-sources-must-update mode, but as mentioned before, that's way off - it probably requires quite a few changes.

Changed in apt (Ubuntu):
status: New → Triaged
importance: Undecided → Wishlist
Mathew Hodson (mhodson)
no longer affects: apt (Debian)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.