fix(archiver): try canonical redirect host first, fix dead archive fallback - #76
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 withAll mirrors failed for stem download,attempted: [{host: 'https://creatornode2.audius.co'}]— one single host tried.Two compounding bugs:
@audius/sdk10.0.0 generated deserializer (TrackFromJSONTyped) maps only known fields and dropsdownload/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 readsundefinedeven 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.creatornode2.audius.cois 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
buildCandidateHostsnow 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_HOST→creatornode.audius.co(verified serving signed cidstream requests with HTTP 206; it's the node that ingests/transcodes uploads).tsc --noEmitclean, 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/sdkso mirrors actually flow through.🤖 Generated with Claude Code