Skip to content

fix(archiver): make the parent track best-effort in stems archives - #75

Merged
dylanjeffers merged 1 commit into
mainfrom
fix/archiver-skip-parent-track-on-failure
Jul 16, 2026
Merged

fix(archiver): make the parent track best-effort in stems archives#75
dylanjeffers merged 1 commit into
mainfrom
fix/archiver-skip-parent-track-on-failure

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Problem

Stems downloads for the BURKO Labyrinth contest fail deterministically. The parent track (qJ0RAXE) is a stem-only upload: it has no track_cid/orig_file_cid, but the API still reports is_downloadable=true and signs a cidstream URL with an empty CID, which every validator node 404s. Because the client sees access.download === true it requests include_parent=true, the parent download 404s, and the whole job fails after 3 retries — users get an infinite "zipping" spinner (or an error, post-#14519 in the apps repo) and never get their stems.

Fix

Treat the parent track as best-effort:

  • If its original file can't be inspected for size, skip it before reserving disk space or downloading.
  • If its download fails on every mirror (or the download URL can't be resolved), log a warning and continue.
  • Either way the user gets a stems-only zip instead of a failed job.

Stem download failures still fail the job exactly as before.

Notes

  • Root cause (API reporting downloadable + signing empty-CID URLs for tracks with no audio) should be fixed separately in the Go API; this PR makes the archiver resilient to it.
  • Added a vitest suite for the worker (mocked SDK/fetch, real fs + zip): parent success, parent 404 on all mirrors, unresolvable parent URL, parent inspect failure, and stem failure still failing the job.

🤖 Generated with Claude Code

Stem-only uploads (e.g. remix contest tracks) can report isDownloadable
while having no original file to serve — the API signs a download URL
with an empty CID and every mirror 404s it. Previously that failed the
whole archive job after 3 retries, so users couldn't download any stems
(BURKO Labyrinth contest, 2026-07-16).

Now the parent track is best-effort: if its size can't be inspected or
its download fails, we log a warning and deliver a stems-only archive.
Stem download failures still fail the job as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dylanjeffers
dylanjeffers merged commit 3857dcf into main Jul 16, 2026
2 checks passed
dylanjeffers added a commit that referenced this pull request Jul 16, 2026
…e fallback (#76)

Stems downloads were still failing after #75 (Endevie job 62416-1416946406,
2026-07-16 20:47 UTC): every stem failed with 'All mirrors failed' after
attempting exactly one host — creatornode2.audius.co.

Two compounding bugs:

1. The mirror list is always empty. The pinned @audius/sdk 10.0.0 generated
   deserializer (TrackFromJSONTyped) drops the download/stream fields the API
   returns, so the cast in createStemsArchive reads undefined. The tests
   passed because the mock SDK returned mirrors the real SDK never delivers.

2. With no mirrors, the only candidate was ARCHIVE_FALLBACK_HOST —
   creatornode2.audius.co — which is decommissioned (bare nginx, 404s
   everything including /health_check).

Fix: buildCandidateHosts now puts the canonical host from the API's 302
first — the API already selected it by rendezvous for the exact cid, and
mediorum peer-redirects on a miss — so downloads succeed even with no
mirrors. The fallback host moves to creatornode.audius.co (verified serving
signed cidstream requests, 206). The mock SDK no longer fabricates mirrors,
and new tests cover canonical-first and dead-canonical→fallback paths.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant