{"record":{"id":"f5a1d3f5aab212ab","repo":"can1357/oh-my-pi","slug":"failed-to-fetch-release-info-for-pkg-respons","errorCode":null,"errorMessage":"Failed to fetch release info for ${pkg}: ${response.statusText}","messagePattern":"Failed to fetch release info for (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/update-cli.ts","lineNumber":784,"sourceCode":"\tlet response: Response;\n\ttry {\n\t\tresponse = await fetch(`${NPM_REGISTRY}${pkg}/${channel === \"canary\" ? \"canary\" : \"latest\"}`, {\n\t\t\tsignal: withTimeoutSignal(timeoutMs),\n\t\t});\n\t} catch (err) {\n\t\tif (isTimeoutError(err)) {\n\t\t\tthrow new Error(`Timed out fetching release info for ${pkg} after ${Math.round(timeoutMs / 1000)}s`, {\n\t\t\t\tcause: err,\n\t\t\t});\n\t\t}\n\t\tif (isUnsupportedProxyError(err)) throw new Error(unsupportedProxyMessage(), { cause: err });\n\t\tthrow err;\n\t}\n\tif (!response.ok) {\n\t\tif (response.status === 404 && channel === \"canary\") {\n\t\t\tthrow new Error(`No canary release has been published for ${pkg} yet. Try \\`${APP_NAME} update --stable\\`.`);\n\t\t}\n\t\tthrow new Error(`Failed to fetch release info for ${pkg}: ${response.statusText}`);\n\t}\n\n\tconst data: unknown = await response.json();\n\tif (!isRecord(data) || typeof data.version !== \"string\") {\n\t\tthrow new Error(`Malformed npm registry response for ${pkg}: missing version`);\n\t}\n\treturn { version: data.version, manifest: data };\n}\n\n/**\n * Get the latest release info from the npm registry, following `omp.rename`\n * pointers ({@link resolveReleaseRename}) when the package has moved to a new\n * npm name. Version, dist, and install names all come from the final manifest\n * in the chain. Uses npm instead of GitHub API to avoid unauthenticated rate\n * limiting.\n */\nexport async function getLatestRelease(\n\toptions: { timeoutMs?: number; channel?: UpdateChannel } = {},","sourceCodeStart":766,"sourceCodeEnd":802,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/update-cli.ts#L766-L802","documentation":"Thrown when the npm registry responds with a non-OK HTTP status that is not the special-cased canary-404. The updater surfaces the status text so the user knows the release-metadata lookup itself failed, before any download happens.","triggerScenarios":"fetch of `${NPM_REGISTRY}${pkg}/latest` (or `/canary`) returns response.ok === false with any status other than 404+canary — e.g. 5xx from the registry, 429 rate limit, 403 from a blocking proxy, or 404 on the stable tag for a renamed/missing package.","commonSituations":"npm registry outage or partial degradation, rate limiting behind shared IPs/CI, registry mirror or proxy returning errors, package uninstalled/renamed so the latest tag no longer resolves.","solutions":["Check the npm registry status page and retry after a few minutes on 5xx","If 429, wait or switch networks (rate limits are often per-IP)","Verify the package name exists: curl https://registry.npmjs.org/<pkg>/latest","Check proxy/firewall interference (403 responses) and bypass or fix the proxy","As a workaround, update via npm/bun directly: npm install -g <pkg>@latest"],"exampleFix":"// before: corporate proxy blocks registry.npmjs.org\nomp update  // Failed to fetch release info: Forbidden\n// after: allowlist registry.npmjs.org or bypass the proxy\nexport NO_PROXY=registry.npmjs.org\nomp update","handlingStrategy":"retry","validationCode":"const res = await fetch(\"https://registry.npmjs.org/<pkg>/latest\");\nif (!res.ok) throw new Error(`registry unhealthy: ${res.status} ${res.statusText}`);","typeGuard":null,"tryCatchPattern":"try {\n  await runUpdate();\n} catch (err) {\n  if (String(err?.message).startsWith(\"Failed to fetch release info\")) {\n    // retry with backoff; registry may be degraded or rate-limiting\n    await Bun.sleep(5000);\n    return runUpdate();\n  }\n  throw err;\n}","preventionTips":["Watch npm registry status during incidents before updating","Avoid shared-IP environments that trigger 429 rate limits, or wait between attempts","Allowlist registry.npmjs.org in proxies/firewalls","Fall back to `npm install -g <pkg>@latest` when the updater's registry call fails"],"tags":["network","npm-registry","http-error","updater"],"backgroundTag":"registry-http-error","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}