Skip to content

Treat a Network Failure on apt-get update as Failed So apt_retry Runs #4548

Backlog

Description

@ptr727

Raised by CodeRabbit on promotion #4542 at host-setup/linux/install-tools.sh:342 (and host-setup/linux/upgrade-host.sh:180). Deferred here by the maintainer's decision.

Under APT's default error mode, a DNS or connection failure on apt-get update only warns and exits 0. So the apt_retry that #4532 and #4535 added never fires for that failure class, and the end-of-run summary omits the failed refresh. The retry still fires for the mirror-mismatch and hash errors it was built for, and the exit-0 behavior was already on main.

The hazard is sharpest at the Debian release upgrade (upgrade-host.sh around line 553), where a new-codename source that failed to fetch has no list at all.

Candidate fix: pass -o APT::Update::Error-Mode=any where a failed refresh is already tolerated and reported. That means install-tools.sh apt_refresh, the update inside each apt_retry, and the release-upgrade update only. Routine upgrade-host.sh updates stay at the default, since Error-Mode=any there would abort an upgrade whenever any third-party source is down. Tests in tests/test_install_tools.py and tests/test_upgrade_host_linux.py assert the option on those calls and its absence on the routine one.

Both scripts keep their own copy of apt_retry, per host-setup/README.md (the scripts share no file).

Activity

  1. added
    enhancement
    script
    on Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementscript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions