{"record":{"id":"1b3f20fd01b11a38","repo":"coleam00/Archon","slug":"network-error-fetching-checksums-from-checksumsu","errorCode":null,"errorMessage":"Network error fetching checksums from ${checksumsUrl}: ${toError(err).message}","messagePattern":"Network error fetching checksums from (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/serve.ts","lineNumber":140,"sourceCode":"  console.log(`Web UI not found locally — downloading from release v${version}...`);\n\n  // Determine expected hash: prefer build-time embedded hash (independent trust anchor)\n  // over the remote checksums.txt (same-source, weaker guarantee).\n  let expectedHash: string;\n  let tarballRes: Response;\n  if (embeddedChecksum) {\n    expectedHash = parseEmbeddedChecksum(embeddedChecksum);\n    log.info({ source: 'embedded' }, 'web_dist.checksum_resolved');\n    console.log(`Downloading ${tarballUrl}...`);\n    tarballRes = await fetch(tarballUrl).catch((err: unknown) => {\n      throw new Error(`Network error fetching tarball from ${tarballUrl}: ${toError(err).message}`);\n    });\n  } else {\n    // Fallback: download checksums and tarball in parallel (dev mode or pre-build binaries)\n    console.log(`Downloading ${tarballUrl}...`);\n    const [checksumsRes, fetchedTarballRes] = await Promise.all([\n      fetch(checksumsUrl).catch((err: unknown) => {\n        throw new Error(\n          `Network error fetching checksums from ${checksumsUrl}: ${toError(err).message}`\n        );\n      }),\n      fetch(tarballUrl).catch((err: unknown) => {\n        throw new Error(\n          `Network error fetching tarball from ${tarballUrl}: ${toError(err).message}`\n        );\n      }),\n    ]);\n    if (!checksumsRes.ok) {\n      throw new Error(\n        `Failed to download checksums: ${checksumsRes.status} ${checksumsRes.statusText}`\n      );\n    }\n    const checksumsText = await checksumsRes.text();\n    expectedHash = parseChecksum(checksumsText, 'archon-web.tar.gz');\n    log.info({ source: 'remote' }, 'web_dist.checksum_resolved');\n    tarballRes = fetchedTarballRes;","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/serve.ts#L122-L158","documentation":"The fallback (no embedded checksum) path of downloadWebDist fetches the checksums file and tarball in parallel; this error wraps any network-level failure of fetch(checksumsUrl), preserving the underlying message. It exists so the operator sees which URL failed rather than an opaque fetch rejection.","triggerScenarios":"serveCommand -> downloadWebDist in dev/pre-build mode (embeddedChecksum absent); fetch(checksumsUrl) rejects due to unreachable host, DNS/TLS failure, or aborted request.","commonSituations":"Same network issues as tarball fetch: offline host, proxy blocking, DNS failure; dev binaries pointing at a release URL that does not host checksums yet; firewall egress rules.","solutions":["Verify reachability of the checksums URL with curl -I <checksumsUrl> from the host.","Fix proxy/egress configuration (HTTPS_PROXY) or firewall rules for the download host.","Use a release binary with an embedded checksum to skip the remote checksums download entirely.","Retry on transient failures; confirm the release/channel actually publishes the checksums artifact."],"exampleFix":"// before: dev binary hitting missing checksums host\narchon serve --download  # fetch(checksumsUrl) fails\n// after: release binary with embedded checksum\narchon serve --download  # uses parseEmbeddedChecksum path","handlingStrategy":"retry","validationCode":"const res = await fetch(checksumsUrl).catch(() => null);\nif (!res || !res.ok) throw new Error(`Checksums URL unreachable or failing: ${checksumsUrl}`);","typeGuard":null,"tryCatchPattern":"try {\n  await serveCommand({ downloadOnly: true });\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith('Network error fetching checksums')) {\n    // verify DNS/proxy for the checksums host and retry\n  }\n}","preventionTips":["Prefer release binaries with embedded checksums (single fetch path).","Ensure the release channel publishes the checksums artifact.","Set proxy env vars where egress goes through a corporate proxy."],"tags":["network","download","checksums","fetch"],"backgroundTag":"fetch-network-error","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}