remotion-dev/remotion · error · Error

Failed to download whisper model

Error message

Failed to download whisper model

What it means

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.

Source

Thrown at packages/install-whisper-cpp/src/download.ts:23

	fileStream,
	url,
	printOutput,
	onProgress,
	signal,
}: {
	fileStream: NodeJS.WritableStream;
	url: string;
	printOutput: boolean;
	onProgress: OnProgress | undefined;
	signal: AbortSignal | null;
}) => {
	const {body, headers} = await fetch(url, {
		signal,
	});
	const contentLength = headers.get('content-length');

	if (body === null) {
		throw new Error('Failed to download whisper model');
	}

	if (contentLength === null) {
		throw new Error('Content-Length header not found');
	}

	let downloaded = 0;
	let lastPrinted = 0;

	const totalFileSize = parseInt(contentLength, 10);

	const reader = body.getReader();
	// eslint-disable-next-line no-async-promise-executor
	await new Promise<void>(async (resolve, reject) => {
		try {
			while (true) {
				const {done, value} = await reader.read();

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Retry the download; null bodies are usually transient.
  2. Open the URL in a browser or curl it to confirm it actually returns the binary file.
  3. If behind a proxy, configure `HTTPS_PROXY`/`HTTP_PROXY` and verify the proxy forwards binary bodies.
  4. Update @remotion/install-whisper-cpp in case the source URL changed.
Defensive patterns

Strategy: retry

Validate before calling

// Probe the URL returns a real body before committing to the stream.
async function urlHasBody(url: string): Promise<boolean> {
  const res = await fetch(url, {method: 'GET'});
  return res.body !== null;
}

Try / catch

async function downloadWithRetry(url: string, attempts = 3) {
  for (let i = 0; i < attempts; i++) {
    try {
      return await downloadFile({...});
    } catch (err) {
      if (/Failed to download whisper model/.test(String(err)) && i < attempts - 1) continue;
      throw err;
    }
  }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/731651f52f909f39. Report an issue: GitHub.