From 6e2bce53a6a2ceeb8595586c9ef8c294978c3a18 Mon Sep 17 00:00:00 2001 From: Ion Alpha Date: Thu, 5 Nov 2026 09:38:40 +0000 Subject: [PATCH] fix(release): retry downloads that GitHub answers with a 5xx The v0.2.0 release run's Windows upgrade leg failed in 16 seconds because GitHub's release download host returned 504 for one of v0.1.3's assets. For about an hour it answered 504 for one asset at a time while serving the others, with no incident on its status page. The upgrade itself was fine: run by hand it passed. curl's --retry already treats 408, 429, 5xx and timeouts as transient, so the downloads in dev/upgrade-check, dev/container-profiles and install.sh's curl path now retry five times. The wget path in install.sh is unchanged because busybox wget has no retry option, and install.ps1 is unchanged because Windows PowerShell 5.1's Invoke-WebRequest has no retry parameter. Signed-off-by: Ion Alpha --- dev/container-profiles | 3 ++- dev/upgrade-check | 7 +++++-- install.sh | 7 +++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/dev/container-profiles b/dev/container-profiles index 36bd59b6..11e5a00d 100755 --- a/dev/container-profiles +++ b/dev/container-profiles @@ -47,7 +47,8 @@ failed=0 fetch() { out="$TMP/$(basename "$3")" echo "==> fetching moby/profiles $1 at $MOBY_PROFILES_COMMIT" - curl -fsSL "$RAW/$1" -o "$out" + # --retry: a transient 5xx from GitHub should not read as a missing profile. + curl -fsSL --retry 5 --retry-delay 5 "$RAW/$1" -o "$out" got="$(sha256 "$out")" if [ "$got" != "$2" ]; then echo "checksum mismatch for $1: got $got, pinned $2" >&2 diff --git a/dev/upgrade-check b/dev/upgrade-check index 01bdab95..1a0117b0 100755 --- a/dev/upgrade-check +++ b/dev/upgrade-check @@ -47,8 +47,11 @@ asset="flynn_${os}_${arch}.${ext}" base="https://github.com/$repo/releases/download/$from" echo "==> downloading $from $asset" -curl -fsSL -o "$work/$asset" "$base/$asset" -curl -fsSL -o "$work/checksums.txt" "$base/checksums.txt" +# --retry covers the 5xx answers GitHub's download host gives for minutes at a +# time: on 5 Nov 2026 it returned 504 for one v0.1.3 asset while serving the +# others, which failed a release's Windows leg before it tested anything. +curl -fsSL --retry 5 --retry-delay 5 -o "$work/$asset" "$base/$asset" +curl -fsSL --retry 5 --retry-delay 5 -o "$work/checksums.txt" "$base/checksums.txt" want="$(grep " $asset\$" "$work/checksums.txt" | cut -d' ' -f1)" if command -v sha256sum >/dev/null 2>&1; then got="$(sha256sum "$work/$asset" | cut -d' ' -f1)" diff --git a/install.sh b/install.sh index 6454ce1d..9fae4897 100755 --- a/install.sh +++ b/install.sh @@ -29,9 +29,12 @@ err() { have() { command -v "$1" >/dev/null 2>&1; } # fetch URL FILE: download URL to FILE using whichever of curl or wget is present. +# curl retries the transient answers (408, 429, 5xx, timeouts) GitHub's download +# host sometimes gives, so a brief outage does not fail the install. wget is left +# without retries: busybox wget has no option for them. fetch() { if have curl; then - curl -fsSL -o "$2" "$1" + curl -fsSL --retry 5 --retry-delay 3 -o "$2" "$1" elif have wget; then wget -qO "$2" "$1" else @@ -42,7 +45,7 @@ fetch() { # fetch_stdout URL: print URL's body to stdout (for the release-lookup API). fetch_stdout() { if have curl; then - curl -fsSL "$1" + curl -fsSL --retry 5 --retry-delay 3 "$1" elif have wget; then wget -qO- "$1" else