{"record":{"id":"731651f52f909f39","repo":"remotion-dev/remotion","slug":"failed-to-download-whisper-model","errorCode":null,"errorMessage":"Failed to download whisper model","messagePattern":"Failed to download whisper model","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/install-whisper-cpp/src/download.ts","lineNumber":23,"sourceCode":"\tfileStream,\n\turl,\n\tprintOutput,\n\tonProgress,\n\tsignal,\n}: {\n\tfileStream: NodeJS.WritableStream;\n\turl: string;\n\tprintOutput: boolean;\n\tonProgress: OnProgress | undefined;\n\tsignal: AbortSignal | null;\n}) => {\n\tconst {body, headers} = await fetch(url, {\n\t\tsignal,\n\t});\n\tconst contentLength = headers.get('content-length');\n\n\tif (body === null) {\n\t\tthrow new Error('Failed to download whisper model');\n\t}\n\n\tif (contentLength === null) {\n\t\tthrow new Error('Content-Length header not found');\n\t}\n\n\tlet downloaded = 0;\n\tlet lastPrinted = 0;\n\n\tconst totalFileSize = parseInt(contentLength, 10);\n\n\tconst reader = body.getReader();\n\t// eslint-disable-next-line no-async-promise-executor\n\tawait new Promise<void>(async (resolve, reject) => {\n\t\ttry {\n\t\t\twhile (true) {\n\t\t\t\tconst {done, value} = await reader.read();\n","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/install-whisper-cpp/src/download.ts#L5-L41","documentation":"Thrown by the internal `downloadFile` helper in @remotion/install-whisper-cpp when the `fetch(url)` call resolves but `body` is null, i.e. the server returned a response with no readable body stream. Without a body there is nothing to stream to disk, so the download aborts immediately.","triggerScenarios":"The model/zip URL returns a response with a null body (e.g. a 204, a redirect handled oddly, or a server returning an empty body with a 200). The check is `if (body === null)` right after destructuring the fetch response.","commonSituations":"A transient server-side issue at GitHub Releases or HuggingFace; a corporate proxy that strips the body; the URL points to a directory listing or HTML error page with no body; an expired/invalid signed URL.","solutions":["Retry the download; null bodies are usually transient.","Open the URL in a browser or curl it to confirm it actually returns the binary file.","If behind a proxy, configure `HTTPS_PROXY`/`HTTP_PROXY` and verify the proxy forwards binary bodies.","Update @remotion/install-whisper-cpp in case the source URL changed."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Probe the URL returns a real body before committing to the stream.\nasync function urlHasBody(url: string): Promise<boolean> {\n  const res = await fetch(url, {method: 'GET'});\n  return res.body !== null;\n}","typeGuard":null,"tryCatchPattern":"async function downloadWithRetry(url: string, attempts = 3) {\n  for (let i = 0; i < attempts; i++) {\n    try {\n      return await downloadFile({...});\n    } catch (err) {\n      if (/Failed to download whisper model/.test(String(err)) && i < attempts - 1) continue;\n      throw err;\n    }\n  }\n}","preventionTips":["Use the official HuggingFace/GitHub URLs which reliably return a body.","Retry transient null-body responses rather than treating them as permanent.","If behind a proxy, verify it forwards binary response bodies."],"tags":["whisper","network","download","fetch"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}