Add --retry 3 with delay to curl downloads to handle transient 502s#17841
Add --retry 3 with delay to curl downloads to handle transient 502s#17841
Conversation
…t 502 errors Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot usual exponential backup delays between releases |
…l backoff Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in 51dbc49. Replaced |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing... |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
🤖 Smoke test results for
Overall: PASS (10/12 — Serena & Playwright MCP tools unavailable)
|
There was a problem hiding this comment.
Simple, targeted fix for transient 502s. The retry flags are applied consistently across both install scripts. Minor suggestion: consider --retry-connrefused for broader coverage.
📰 BREAKING: Report filed by Smoke Copilot
| # Download checksums | ||
| echo "Downloading checksums from ${CHECKSUMS_URL}..." | ||
| curl -fsSL -o "${TEMP_DIR}/SHA256SUMS.txt" "${CHECKSUMS_URL}" | ||
| curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/SHA256SUMS.txt" "${CHECKSUMS_URL}" |
There was a problem hiding this comment.
The --retry-delay 5 adds up to ~15s extra time on a fully failing download. This is a reasonable tradeoff for reliability. The flags are consistent across both scripts. ✅
Smoke Test ResultsPR titles: feat(release): celebrate community issue authors in release highlights; fix(duplicate-code-detector): require noop when no duplication found
|
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
✅ Commit pushed: |
There was a problem hiding this comment.
💥 Automated smoke test review - all systems nominal!
💥 [THE END] — Illustrated by Smoke Claude
There was a problem hiding this comment.
Pull request overview
This PR adds curl retry flags to installer scripts to handle transient 502 Bad Gateway errors that occasionally occur when downloading binaries on public runners. The changes add --retry 3 --retry-delay 5 flags to all curl download commands in two installer scripts.
Changes:
- Added retry flags to curl commands in
install_copilot_cli.shfor checksums and tarball downloads - Added retry flags to curl commands in
install_awf_binary.shfor checksums and binary downloads across Linux and macOS - Added changeset documentation for the patch
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| actions/setup/sh/install_copilot_cli.sh | Added --retry 3 --retry-delay 5 to 2 curl commands (checksums and tarball downloads) |
| actions/setup/sh/install_awf_binary.sh | Added --retry 3 --retry-delay 5 to 3 curl commands (checksums, Linux binary, and macOS binary downloads) |
| .changeset/patch-retry-downloads.md | Added changeset documentation describing the retry functionality |
Comments suppressed due to low confidence (3)
actions/setup/sh/install_copilot_cli.sh:94
- The
--retryflag by default only retries on transient network errors (connection failures, timeouts) but does NOT retry on HTTP error codes like 502 Bad Gateway. To retry on HTTP errors, you need to add the--retry-all-errorsflag. The curl command should be:
curl -fsSL --retry 3 --retry-delay 5 --retry-all-errors -o "${TEMP_DIR}/${TARBALL_NAME}" "${TARBALL_URL}"
Note: --retry-all-errors was added in curl 7.71.0 (June 2020). If backward compatibility with older curl versions is a concern, you may need to check the curl version first or implement manual retry logic instead.
curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/${TARBALL_NAME}" "${TARBALL_URL}"
actions/setup/sh/install_awf_binary.sh:102
- The
--retryflag by default only retries on transient network errors (connection failures, timeouts) but does NOT retry on HTTP error codes like 502 Bad Gateway. To retry on HTTP errors, you need to add the--retry-all-errorsflag. The curl command should be:
curl -fsSL --retry 3 --retry-delay 5 --retry-all-errors -o "${TEMP_DIR}/${awf_binary}" "${binary_url}"
Note: --retry-all-errors was added in curl 7.71.0 (June 2020). If backward compatibility with older curl versions is a concern, you may need to check the curl version first or implement manual retry logic instead.
curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/${awf_binary}" "${binary_url}"
actions/setup/sh/install_awf_binary.sh:127
- The
--retryflag by default only retries on transient network errors (connection failures, timeouts) but does NOT retry on HTTP error codes like 502 Bad Gateway. To retry on HTTP errors, you need to add the--retry-all-errorsflag. The curl command should be:
curl -fsSL --retry 3 --retry-delay 5 --retry-all-errors -o "${TEMP_DIR}/${awf_binary}" "${binary_url}"
Note: --retry-all-errors was added in curl 7.71.0 (June 2020). If backward compatibility with older curl versions is a concern, you may need to check the curl version first or implement manual retry logic instead.
curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/${awf_binary}" "${binary_url}"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Download checksums | ||
| echo "Downloading checksums from ${CHECKSUMS_URL}..." | ||
| curl -fsSL -o "${TEMP_DIR}/SHA256SUMS.txt" "${CHECKSUMS_URL}" | ||
| curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/SHA256SUMS.txt" "${CHECKSUMS_URL}" |
There was a problem hiding this comment.
The --retry flag by default only retries on transient network errors (connection failures, timeouts) but does NOT retry on HTTP error codes like 502 Bad Gateway. To retry on HTTP errors, you need to add the --retry-all-errors flag. The curl command should be:
curl -fsSL --retry 3 --retry-delay 5 --retry-all-errors -o "${TEMP_DIR}/SHA256SUMS.txt" "${CHECKSUMS_URL}"
Note: --retry-all-errors was added in curl 7.71.0 (June 2020). If backward compatibility with older curl versions is a concern, you may need to check the curl version first or implement manual retry logic instead.
This issue also appears on line 94 of the same file.
See below for a potential fix:
curl -fsSL --retry 3 --retry-delay 5 --retry-all-errors -o "${TEMP_DIR}/SHA256SUMS.txt" "${CHECKSUMS_URL}"
# Download binary tarball
echo "Downloading binary from ${TARBALL_URL}..."
curl -fsSL --retry 3 --retry-delay 5 --retry-all-errors -o "${TEMP_DIR}/${TARBALL_NAME}" "${TARBALL_URL}"
| # Download checksums | ||
| echo "Downloading checksums from ${CHECKSUMS_URL@Q}..." | ||
| curl -fsSL -o "${TEMP_DIR}/checksums.txt" "${CHECKSUMS_URL}" | ||
| curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/checksums.txt" "${CHECKSUMS_URL}" |
There was a problem hiding this comment.
The --retry flag by default only retries on transient network errors (connection failures, timeouts) but does NOT retry on HTTP error codes like 502 Bad Gateway. To retry on HTTP errors, you need to add the --retry-all-errors flag. The curl command should be:
curl -fsSL --retry 3 --retry-delay 5 --retry-all-errors -o "${TEMP_DIR}/checksums.txt" "${CHECKSUMS_URL}"
Note: --retry-all-errors was added in curl 7.71.0 (June 2020). If backward compatibility with older curl versions is a concern, you may need to check the curl version first or implement manual retry logic instead.
This issue also appears in the following locations of the same file:
- line 102
- line 127
| curl -fsSL --retry 3 --retry-delay 5 -o "${TEMP_DIR}/checksums.txt" "${CHECKSUMS_URL}" | |
| curl -fsSL --retry 3 --retry-delay 5 --retry-all-errors -o "${TEMP_DIR}/checksums.txt" "${CHECKSUMS_URL}" |
Public runners occasionally return 502s when downloading binaries (Copilot CLI, AWF), causing workflow failures. Both install scripts now use curl's built-in
--retryand--retry-delayflags to retry up to 3 times with a 5-second delay between attempts.Changes
install_copilot_cli.sh— Added--retry 3 --retry-delay 5to checksums and tarball downloadsinstall_awf_binary.sh— Added--retry 3 --retry-delay 5to checksums, Linux binary, and macOS binary downloadsinstall-gh-aw.shandactions/setup-cli/install.shalready implement manual retry loops and are unchanged.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Changeset
Warning
The following domains were blocked by the firewall during workflow execution:
codeload.github.comgithub.com✨ PR Review Safe Output Test - Run 22296099308