Zackriya-Solutions/meetily · error
Failed to create temporary WAV file: {}
Error message
Failed to create temporary WAV file: {} What it means
The FFmpeg conversion deliberately creates its temp WAV in the input file's directory (tempfile_in(parent_dir)) to avoid cross-device rename/link issues — so it needs write permission in the source folder. This io::Error means tempfile could not create .meetily_decode_*.wav there: a read-only directory (mounted media, Windows protected folders, read-only network share), a full disk, or the directory disappearing between file selection and import.
Source
Thrown at frontend/src-tauri/src/audio/decoder.rs:297
) -> Result<tempfile::TempPath> {
let ffmpeg_path = find_ffmpeg_path().ok_or_else(|| {
anyhow!(
"FFmpeg not found. FFmpeg is required to decode .{} files. \
It will be downloaded automatically on next launch, or install it manually.",
input_path
.extension()
.and_then(|e| e.to_str())
.unwrap_or("this format")
)
})?;
// Create temp file in the same directory as the input to avoid cross-device issues
let parent_dir = input_path.parent().unwrap_or_else(|| Path::new("."));
let temp_file = tempfile::Builder::new()
.prefix(".meetily_decode_")
.suffix(".wav")
.tempfile_in(parent_dir)
.map_err(|e| anyhow!("Failed to create temporary WAV file: {}", e))?;
let temp_path = temp_file.into_temp_path();
info!(
"Converting .{} to temporary WAV via ffmpeg: {} -> {}",
input_path
.extension()
.and_then(|e| e.to_str())
.unwrap_or("unknown"),
input_path.display(),
temp_path.display()
);
if let Some(cb) = progress_callback {
cb(0, "Converting audio format with FFmpeg...");
}
let input_str = input_pathView on GitHub (pinned to 0281737d87)
Solutions
- Copy the file to a writable location (Desktop/Documents) and import the copy.
- On Windows, remove the folder from Controlled Folder Access / protected folders, or grant the app write access there.
- Free disk space on the volume holding the input file.
- Code fix: fall back to std::env::temp_dir() when tempfile_in(parent_dir) fails with PermissionDenied (see exampleFix).
Example fix
// before
let temp_file = tempfile::Builder::new()
.prefix(".meetily_decode_")
.suffix(".wav")
.tempfile_in(parent_dir)
.map_err(|e| anyhow!("Failed to create temporary WAV file: {}", e))?;
// after — fall back to the system temp dir when the input dir is read-only
let temp_file = match tempfile::Builder::new()
.prefix(".meetily_decode_")
.suffix(".wav")
.tempfile_in(parent_dir)
{
Ok(f) => f,
Err(e) if e.kind() == std::io::ErrorKind::PermissionDenied => {
tempfile::Builder::new()
.prefix(".meetily_decode_")
.suffix(".wav")
.tempfile_in(std::env::temp_dir())?
}
Err(e) => return Err(anyhow!("Failed to create temporary WAV file: {}", e)),
}; Defensive patterns
Strategy: fallback
Validate before calling
// Rust — copy read-only sources to a writable temp dir before decoding
let work_path = if dir_is_writable(parent_dir) { path.to_path_buf() } else { copy_to_temp(path)? }; Try / catch
match convert_to_wav_with_ffmpeg(&path, None) {
Err(e) if e.to_string().contains("temporary WAV") => {
// retry with the input copied into a writable directory
}
other => other,
} Prevention
- Copy files from read-only media (SD cards, protected shares) into app storage before decoding.
- Keep std::env::temp_dir() as a fallback location for tempfile creation.
- Check free disk space before starting a large import.
When it happens
Trigger: Importing audio from an SD card or read-only mount; Windows 'Controlled Folder Access' blocking writes next to the input; importing from a read-only SMB share; disk full at conversion time; parent directory deleted after the picker closed.
Common situations: Users dragging files straight from cameras, phones in MTP mode, DVD rips, or cloud-sync folders marked read-only; low-disk machines during long imports.
Related errors
- Failed to spawn ffmpeg process: {}
- FFmpeg not found. FFmpeg is required to decode .{} files. It
- Invalid input path (non-UTF8)
- Invalid temp path (non-UTF8)
- Failed to wait for ffmpeg process: {}
AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16).
Data as JSON: /api/errors/fc2c297727aa201c.
Report an issue: GitHub.