{"record":{"id":"022ccb691d69cd28","repo":"JuliusBrussee/caveman","slug":"off-states-downloadunreachable-line-nfix-off-states","errorCode":null,"errorMessage":"${OFF_STATES.downloadUnreachable.line}\\nfix: ${OFF_STATES.downloadUnreachable.fix}","messagePattern":"(.+?)\\\\nfix: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/index.ts","lineNumber":2393,"sourceCode":"  else console.error(line);\n}\n\nfunction installProgressComplete(\n  name: string,\n  platform: { os: string; arch: string },\n  bytes: number,\n) {\n  const line = `${name}  ${platform.os}/${platform.arch}  ${(bytes / 1_000_000).toFixed(1)} MB  checksum verified`;\n  if (interactive()) process.stderr.write(`\\r${line}\\n`);\n  else console.error(line);\n}\n\nfunction setupInstallFailure(error: unknown, timeoutSeconds: number): never {\n  if (interactive()) process.stderr.write(\"\\n\");\n  if (error instanceof BinaryDownloadError && error.kind === \"stalled\") {\n    throw new Error(`${OFF_STATES.downloadStalled(timeoutSeconds).line}\\nfix: ${OFF_STATES.downloadStalled(timeoutSeconds).fix}`);\n  }\n  throw new Error(`${OFF_STATES.downloadUnreachable.line}\\nfix: ${OFF_STATES.downloadUnreachable.fix}`);\n}\n\nfunction printInstallResult(\n  installed: InstalledBinary[],\n  platform: { os: string; arch: string },\n  binDir: string,\n  json: boolean,\n  continuing = false,\n) {\n  if (json) {\n    print({\n      release: BINARY_RELEASE,\n      platform: `${platform.os}/${platform.arch}`,\n      target: binDir,\n      binaries: installed,\n      next: \"caveman claude\",\n    });\n    return;","sourceCodeStart":2375,"sourceCodeEnd":2411,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/packages/cli/src/index.ts#L2375-L2411","documentation":"setupInstallFailure is the catch-all failure path of the `caveman install` binary downloader. When the download error is not a 'stalled' BinaryDownloadError (e.g. network unreachable, DNS failure, HTTP error), it throws this generic 'download unreachable' message from OFF_STATES. It tells the user the binary could not be fetched from the release host.","triggerScenarios":"Any non-timeout/non-stall failure inside the install download path: fetch of the release artifact throws (connection refused, DNS failure, TLS error, 404/403 HTTP response), and BinaryDownloadError.kind !== 'stalled'.","commonSituations":"Offline or firewalled environments blocking the release host; corporate proxies; wrong/removed release URL after a version change; DNS misconfiguration.","solutions":["Check network connectivity to the release/download host (curl -I the download URL).","Configure proxy env vars (HTTPS_PROXY/HTTPS_PROXY) if behind a corporate proxy.","Retry the install command once connectivity is restored.","Manually download the binary and place it in binDir if the network cannot be fixed."],"exampleFix":"// before\nnpx caveman install  // fails offline\n// after\nexport HTTPS_PROXY=http://proxy.corp:8080\nnpx caveman install","handlingStrategy":"retry","validationCode":"curl -fsSI \"$DOWNLOAD_URL\" >/dev/null && echo reachable || echo unreachable","typeGuard":null,"tryCatchPattern":"try { await install() } catch (e) { if (String(e.message).includes('download unreachable')) { await waitForNetwork(); await install(); } else throw e; }","preventionTips":["Pre-check connectivity to the release host before installing.","Set HTTPS_PROXY correctly in CI/container environments.","Pin a fallback mirror or pre-download binaries for air-gapped setups."],"tags":["network","install","download","cli"],"backgroundTag":"network-request-failed","analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}