{"record":{"id":"299b7c58056db671","repo":"chroma-core/chroma","slug":"failed-to-fetch-package-data-response-statustex","errorCode":null,"errorMessage":"Failed to fetch package data: ${response.statusText}","messagePattern":"Failed to fetch package data: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"clients/js/packages/chromadb/src/cli.ts","lineNumber":15,"sourceCode":"#!/usr/bin/env node\nimport semver from \"semver\";\nimport binding from \"./bindings\";\n\ninterface NpmPackageData {\n  \"dist-tags\": {\n    latest: string;\n    [tag: string]: string;\n  };\n}\n\nconst getLatestVersion = async (packageName: string): Promise<string> => {\n  const response = await fetch(`https://registry.npmjs.org/${packageName}`);\n  if (!response.ok) {\n    throw new Error(`Failed to fetch package data: ${response.statusText}`);\n  }\n  const data: NpmPackageData = await response.json();\n  return data[\"dist-tags\"].latest;\n};\n\nconst update = async (): Promise<void> => {\n  try {\n    const installedVersion = process.env.CHROMADB_VERSION || \"0.0.0\";\n    const latestVersion = await getLatestVersion(\"chromadb\");\n\n    if (semver.lt(installedVersion, latestVersion)) {\n      console.log(`\\nA new chromadb version (${latestVersion}) is available!`);\n      console.log(\"\\n\\x1b[4mUpdat with npm\\x1b[0m\");\n      console.log(\"npm install chromadb@latest\");\n\n      console.log(\"\\n\\x1b[4mUpdat with pnpm\\x1b[0m\");\n      console.log(\"pnpm add chromadb@latest\");\n","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/clients/js/packages/chromadb/src/cli.ts#L1-L33","documentation":"Thrown by the chromadb CLI's update check when the HTTP request to https://registry.npmjs.org/chromadb returns a non-OK status. The CLI fetches npm dist-tags to compare your installed version against latest; if the registry responds with an error status (proxy block, 404, 5xx, rate limit), this error aborts the check. It is a version-notification concern only, not a database or data problem.","triggerScenarios":"Running the chromadb CLI behind a corporate proxy/firewall that rejects or rewrites registry.npmjs.org; npm registry returning 404/429/5xx; a transparent proxy returning an error status page; offline environments where a proxy answers with a non-200.","commonSituations":"Locked-down corporate networks; CI with restricted egress; temporary npm registry outages; air-gapped machines with a misconfigured proxy.","solutions":["Check network access to https://registry.npmjs.org/chromadb from the same environment (curl -I).","Configure proxy environment variables (HTTPS_PROXY) so fetch goes through the allowed proxy.","Retry later if npm was returning a transient 5xx/429.","Ignore safely: this only affects the new-version notice, not CLI functionality — wrap or skip the update check if your workflow does not need it."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await getLatestVersion(\"chromadb\"); // or run the CLI update check\n} catch (e) {\n  // Update notification only — never fail the workflow for it\n  console.warn(`Update check skipped: ${(e as Error).message}`);\n}","preventionTips":["Treat the CLI update check as optional; wrap it so registry errors never break scripts.","Configure HTTPS_PROXY in restricted networks.","Pin attention to real failures elsewhere: this error does not affect database operation."],"tags":["cli","network","npm-registry","update-check"],"backgroundTag":"http-request-failed","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}