Files
craft-common-actions/tests
e031880d47 fix(install-apt-packages): time-limit and retry mirror downloads (#117)
* fix(install-apt-packages): time-limit and retry mirror downloads

A SonarCloud job in vectorcraft (run 41253493430) sat in this step for 58 minutes: the Azure
Ubuntu mirror timed out, apt fell back to archive.ubuntu.com, then a connection went silent and
apt printed nothing until the run was cancelled. Acquire::http::Timeout doesn't end a connection
that stays open, so the job's 90-minute timeout was the only bound.

apt-get update and a new --download-only pass now each run under timeout(1), 300 s per attempt,
up to 3 attempts. The install itself then works from downloaded files only, so dpkg is never
killed mid-configure. Acquire::https::Timeout is set alongside the http one for the HTTPS fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(install-apt-packages): retry an update that fetched only some indexes

apt-get update warns and exits 0 when an index fails to download, so the retry never ran for
it. APT::Update::Error-Mode=any makes that a failure, which is retried. If indexes are still
missing after the last attempt the step continues with a warning, as it did before: they often
belong to a repository the packages don't need, and a package that needs one fails the download.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: FredApps <FredApps@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 02:05:24 +01:00
..