{"record":{"id":"07b0664d4003a416","repo":"jamiepine/voicebox","slug":"label-failed-to-fetch-checksum-from-sha256-url-07b066","errorCode":null,"errorMessage":"{label}: failed to fetch checksum from {sha256_url}","messagePattern":"(.+?): failed to fetch checksum from (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"backend/services/rocm.py","lineNumber":176,"sourceCode":"        total_size: Total bytes across all downloads (for progress bar)\n    \"\"\"\n    progress = get_progress_manager()\n    temp_path = dest_dir / f\".download-{label.replace(' ', '-')}.tmp\"\n\n    # Clean up leftover partial download\n    if temp_path.exists():\n        temp_path.unlink()\n\n    # Fetch expected checksum (fail-fast: never extract an unverified archive)\n    expected_sha = None\n    if sha256_url:\n        try:\n            sha_resp = await client.get(sha256_url)\n            sha_resp.raise_for_status()\n            expected_sha = sha_resp.text.strip().split()[0]\n            logger.info(f\"{label}: expected SHA-256: {expected_sha[:16]}...\")\n        except Exception as e:\n            raise RuntimeError(f\"{label}: failed to fetch checksum from {sha256_url}\") from e\n\n    # Stream download, verify, and extract — always clean up temp file\n    downloaded = 0\n    try:\n        async with client.stream(\"GET\", url) as response:\n            response.raise_for_status()\n            with open(temp_path, \"wb\") as f:\n                async for chunk in response.aiter_bytes(chunk_size=1024 * 1024):\n                    f.write(chunk)\n                    downloaded += len(chunk)\n                    progress.update_progress(\n                        PROGRESS_KEY,\n                        current=progress_offset + downloaded,\n                        total=total_size,\n                        filename=f\"Downloading {label}\",\n                        status=\"downloading\",\n                    )\n","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/jamiepine/voicebox/blob/51f49dea198384b4eb6087b72c17057c6eb1c1cd/backend/services/rocm.py#L158-L194","documentation":"Raised by the ROCm archive download helper when fetching the .sha256 checksum file from sha256_url fails — client.get() or raise_for_status() threw. The helper is fail-fast: it refuses to download or extract an archive whose expected checksum could not be retrieved, since extracting an unverified archive is unsafe. The original exception is chained via 'from e'.","triggerScenarios":"Network outage or DNS failure reaching the GitHub-hosted .sha256 URL; the checksum URL returns 404/5xx (release asset missing or renamed); a proxy/firewall blocks the request; TLS/cert error; transient timeout.","commonSituations":"Corporate proxy blocking raw GitHub release downloads; GitHub release asset renamed so the sha256 file moved; offline/air-gapped install attempting to reach the internet; transient GitHub outage during setup; expired CDN link.","solutions":["Check network connectivity and that the sha256_url resolves (curl -I <sha256_url>); retry on transient failures.","Verify the ROCm version maps to an existing release with both the .tar.gz and .sha256 assets published.","If behind a proxy, set HTTPS_PROXY and ensure the proxy allows the GitHub release domain.","For air-gapped setups, host the archive and checksum on an internal mirror and point the download URLs there.","If checksum verification is intentionally skipped, call the downloader without a sha256_url (expected_sha stays None)."],"exampleFix":"// before: raises because checksum fetch 404s\n// after: verify asset exists, or run without checksum\n# confirm the URL\n# curl -I https://github.com/.../rocm-6.1.tar.gz.sha256\n# then retry; or call the helper with sha256_url=None to skip verification","handlingStrategy":"retry","validationCode":"import httpx\n\nasync def checksum_url_reachable(client: httpx.AsyncClient, sha256_url: str) -> bool:\n    try:\n        r = await client.get(sha256_url)\n        return r.status_code == 200\n    except Exception:\n        return False","typeGuard":null,"tryCatchPattern":"for attempt in range(3):\n    try:\n        await download_verified_archive(client, url, sha256_url, dest_dir, label)\n        break\n    except RuntimeError as e:\n        if 'failed to fetch checksum' in str(e) and attempt < 2:\n            await asyncio.sleep(2 ** attempt)\n            continue\n        raise","preventionTips":["Confirm the release publishes both the archive and its .sha256 asset before triggering setup.","Ensure proxy/firewall rules permit the GitHub release domain.","For air-gapped installs, mirror both assets to an internal host and point URLs there."],"tags":["rocm","network","download","checksum","setup","voicebox"],"backgroundTag":null,"analyzedSha":"51f49dea198384b4eb6087b72c17057c6eb1c1cd","analyzedAt":"2026-08-12T16:51:42.824Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}