Zackriya-Solutions/meetily · error
{} has {} bytes, expected exactly {} bytes
Error message
{} has {} bytes, expected exactly {} bytes What it means
Thrown by validate_model_directory when an artifact exists but its size on disk does not exactly match the expected exact_bytes from the ArtifactSpec. The Parakeet engine requires byte-exact artifacts, so any truncated, padded, or tampered file is rejected before the model is loaded.
Source
Thrown at frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs:419
available_models.insert(model.name.clone(), model.clone());
}
drop(available_models);
drop(active_downloads);
for (model_name, error) in validation_errors {
log::warn!("Model directory {} appears corrupted: {}", model_name, error);
}
return Ok(models);
}
}
fn validate_model_directory(model_dir: &Path, artifacts: &[ArtifactSpec]) -> Result<()> {
for artifact in artifacts {
let path = model_dir.join(artifact.filename);
let metadata = std::fs::metadata(&path)
.map_err(|error| anyhow!("Failed to read {} metadata: {}", artifact.filename, error))?;
if metadata.len() != artifact.exact_bytes {
return Err(anyhow!(
"{} has {} bytes, expected exactly {} bytes",
artifact.filename,
metadata.len(),
artifact.exact_bytes
));
}
}
Ok(())
}
/// Load a Parakeet model
pub async fn load_model(&self, model_name: &str) -> Result<()> {
let model_info = {
let models = self.available_models.read().await;
models
.get(model_name)
.cloned()View on GitHub (pinned to a2cb62e827)
Solutions
- Delete the offending artifact (or the whole model directory) and re-download the model through the app so sizes match the spec
- Ensure downloads are resumed using Content-Range validation so partial files are not accepted
- Check you downloaded the exact model variant/quantization matching the app's ArtifactSpec
- Verify available disk space and that no antivirus truncated the file
- Update the app if the upstream model release changed file sizes (spec must be updated too)
Example fix
// before: accepting whatever file is present
let f = model_dir.join("encoder.onnx"); // 4,998,123 bytes, expected 5,000,000
// after: re-download with size verification
if std::fs::metadata(&f)?.len() != spec.exact_bytes { std::fs::remove_file(&f)?; download_artifact(spec)?; } Defensive patterns
Strategy: validation
Validate before calling
fn artifact_size_matches(model_dir: &Path, filename: &str, expected: u64) -> bool { std::fs::metadata(model_dir.join(filename)).map(|m| m.len() == expected).unwrap_or(false) } Try / catch
match load_parakeet_model(name) { Err(e) if e.to_string().contains("expected exactly") => { delete_model_dir(model_dir)?; download_model(name).await?; load_parakeet_model(name).await }, other => other } Prevention
- Only obtain model files via the app's own downloader (it enforces exact sizes)
- Check disk free space before large model downloads
- Keep the app and its baked-in artifact specs in sync; re-download after app updates that change model versions
- Never swap in model files from a different variant/quantization
When it happens
Trigger: Post-download validation or model-load check finds e.g. an encoder file of 4,998,123 bytes where the spec requires 5,000,000 — usually from an interrupted/partial download, a truncated transfer, or a version mismatch between the downloaded model release and the artifact spec baked into the app.
Common situations: Network drop during model download left a partial file that later passes a resume check incorrectly; user replaced a model file with a different quantization/variant; model host updated the artifact bytes while the app still expects old sizes; disk-full during write.
Understand the failure class
Background: Checksum mismatch errors: "checksum verification failed", "digest mismatch", "expected vs actual checksum" — what they mean and how to fix them — this error's family across 41 libraries.
Related errors
- Failed to delete incomplete file {}: {}
- Failed to open file for resume {}: {}
- Failed to create file {}: {}
- Failed to write chunk to file: {}
- Failed to open file for append: {}
AI-assisted analysis of Zackriya-Solutions/meetily@a2cb62e827 (2026-09-12).
Data as JSON: /api/errors/d95e54fb17dcae22.
Report an issue: GitHub.