Zackriya-Solutions/meetily · error

File validation failed: {}

Error message

File validation failed: {}

What it means

After the download stream completes, ModelManager runs validate_model_file on the result; this error wraps any validation failure. It means bytes were received until the stream ended, but the resulting file is not a usable model - usually a truncated body that ended 'cleanly' or content that is not a GGUF at all.

Source

Thrown at frontend/src-tauri/src/summary/summary_engine/model_manager.rs:751

        if let Err(e) = self.validate_gguf_file(&file_path).await {
            log::error!("Downloaded file failed validation: {}", e);

            // Clean up invalid file
            let _ = fs::remove_file(&file_path).await;

            // Update status
            {
                let mut models = self.available_models.write().await;
                if let Some(model_info) = models.get_mut(model_name) {
                    model_info.status = ModelStatus::Error(format!("Validation failed: {}", e));
                }
            }

            // Remove from active downloads
            let mut active = self.active_downloads.write().await;
            active.remove(model_name);

            return Err(anyhow!("File validation failed: {}", e));
        }

        // Update status to available
        {
            let mut models = self.available_models.write().await;
            if let Some(model_info) = models.get_mut(model_name) {
                model_info.status = ModelStatus::Available;
                model_info.path = file_path.clone();
            }
        }

        // Remove from active downloads
        {
            let mut active = self.active_downloads.write().await;
            active.remove(model_name);
        }

        Ok(())

View on GitHub (pinned to 0281737d87)

Solutions

  1. Retry the download - status is Error so the UI retry button appears
  2. Delete the corrupted partial file (delete_model) first so the retry starts from byte zero
  3. Verify disk space and network stability before retrying
  4. If it persists, download the GGUF manually into app_data/models/summary/<gguf_file> with the exact expected filename, then refresh models
Defensive patterns

Strategy: retry

Validate before calling

// After download completes (caller-side sanity): size must match Content-Length
let meta = std::fs::metadata(&file_path)?;
if expected_size > 0 && meta.len() != expected_size {
    std::fs::remove_file(&file_path)?; // drop truncated file
    return Err(anyhow!("truncated download: {} != {}", meta.len(), expected_size));
}

Try / catch

try { manager.download_model(name).await? }
catch (e) if e.to_string().contains("File validation failed") {
    manager.delete_model(name).await.ok();       // remove corrupt file
    manager.download_model(name).await?;          // fresh retry
}

Prevention

When it happens

Trigger: download_model finishes the stream but the file fails the post-download check (typically the magic-number check). The manager sets ModelStatus::Error('Validation failed: ...'), removes the model from active_downloads, and returns this error.

Common situations: Server/proxy closing the connection early without a stream error so the tail of the file is missing, disk filling near the end of the download so final bytes were lost, resuming a partial file whose bytes no longer match the current response body.

Related errors


AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16). Data as JSON: /api/errors/dbbb09a676a51d0a. Report an issue: GitHub.