remotion-dev/remotion · error · Error
Content-Length header not found
Error message
Content-Length header not found
What it means
Thrown by the internal `downloadFile` helper when the response from `fetch(url)` has no `content-length` header. The helper requires a known total size to drive its progress reporting and validation, so a missing header is a hard error rather than a silent best-effort download.
Source
Thrown at packages/install-whisper-cpp/src/download.ts:27
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();
if (value) {
downloaded += value.length;
if (View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Use the default official URLs (HuggingFace for models, GitHub Releases for whisper.cpp) which include content-length.
- If a proxy is stripping the header, bypass it or reconfigure it to preserve `content-length`.
- Host the binary on a server/CDN that sends `Content-Length` (e.g. S3 with a known object size).
- Retry in case of a transient proxy issue.
Defensive patterns
Strategy: validation
Validate before calling
async function urlReportsLength(url: string): Promise<boolean> {
const res = await fetch(url, {method: 'HEAD'});
return res.headers.get('content-length') !== null;
}
if (!await urlReportsLength(modelUrl)) {
throw new Error('Mirror must send Content-Length; pick the official URL.');
} Prevention
- Use the default official URLs (HuggingFace for models, GitHub Releases for whisper.cpp) which include content-length.
- If mirroring, choose object storage (e.g. S3) that emits a known content-length.
- Check that proxies in the path preserve content-length rather than re-chunking.
When it happens
Trigger: The server responds with `Transfer-Encoding: chunked` and no `Content-Length`, or a proxy strips the header. The official HuggingFace and GitHub Release URLs normally include it, so a missing header points at an intermediary.
Common situations: Corporate proxies or firewalls that re-chunk responses; a mirror/CDN that omits content-length; pointing at a custom URL that streams without a known length; HTTP/2 push configurations.
Related errors
- Failed to download whisper model
- Model ${model} already exists at ${filePath}, but the size i
- No published version is known for ${name}
- Failed to upgrade Remotion, see logs above
- The tag for Remotion version ${VERSION} was not found in the
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/6c31076497662ec5.
Report an issue: GitHub.