{"record":{"id":"81691e2d32639791","repo":"Budibase/budibase","slug":"unexpected-response-response-statustext","errorCode":null,"errorMessage":"unexpected response ${response.statusText}","messagePattern":"unexpected response (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/backend-core/src/objectStore/objectStore.ts","lineNumber":746,"sourceCode":"    }\n    return files\n  })\n}\n\nexport async function downloadTarballDirect(\n  url: string,\n  path: string,\n  headers = {},\n  { followRedirects = true }: { followRedirects?: boolean } = {}\n) {\n  path = sanitizeKey(path)\n  const response = await fetchWithBlacklist(\n    url,\n    { headers },\n    { followRedirects }\n  )\n  if (!response.ok) {\n    throw new Error(`unexpected response ${response.statusText}`)\n  }\n\n  await pipeline(response.body, zlib.createUnzip(), tar.extract(path))\n}\n\nexport async function downloadTarball(\n  url: string,\n  bucketName: string,\n  path: string\n) {\n  bucketName = sanitizeBucket(bucketName)\n  path = sanitizeKey(path)\n  const response = await fetchWithBlacklist(url)\n  if (!response.ok) {\n    throw new Error(`unexpected response ${response.statusText}`)\n  }\n\n  const tmpPath = join(budibaseTempDir(), path)","sourceCodeStart":728,"sourceCodeEnd":764,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/backend-core/src/objectStore/objectStore.ts#L728-L764","documentation":"This is the component-library/object-store download helper: it fetches a gzipped tarball via fetchWithBlacklist, checks response.ok, and throws with the HTTP statusText if the fetch was not OK. The response is then piped through unzip + tar extraction. Any non-2xx HTTP status surfaces as this error.","triggerScenarios":"Calling the internal download helper (used to fetch component libraries into the object store / local dir) when the remote URL returns 404, 403, 500 or any other non-2xx status.","commonSituations":"A component library URL pointing at a removed GitHub release or npm tarball version, a private repo returning 403, a corporate proxy/blacklist intercepting the request, or a mistyped URL in an app's component library config.","solutions":["Check the exact statusText/HTTP code in the message: 404 means the tarball URL no longer exists — fix or update the URL","403/401: add auth or make the tarball publicly downloadable; GitHub raw/release URLs must not be private","Verify network egress — the fetch goes through fetchWithBlacklist, so ensure the host is not blacklisted and no proxy/VPN blocks it","Retry the operation once network is restored if statusText indicates 502/503"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"const head = await fetch(url, { method: \"HEAD\" })\nif (!head.ok) throw new Error(`Tarball URL invalid: ${head.status}`)","typeGuard":null,"tryCatchPattern":"try {\n  await download(url, path)\n} catch (err) {\n  if (err.message.startsWith(\"unexpected response\")) {\n    // inspect status, fix URL/auth, retry\n  }\n  throw err\n}","preventionTips":["HEAD-check tarball URLs before automating downloads","Pin versions of component libraries so URLs never rot","Ensure server egress/proxy allows the download host","Make release assets public or pre-mirror them"],"tags":["http","network","tarball-download"],"backgroundTag":"http-non-ok-response","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}