Skip to content

publish-to-r2: a failed payload upload leaves SHA256SUMS listing a missing file #84

Closed

Description

@frostyard-machines

Problem

publish-to-r2 uploads the whole ./repo tree with 1 aws s3 sync (action.yml, "Upload to R2"). The sync uploads metadata and payloads in parallel and in no fixed order. When 1 payload upload fails, the metadata that lists it is already live. The bucket then advertises a file that does not exist.

Evidence (frostyard/snosi, 2026-11-02)

  • Run https://github.com/frostyard/snosi/actions/runs/41384581449, action pin c3c9f63 (v0.7.0).
  • 04:44:48Z: ext/chatgpt/SHA256SUMS, SHA256SUMS.gpg (good signature), chatgpt.transfer and index.html uploaded.
  • 04:45:04Z: upload failed: repo/ext/chatgpt/chatgpt_26.1027.51404+r1_13_x86-64.raw.zst ... An error occurred (InvalidPart) when calling the CompleteMultipartUpload operation: One or more of the specified parts could not be found.
  • Now: https://repository.frostyard.org/ext/chatgpt/SHA256SUMS lists chatgpt_26.1027.51404+r1_13_x86-64.raw.zst (sha256 4a48b545…), and that URL returns 404. It is the newest version, so sysupdate/updex clients try it and fail.
  • The run failed, so the cache purge step was skipped too.
  • The earlier 29 main runs of that workflow had no upload failure: the R2 error looks transient. The damage it leaves is not: v0.7.0 digest reconciliation refuses a rebuild of the same identity with other bytes (mkosi output is not reproducible), so a rerun cannot repair it.

Proposal

  1. Upload in 2 phases: first every payload (--exclude the metadata: SHA256SUMS*, *.transfer, index*, dists/, Release*, ...), then the metadata only after phase 1 succeeds. A failed payload then leaves the old, consistent metadata live.
  2. Optionally retry transient S3 errors (AWS_RETRY_MODE=adaptive, AWS_MAX_ATTEMPTS); the CLI does not retry InvalidPart on CompleteMultipartUpload today.

snosi side

snosi works around it in frostyard/snosi#1200, in its pre-filter (shared/sysext/publish/drop-published.sh): it now fails when a built identity is listed but its payload object is missing, and chatgpt is republished as +r2. The dangling +r1 entry stays in ext/chatgpt/SHA256SUMS until someone repairs the bucket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions