Fix CI build failures from GitHub release asset HTTP 618 errors #4

Merged
ryujin merged 1 commits from fix/ci-github-asset-download-618 into main 2026-12-01 14:26:01 +00:00
Owner

Root Cause

The build failure in run #7 / job #14 (as well as runs #5, #6, and #8 — starting before PR #2) was not caused by PR #2's pak/launch.sh changes. Both the test job and the Rust aarch64-unknown-linux-musl compilation succeeded in every run.

Instead, build-pak.sh failed while downloading minui-list / minui-presenter from GitHub Releases:

curl: (22) The requested URL returned error: 618

GitHub /releases/download/... endpoints respond with a 302 redirect to release-assets.githubusercontent.com containing a short-lived (5-minute) signed jwt. When an intermediate HTTP cache/proxy serves a cached 302 response after that 5-minute window expires (even when Cache-Control: no-cache is sent), release-assets.githubusercontent.com immediately rejects the request with HTTP 618 (jwt:expired), causing curl -fsSL to exit with code 22.

Changes

  • Updated download_if_missing() in build-pak.sh to:
    • Append a unique cache-busting query parameter (cb=<epoch>-<pid>-<random>-<attempt>) per attempt so every request bypasses stale cached 302 redirects and receives a fresh signed JWT.
    • Retry up to 5 times with backoff and explicit connect/max timeouts (--connect-timeout 15 --max-time 120).
    • Download to a temporary file and atomically move into place only after verifying the download succeeded and is non-empty.
    • Log <platform>/<binary> (e.g. tg5040/minui-list) for clearer CI output.

Fixes #3

## Root Cause The build failure in [run #7 / job #14](https://code.ryujin.dev/ryujin/romm-companion-nextui/actions/runs/7/jobs/14) (as well as runs #5, #6, and #8 — starting before PR #2) was **not** caused by PR #2's `pak/launch.sh` changes. Both the `test` job and the Rust `aarch64-unknown-linux-musl` compilation succeeded in every run. Instead, `build-pak.sh` failed while downloading `minui-list` / `minui-presenter` from GitHub Releases: ``` curl: (22) The requested URL returned error: 618 ``` GitHub `/releases/download/...` endpoints respond with a `302` redirect to `release-assets.githubusercontent.com` containing a short-lived (5-minute) signed `jwt`. When an intermediate HTTP cache/proxy serves a cached `302` response after that 5-minute window expires (even when `Cache-Control: no-cache` is sent), `release-assets.githubusercontent.com` immediately rejects the request with HTTP `618` (`jwt:expired`), causing `curl -fsSL` to exit with code 22. ## Changes - Updated `download_if_missing()` in `build-pak.sh` to: - Append a unique cache-busting query parameter (`cb=<epoch>-<pid>-<random>-<attempt>`) per attempt so every request bypasses stale cached `302` redirects and receives a fresh signed JWT. - Retry up to 5 times with backoff and explicit connect/max timeouts (`--connect-timeout 15 --max-time 120`). - Download to a temporary file and atomically move into place only after verifying the download succeeded and is non-empty. - Log `<platform>/<binary>` (e.g. `tg5040/minui-list`) for clearer CI output. Fixes #3
ryujin added 1 commit 2026-12-01 14:20:35 +00:00
Fix GitHub release asset HTTP 618 failures in build-pak.sh
CI & Pak Build / test (pull_request) Successful in 49s
CI & Pak Build / build-pak (pull_request) Successful in 2m46s
59ff86d30f
GitHub /releases/download/ URLs return a 302 redirect to
release-assets.githubusercontent.com with a 5-minute signed JWT.
When an intermediate HTTP cache/proxy caches that 302 response past the
JWT expiration (ignoring Cache-Control: no-cache), curl immediately fails
with exit code 22 (HTTP 618 jwt:expired).

- Append a unique cache-busting query parameter per attempt in
  download_if_missing() so each request receives a fresh 302 redirect
  and unexpired JWT
- Add retry logic with backoff, explicit timeouts, and atomic temp-file
  writes so transient download failures do not break CI or leave partial
  binaries behind
- Log platform/binary name (e.g. tg5040/minui-list) for clearer CI logs

Fixes #3
ryujin merged commit 640061db21 into main 2026-12-01 14:26:01 +00:00
ryujin deleted branch fix/ci-github-asset-download-618 2026-12-01 14:26:01 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ryujin/romm-companion-nextui#4