{"record":{"id":"d95e54fb17dcae22","repo":"Zackriya-Solutions/meetily","slug":"has-bytes-expected-exactly-bytes","errorCode":null,"errorMessage":"{} has {} bytes, expected exactly {} bytes","messagePattern":"(.+?) has (.+?) bytes, expected exactly (.+?) bytes","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs","lineNumber":419,"sourceCode":"                available_models.insert(model.name.clone(), model.clone());\n            }\n            drop(available_models);\n            drop(active_downloads);\n\n            for (model_name, error) in validation_errors {\n                log::warn!(\"Model directory {} appears corrupted: {}\", model_name, error);\n            }\n            return Ok(models);\n        }\n    }\n\n    fn validate_model_directory(model_dir: &Path, artifacts: &[ArtifactSpec]) -> Result<()> {\n        for artifact in artifacts {\n            let path = model_dir.join(artifact.filename);\n            let metadata = std::fs::metadata(&path)\n                .map_err(|error| anyhow!(\"Failed to read {} metadata: {}\", artifact.filename, error))?;\n            if metadata.len() != artifact.exact_bytes {\n                return Err(anyhow!(\n                    \"{} has {} bytes, expected exactly {} bytes\",\n                    artifact.filename,\n                    metadata.len(),\n                    artifact.exact_bytes\n                ));\n            }\n        }\n\n        Ok(())\n    }\n\n    /// Load a Parakeet model\n    pub async fn load_model(&self, model_name: &str) -> Result<()> {\n        let model_info = {\n            let models = self.available_models.read().await;\n            models\n                .get(model_name)\n                .cloned()","sourceCodeStart":401,"sourceCodeEnd":437,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/a2cb62e827da7ef59f65064c97233efb2313878e/frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs#L401-L437","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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)"],"exampleFix":"// before: accepting whatever file is present\nlet f = model_dir.join(\"encoder.onnx\"); // 4,998,123 bytes, expected 5,000,000\n// after: re-download with size verification\nif std::fs::metadata(&f)?.len() != spec.exact_bytes { std::fs::remove_file(&f)?; download_artifact(spec)?; }","handlingStrategy":"validation","validationCode":"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) }","typeGuard":null,"tryCatchPattern":"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 }","preventionTips":["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"],"tags":["filesystem","model-validation","integrity","download"],"backgroundTag":"checksum-mismatch","analyzedSha":"a2cb62e827da7ef59f65064c97233efb2313878e","analyzedAt":"2026-09-12T11:12:14.152Z","contentChangedAt":"2026-09-12T11:12:14.152Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}