Skip to content

fix(archiver): try canonical redirect host first, fix dead archive fallback - #76

Merged
dylanjeffers merged 1 commit into
mainfrom
fix/archiver-canonical-host-and-fallback
Jul 16, 2026
Merged

fix(archiver): try canonical redirect host first, fix dead archive fallback#76
dylanjeffers merged 1 commit into
mainfrom
fix/archiver-canonical-host-and-fallback

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Problem

Stems downloads still fail after #75 deployed — but for a different reason. Job 62416-1416946406 (Endevie — Audius Summer Cypher, 20:47 UTC): every stem download failed with All mirrors failed for stem download, attempted: [{host: 'https://creatornode2.audius.co'}] — one single host tried.

Two compounding bugs:

  1. The mirror list is always empty at runtime. The pinned @audius/sdk 10.0.0 generated deserializer (TrackFromJSONTyped) maps only known fields and drops download/stream — the cast added in archiver: try mirrors with archive-node fallback for stem downloads #30/fix(archiver): make the parent track best-effort in stems archives #75 reads undefined even though api.audius.co returns the fields (verified against the live API and the published 10.0.0 bundle). The tests passed because the mock SDK fabricated mirrors the real SDK never delivers.
  2. The archive fallback host is dead. creatornode2.audius.co is decommissioned — bare nginx that 404s everything, including /health_check. So the only candidate host could never serve anything.

Net effect: the archiver never tries the host the API's 302 just pointed it at (which I verified serves the Endevie stems right now), and its safety net was a corpse.

Fix

  • buildCandidateHosts now puts the canonical redirect host first — the API selected it by rendezvous for the exact CID, and mediorum peer-redirects on a local miss, so downloads succeed even with zero mirrors.
  • ARCHIVE_FALLBACK_HOSTcreatornode.audius.co (verified serving signed cidstream requests with HTTP 206; it's the node that ingests/transcodes uploads).
  • Corrected the mirrors comment (SDK strips the fields until it's upgraded) and made the mock SDK realistic; new tests cover canonical-first (no fallback traffic when healthy) and dead-canonical → archive-node fallback.

tsc --noEmit clean, 20/20 tests pass.

Deploy

Merging to main auto-deploys: Main Deploy publishes audius/archiver:latest, and the archiver namespace's auto-upgrader (every 5 min) rolls the pod.

Follow-up (separate): upgrade @audius/sdk so mirrors actually flow through.

🤖 Generated with Claude Code

…e fallback

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>
@dylanjeffers
dylanjeffers merged commit a7970de into main Jul 16, 2026
2 checks passed
@dylanjeffers
dylanjeffers deleted the fix/archiver-canonical-host-and-fallback branch July 16, 2026 21:03
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