{"record":{"id":"b9ccd3048a1fc69e","repo":"Zackriya-Solutions/meetily","slug":"failed-to-create-file-b9ccd3","errorCode":null,"errorMessage":"Failed to create file: {}","messagePattern":"Failed to create file: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/whisper_engine/whisper_engine.rs","lineNumber":989,"sourceCode":"            .map_err(|e| anyhow!(\"Failed to start download: {}\", e))?;\n        \n        log::info!(\"Received response with status: {}\", response.status());\n        if !response.status().is_success() {\n            // Remove from active downloads on error\n            let mut active = self.active_downloads.write().await;\n            active.remove(model_name);\n            return Err(anyhow!(\"Download failed with status: {}\", response.status()));\n        }\n        \n        let total_size = response.content_length().unwrap_or(0);\n        log::info!(\"Response successful, content length: {} bytes ({:.1} MB)\", total_size, total_size as f64 / (1024.0 * 1024.0));\n        \n        if total_size == 0 {\n            log::warn!(\"Content length is 0 or unknown - download may not show accurate progress\");\n        }\n        \n        let mut file = fs::File::create(&file_path).await\n            .map_err(|e| anyhow!(\"Failed to create file: {}\", e))?;\n        \n        log::info!(\"File created successfully at: {}\", file_path.display());\n        \n        // Stream download with real progress reporting\n        log::info!(\"Starting streaming download...\");\n        log::info!(\"Expected size: {:.1} MB\", total_size as f64 / (1024.0 * 1024.0));\n\n        use futures_util::StreamExt;\n        let mut stream = response.bytes_stream();\n        let mut downloaded = 0u64;\n        let mut last_progress_report = 0u8;\n        let mut last_report_time = std::time::Instant::now();\n\n        // Emit initial 0% progress immediately\n        if let Some(ref callback) = progress_callback {\n            callback(0);\n        }\n","sourceCodeStart":971,"sourceCodeEnd":1007,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/whisper_engine/whisper_engine.rs#L971-L1007","documentation":"tokio fs::File::create on models_dir/ggml-<model>.bin failed before any bytes were written; the OS error is appended. Common errnos: PermissionDenied (locked or read-only), NotFound (parent vanished), ENOSPC (disk full), or Windows sharing violations on a leftover partial file.","triggerScenarios":"A partial ggml file from an interrupted earlier download is held open by AV or another instance (Windows sharing violation); models directory permissions changed; disk already full before the ~150MB–3GB write begins.","commonSituations":"Disk filled by a previous failed large-v3 download; antivirus scanning the stale partial .bin; models dir on an external drive that re-mounted read-only.","solutions":["Free disk space to at least the model's expected size (tiny ~75MB, base ~142MB, large-v3 ~3GB) plus margin","Delete the stale partial ggml-<model>.bin manually and retry","Fix write permissions on the models directory; ensure only one app instance runs"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Rust: check free space against expected size before creating the file\nconst EXPECTED_MIN: u64 = 75 * 1024 * 1024; // per-model table in production\nlet free = fs2::available_space(&self.models_dir)?;\nif free < EXPECTED_MIN {\n    return Err(anyhow!(\"Insufficient disk space: {} bytes free\", free));\n}","typeGuard":null,"tryCatchPattern":"try {\n  await invoke('download_model', { modelName });\n} catch (e) {\n  const msg = String(e);\n  if (msg.includes('Failed to create file')) {\n    if (msg.includes('denied')) showPermissionHelp();\n    else showDiskSpaceHelp();\n  } else { throw e; }\n}","preventionTips":["Check available disk space against the model's published size before starting the download","Clean up partial ggml files after failed downloads before retrying","Exclude the models directory from antivirus real-time scanning to avoid create-time locks"],"tags":["filesystem","download","permissions","disk-space","rust"],"backgroundTag":"file-create-permission-denied","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}