Zackriya-Solutions/meetily · error
Failed to create file: {}
Error message
Failed to create file: {} What it means
fs::File::create failed for the destination GGUF when starting a fresh (non-resume) download in the summary model manager. Same failure class as the parakeet variant: missing parent directory, no write permission, full disk, or a locked target path. Nothing has been downloaded yet when this fires.
Source
Thrown at frontend/src-tauri/src/summary/summary_engine/model_manager.rs:528
let mut active = self.active_downloads.write().await;
active.remove(model_name);
return Err(anyhow!("Download failed with status: {}", response.status()));
};
log::info!("Total size: {} MB", total_size / (1024 * 1024));
// Open file for append if resuming, or create new
let file = if resuming {
OpenOptions::new()
.write(true)
.append(true)
.open(&file_path)
.await
.map_err(|e| anyhow!("Failed to open file for append: {}", e))?
} else {
fs::File::create(&file_path)
.await
.map_err(|e| anyhow!("Failed to create file: {}", e))?
};
// Use 8MB buffer to reduce disk I/O syscalls (major performance improvement)
let mut writer = BufWriter::with_capacity(8 * 1024 * 1024, file);
let mut downloaded: u64 = if resuming { existing_size } else { 0 };
// Emit initial progress (showing resumed position if applicable)
if let Some(ref callback) = progress_callback {
callback(DownloadProgress::new(downloaded, total_size, 0.0));
}
log::info!(
"Starting at {:.1} MB / {:.1} MB",
downloaded as f64 / (1024.0 * 1024.0),
total_size as f64 / (1024.0 * 1024.0)
);
let mut last_progress_percent = if total_size > 0 {View on GitHub (pinned to 0281737d87)
Solutions
- Create the parent directory with create_dir_all before File::create
- Check write permissions and free space on the models volume
- Exclude the models directory from antivirus/sync
- Report io::ErrorKind in the UI to distinguish permissions from disk space
Example fix
// before
let file = fs::File::create(&file_path)
.await
.map_err(|e| anyhow!("Failed to create file: {}", e))?;
// after
if let Some(parent) = file_path.parent() {
tokio::fs::create_dir_all(parent).await?;
}
let file = fs::File::create(&file_path)
.await
.map_err(|e| anyhow!("Failed to create file: {}", e))? Defensive patterns
Strategy: validation
Validate before calling
// Pre-flight: ensure directory exists and is writable before download
tokio::fs::create_dir_all(&models_dir).await?;
let probe = models_dir.join(".probe");
tokio::fs::write(&probe, b"x").await?;
tokio::fs::remove_file(&probe).await?;
manager.download_model_detailed(name, cb).await Try / catch
match download_result {
Err(e) if e.to_string().starts_with("Failed to create file") => {
check_permissions_and_disk(); // local issue: fix before retrying
}
other => other,
} Prevention
- Create <app_data>/models/summary at startup with create_dir_all
- Verify free space exceeds the model size before download
- Exclude the models directory from real-time antivirus scanning
When it happens
Trigger: Fresh download of a summary model while <app_data>/models/summary does not exist, is read-only, or the disk is full; the target path locked by antivirus or a sync client at creation time.
Common situations: First download after a fresh install before the directory is created; app data dir on a full volume; Windows Defender locking new .gguf files.
Related errors
- Failed to create file {}: {}
- Failed to flush file: {}
- Failed to write chunk to file: {}
- Failed to flush file {}: {}
- Failed to open file for append: {}
AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16).
Data as JSON: /api/errors/859c378cf02027e7.
Report an issue: GitHub.