Zackriya-Solutions/meetily · error · anyhow::Error

Failed to write {}: {}

Error message

Failed to write {}: {}

What it means

The download stream writes each received chunk to the destination file with `writer.write_all(&chunk)` on a tokio async file. If the OS or disk refuses the write, the engine maps the io::Error into `Failed to write <filename>: <io error>` and aborts the download. It is a filesystem-level failure, not a network failure.

Source

Thrown at frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs:1056

                        anyhow!("Failed to preserve {} after overlong response: {}", artifact.filename, error)
                    })?;
                    return Err(anyhow!(
                        "{} response exceeds its exact {} byte size",
                        artifact.filename,
                        artifact.exact_bytes
                    ));
                }
                let next_confirmed_bytes = confirmed_bytes
                    .checked_add(chunk_bytes)
                    .ok_or_else(|| anyhow!("Progress overflow while downloading {}", artifact.filename))?;
                if next_confirmed_bytes > total_bytes {
                    return Err(anyhow!("Download progress exceeds the catalog total"));
                }

                writer
                    .write_all(&chunk)
                    .await
                    .map_err(|error| anyhow!("Failed to write {}: {}", artifact.filename, error))?;
                artifact_bytes = next_artifact_bytes;
                confirmed_bytes = next_confirmed_bytes;
                streamed_bytes = streamed_bytes
                    .checked_add(chunk_bytes)
                    .ok_or_else(|| anyhow!("Streamed byte count overflow"))?;
                bytes_since_report = bytes_since_report
                    .checked_add(chunk_bytes)
                    .ok_or_else(|| anyhow!("Progress byte count overflow"))?;

                let progress = Self::in_flight_progress(confirmed_bytes, total_bytes, 0.0);
                let elapsed = last_report.elapsed();
                if progress.percent > last_percent
                    || elapsed >= Duration::from_millis(500)
                    || artifact_bytes == artifact.exact_bytes
                {
                    let speed_mbps = if elapsed.as_secs_f64() > 0.0 {
                        bytes_since_report as f64 / (1024.0 * 1024.0) / elapsed.as_secs_f64()
                    } else {

View on GitHub (pinned to a2cb62e827)

Solutions

  1. Free disk space — Parakeet artifacts are large, and ENOSPC is the most common cause.
  2. Check write permissions on the models directory and, if needed, `chmod`/take ownership or run the app under a user account with access.
  3. Close programs locking the partial file (antivirus quarantine/scan, backup tools, another app instance) and delete the partial file, then retry.
  4. Check disk health (S.M.A.R.T.) / dmesg for I/O errors if EIO appears in the message.
  5. Retry the download after fixing the underlying filesystem issue.

Example fix

// before: default models dir not writable in containerized/managed env
// after: ensure the directory exists and is writable before download
let dir = models_dir();
fs::create_dir_all(&dir).await?;
// or on the caller side (shell): chmod u+w "~/Library/Application Support/Meetily/models"
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-flight disk space and writability check before downloading
let free = fs2::free_space(&models_dir)?;
if free < artifact.exact_bytes * 2 {
    return Err(format!("Need {} bytes free, only {} available", artifact.exact_bytes * 2, free));
}
let probe = models_dir.join(".write_probe");
tokio::fs::write(&probe, b"ok").await?;
tokio::fs::remove_file(&probe).await?;

Try / catch

match download_result {
    Err(e) if e.to_string().contains("Failed to write") => {
        // inspect the embedded io::Error kind: StorageFull => free space,
        // PermissionDenied => fix perms, else check disk health
        eprintln!("Download aborted by filesystem error: {e}");
        cleanup_partial_file();
    }
    Err(e) => return Err(e),
    Ok(()) => {}
}

Prevention

When it happens

Trigger: `writer.write_all(&chunk).await` returns Err during the artifact chunk loop — the mapped anyhow error embeds the underlying OS error (ENOSPC, EACCES, EIO, etc.).

Common situations: Disk full while downloading a multi-hundred-MB model; no write permission to the models directory (~/Library/Application Support/Meetily/models or %APPDATA%\Meetily\models); antivirus/file-lock holding the partial file on Windows; disk hardware errors.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


AI-assisted analysis of Zackriya-Solutions/meetily@a2cb62e827 (2026-09-12). Data as JSON: /api/errors/df74a61df158e2f1. Report an issue: GitHub.