Zackriya-Solutions/meetily · error · anyhow::Error
Downloaded model file is too small: {} bytes (expected at le
Error message
Downloaded model file is too small: {} bytes (expected at least {} bytes) What it means
After a Whisper model download, the engine estimates a minimum plausible size (90% of the model's known size in MB, converted to bytes) and checks the downloaded file's metadata against it. If the file is smaller than that floor, it fails with this message because the file is almost certainly truncated or corrupt rather than a valid model.
Source
Thrown at frontend/src-tauri/src/whisper_engine/whisper_engine.rs:980
if !active_owner_matches {
log::warn!("Download owner for {} was no longer active during finalization", model_name);
active_download.completion.send_replace(true);
return result;
}
if result.is_ok() && !active_download.cancellation.is_cancelled() {
result = self.validate_model_file(file_path).await;
if result.is_ok() {
let expected_min_size = WHISPER_MODEL_CATALOG
.iter()
.find(|model| model.0 == model_name)
.map(|model| ((model.2 as f64 * 0.9) as u64) * 1024 * 1024);
result = match expected_min_size {
Some(expected_min_size) => match fs::metadata(file_path).await {
Ok(metadata) if metadata.len() >= expected_min_size => Ok(()),
Ok(metadata) => Err(anyhow!(
"Downloaded model file is too small: {} bytes (expected at least {} bytes)",
metadata.len(),
expected_min_size
)),
Err(e) => Err(anyhow!(
"Failed to read downloaded model file metadata: {}",
e
)),
},
None => Err(anyhow!(
"Unsupported model for download validation: {}",
model_name
)),
};
}
}
if result.is_err() && !active_download.cancellation.is_cancelled() && file_path.exists() {View on GitHub (pinned to a2cb62e827)
Solutions
- Delete the truncated model file and re-run the download on a stable connection.
- Check free disk space in the models directory; free space if low and retry.
- Bypass proxies/VPNs or retry from a different network to rule out content filtering truncating the transfer.
- If it recurs for one model, verify the server-side file size matches the known model size and update the model registry entry.
Example fix
// before
result = match fs::metadata(file_path).await {
Ok(metadata) if metadata.len() >= expected_min_size => Ok(()),
Ok(metadata) => Err(anyhow!("Downloaded model file is too small: {} bytes (expected at least {} bytes)", metadata.len(), expected_min_size)),
// after (validate before finishing, re-download once if too small)
if fs::metadata(file_path).await.map(|m| m.len()).unwrap_or(0) < expected_min_size {
download_to_file(url, file_path).await?;
}
result = match fs::metadata(file_path).await {
Ok(metadata) if metadata.len() >= expected_min_size => Ok(()),
Ok(metadata) => Err(anyhow!("Downloaded model file is too small: {} bytes (expected at least {} bytes)", metadata.len(), expected_min_size)), Defensive patterns
Strategy: validation
Validate before calling
// Pre-check after any manual download
const meta = await stat(modelPath);
const minBytes = Math.floor(knownSizeMb * 0.9) * 1024 * 1024;
if (meta.size < minBytes) throw new Error(`model too small: ${meta.size} < ${minBytes}`); Try / catch
// TypeScript (Tauri invoke caller)
try {
await invoke('download_model_from_url', { url, modelName });
} catch (e) {
if (String(e).includes('too small')) {
await invoke('delete_model_file', { modelName });
await invoke('download_model_from_url', { url, modelName }); // one retry
} else { throw e; }
} Prevention
- Download models on stable connections; avoid flaky Wi-Fi or metered connections that drop mid-transfer.
- Keep sufficient free disk space in the model storage directory.
- Compare Content-Length with the expected model size before accepting the response.
- Use downloaders that fail on partial bodies rather than silently saving truncated files.
When it happens
Trigger: Raised in finish_download (called from download_model_from_url) when fs::metadata(file_path).len() < expected_min_size, where expected_min_size = 0.9 * known model size in MB * 1024 * 1024 — i.e., the downloaded file is under 90% of the expected model size.
Common situations: Network drop mid-download leaving a truncated file that the HTTP layer treated as complete; disk-full silently shortening the write; a server/proxy returning a partial body or an error page far smaller than the model; pausing/resuming downloads with a client that doesn't support range requests.
Understand the failure class
Background: "File too large" / "file size exceeds limit" errors: why libraries cap file sizes and how to fix them — this error's family across 46 libraries.
Related errors
- Failed to start download: {}
- Retry failed for {}: {}
- Download timeout - No data received for 30 seconds
- {}: {}
- Download cancelled by user
AI-assisted analysis of Zackriya-Solutions/meetily@a2cb62e827 (2026-09-12).
Data as JSON: /api/errors/b36b7910b0ad6edc.
Report an issue: GitHub.