fix(release): an upload the forge answers with a 5xx is made again, four times in all #598

Merged
HumanBean merged 1 commit from HumanBean/Longshot:fix/release-upload-retry into main 2026-11-14 23:13:40 +00:00
Owner

Type: fix · Risk: low · Tested on: not run (a release script; CI runs its checks) · Needs: none

Why

The nightly of 82886e89 was built and signed and then never reached players: the forge answered the upload of its AppImage with an error (HTTP 500), and the release script gives up on the first failed upload. Three of the eight Sign and publish jobs of 14 November failed. A release should not be lost to one bad answer from the server.

No issue in the tracker for it.

How to reproduce

Seen on: the Release workflow on git.magicbean.dev, run https://git.magicbean.dev/MagicBeanDev/Longshot/actions/runs/9342 (the Sign and publish job)
Settings and switches: defaults
Steps: a push to main whose release reaches Publish while the forge answers an upload with a 5xx
Expected: the nightly is published with its five files
Actual: release.py: POST /repos/MagicBeanDev/Longshot/releases/5524/assets?name=Longshot-nightly-161-82886e89-x86_64.AppImage: HTTP 500 {"message":"","url":"https://git.magicbean.dev/api/swagger"}, the job fails, and nightly-161-82886e89 stays a draft with no files

What changed

An upload of a release file that the server answers with a 5xx, or whose connection is dropped, is made again: four tries in all, 20, 40 and 60 seconds apart. Before each new try, what the failed one left under the file's name is removed. After the fourth failure the run ends as it does today and the draft stays unpublished.

  • release: upload_file() in scripts/release.py (new; publish() calls it for each file), api(..., again=True) raising ServerTrouble for a 5xx or a lost connection instead of ending the run, UPLOAD_TRIES and UPLOAD_PAUSE. Every other request, and a 4xx on an upload (the size or type limits), fails at once as before.
  • docs: a row in RELEASING.md's troubleshooting table.

This does not find why the forge answered 500: that is in the server's own log. It keeps a passing fault from costing a release.

Measurements

Verdict: nothing to measure: a release script, covered by its game-free checks.

Flags and settings

None.

Testing

Tested: nothing was run on the author's PC (no test suites run there). Two checks were added to tests/test_release.py against its fake Forgejo, for CI: test_an_upload_the_server_fails_is_made_again (a 500 that leaves a half file, then a dropped connection, then a good upload: one file on the release, the half file deleted, published) and test_an_upload_that_keeps_failing_ends_the_release_unpublished (four 500s: the run fails and the release stays a draft).

Not tested: against git.magicbean.dev itself: the next nightly's Sign and publish is the first real run. Whether the forge's 500 goes away on a second try is not known; if it is a lasting fault on the server (its storage), four tries fail as one did, about two minutes later.

Must be tested: None.

Risks

What could break: publishing only. A failed upload now takes up to two minutes longer to fail for good. If the server took a file whole and still answered 5xx, that copy is deleted and uploaded again.

Turning it off: revert the commit.

Compatibility: Nothing changes.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named). CI runs it; not run on the author's PC.
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A game-free test added for the fix, failing on main and passing here.
  • Docs updated.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8e34avQ5cTCWow16MXn

**Type:** fix · **Risk:** low · **Tested on:** not run (a release script; CI runs its checks) · **Needs:** none ## Why The nightly of 82886e89 was built and signed and then never reached players: the forge answered the upload of its AppImage with an error (HTTP 500), and the release script gives up on the first failed upload. Three of the eight *Sign and publish* jobs of 14 November failed. A release should not be lost to one bad answer from the server. No issue in the tracker for it. ## How to reproduce **Seen on:** the Release workflow on git.magicbean.dev, run https://git.magicbean.dev/MagicBeanDev/Longshot/actions/runs/9342 (the *Sign and publish* job) **Settings and switches:** defaults **Steps:** a push to `main` whose release reaches *Publish* while the forge answers an upload with a 5xx **Expected:** the nightly is published with its five files **Actual:** `release.py: POST /repos/MagicBeanDev/Longshot/releases/5524/assets?name=Longshot-nightly-161-82886e89-x86_64.AppImage: HTTP 500 {"message":"","url":"https://git.magicbean.dev/api/swagger"}`, the job fails, and `nightly-161-82886e89` stays a draft with no files ## What changed An upload of a release file that the server answers with a 5xx, or whose connection is dropped, is made again: four tries in all, 20, 40 and 60 seconds apart. Before each new try, what the failed one left under the file's name is removed. After the fourth failure the run ends as it does today and the draft stays unpublished. - release: `upload_file()` in `scripts/release.py` (new; `publish()` calls it for each file), `api(..., again=True)` raising `ServerTrouble` for a 5xx or a lost connection instead of ending the run, `UPLOAD_TRIES` and `UPLOAD_PAUSE`. Every other request, and a 4xx on an upload (the size or type limits), fails at once as before. - docs: a row in `RELEASING.md`'s troubleshooting table. This does not find why the forge answered 500: that is in the server's own log. It keeps a passing fault from costing a release. ## Measurements **Verdict:** nothing to measure: a release script, covered by its game-free checks. ### Flags and settings None. ## Testing **Tested:** nothing was run on the author's PC (no test suites run there). Two checks were added to `tests/test_release.py` against its fake Forgejo, for CI: `test_an_upload_the_server_fails_is_made_again` (a 500 that leaves a half file, then a dropped connection, then a good upload: one file on the release, the half file deleted, published) and `test_an_upload_that_keeps_failing_ends_the_release_unpublished` (four 500s: the run fails and the release stays a draft). **Not tested:** against git.magicbean.dev itself: the next nightly's *Sign and publish* is the first real run. Whether the forge's 500 goes away on a second try is not known; if it is a lasting fault on the server (its storage), four tries fail as one did, about two minutes later. **Must be tested:** None. ## Risks **What could break:** publishing only. A failed upload now takes up to two minutes longer to fail for good. If the server took a file whole and still answered 5xx, that copy is deleted and uploaded again. **Turning it off:** revert the commit. **Compatibility:** Nothing changes. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). CI runs it; not run on the author's PC. - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] Docs updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8e34avQ5cTCWow16MXn
fix(release): an upload the forge answers with a 5xx is made again, four times in all
All checks were successful
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
CI / Workflow lint (actionlint) (pull_request) Successful in 7s
Third-party parts / As their notes say (pull_request) Successful in 10s
PR description / Description follows the template (pull_request_target) Successful in 4s
e6b38a88f7
The nightly of 82886e89 was built and signed and then not published: Forgejo
answered the AppImage's upload with HTTP 500 and release.py made one try. A 5xx
or a dropped connection on a release file's upload is now tried again after a
pause (20 s, 40 s, 60 s), what the failed try left under the name removed first;
after the fourth the run fails as before and the draft stays unpublished.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e34avQ5cTCWow16MXn
HumanBean changed title from WIP: fix(release): an upload the forge answers with a 5xx is made again, four times in all to fix(release): an upload the forge answers with a 5xx is made again, four times in all 2026-11-14 22:32:29 +00:00
HumanBean deleted branch fix/release-upload-retry 2026-11-14 23:13:41 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!598
No description provided.