Zackriya-Solutions/meetily · error
Failed to open file for resume {}: {}
Error message
Failed to open file for resume {}: {} What it means
Returned by download_model_detailed when the server confirmed resume (206 Partial Content) but fs::OpenOptions::append(true).open(&file_path) fails on the existing partial file. The partial file was verified to exist moments earlier (its size drove the Range header), so this is a handle/permission problem on that file rather than a missing file in the common case.
Source
Thrown at frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs:814
return Err(anyhow!("Retry failed for {} with status: {}", filename, response.status()));
}
(response.content_length().unwrap_or(0), false)
}
} else {
// Other errors
let mut active = self.active_downloads.write().await;
active.remove(model_name);
return Err(anyhow!("Download failed for {} with status: {}", filename, response.status()));
};
// Open file for writing (append if resuming, create new if not)
let file = if resuming {
fs::OpenOptions::new()
.append(true)
.open(&file_path)
.await
.map_err(|e| anyhow!("Failed to open file for resume {}: {}", filename, e))?
} else {
fs::File::create(&file_path)
.await
.map_err(|e| anyhow!("Failed to create file {}: {}", filename, e))?
};
// Use buffered writer for better I/O performance (8MB buffer)
let mut writer = BufWriter::with_capacity(8 * 1024 * 1024, file);
// Stream download
use futures_util::StreamExt;
let mut stream = response.bytes_stream();
let mut file_downloaded = if resuming { existing_size } else { 0u64 };
loop {
// Check for cancellation before processing chunk
{
let cancel_flag = self.cancel_download_flag.read().await;View on GitHub (pinned to 0281737d87)
Solutions
- Retry the download after a short wait - transient locks usually clear and the partial file is still there
- If it persists, delete the partial file inside the model directory manually (open_parakeet_models_folder shows it) so the next attempt starts that file fresh instead of resuming
- Exclude the models directory from AV/sync tools
- Verify the models directory is writable by the app user
Defensive patterns
Strategy: retry
Validate before calling
// If resume keeps failing on a locked partial file, delete the partials so the
// next attempt starts that file fresh instead of resuming
let dir = engine.get_models_directory().await.join(name);
if dir.exists() {
let _ = tokio::fs::remove_dir_all(&dir).await; // engine re-creates and re-downloads
} Try / catch
match engine.download_model(name, None).await {
Err(e) if e.to_string().contains("Failed to open file for resume") => {
// wait for AV/sync handles to release, then retry; if it repeats,
// delete the partial file (or whole model dir) so no resume open is attempted
tokio::time::sleep(std::time::Duration::from_secs(5)).await;
engine.download_model(name, None).await
}
other => other,
} Prevention
- Exclude the models directory from AV and cloud-sync so partial files stay unlockable
- Do not clean the models folder manually while a resume is in flight
- If a specific partial file always fails to open, remove it once and let the download restart that file
When it happens
Trigger: AV or a sync client locked the partial .onnx between the size check and the open; the models directory or file permissions changed (read-only) while downloading; the partial file was deleted by another process between the stat and the open (then 'not found' surfaces here); OS-level handle exhaustion.
Common situations: Resuming a download on Windows with real-time AV scanning the large partial file; OneDrive/Dropbox syncing AppData; user manually cleaning the models folder while a resume is in flight.
Related errors
- Failed to delete incomplete file {}: {}
- Failed to delete directory '{}': {}
- Failed to create model directory: {}
- Failed to open file for append: {}
- Failed to get current directory: {}
AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16).
Data as JSON: /api/errors/d37d7cd8054658c4.
Report an issue: GitHub.