{"record":{"id":"0d317e5fb88440f8","repo":"Zackriya-Solutions/meetily","slug":"failed-to-create-models-directory","errorCode":null,"errorMessage":"Failed to create models directory: {}","messagePattern":"Failed to create models directory: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/whisper_engine/whisper_engine.rs","lineNumber":1133,"sourceCode":"            .await\n    }\n\n    async fn download_model_with_owner(\n        &self,\n        model_name: &str,\n        model_url: &str,\n        file_path: &PathBuf,\n        active_download: &ActiveDownload,\n        progress_callback: Option<Box<dyn Fn(u8) + Send>>,\n    ) -> Result<()> {\n        if active_download.cancellation.is_cancelled() {\n            return Err(DownloadCancelled.into());\n        }\n\n        if !self.models_dir.exists() {\n            fs::create_dir_all(&self.models_dir)\n                .await\n                .map_err(|e| anyhow!(\"Failed to create models directory: {}\", e))?;\n        }\n\n        {\n            let mut models = self.available_models.write().await;\n            if let Some(model_info) = models.get_mut(model_name) {\n                model_info.status = ModelStatus::Downloading { progress: 0 };\n            }\n        }\n\n        let client = Client::builder()\n            .user_agent(concat!(\"Meetily/\", env!(\"CARGO_PKG_VERSION\")))\n            .build()\n            .map_err(|e| anyhow!(\"Failed to create download client: {}\", e))?;\n        let response = tokio::select! {\n            biased;\n            _ = active_download.cancellation.cancelled() => return Err(DownloadCancelled.into()),\n            response = client.get(model_url).send() => response\n                .map_err(|e| anyhow!(\"Failed to start download: {}\", e))?,","sourceCodeStart":1115,"sourceCodeEnd":1151,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/a2cb62e827da7ef59f65064c97233efb2313878e/frontend/src-tauri/src/whisper_engine/whisper_engine.rs#L1115-L1151","documentation":"Before downloading, the engine runs tokio fs::create_dir_all on the configured models directory; this error means directory creation failed and the appended OS error explains why. No download starts. Typical errnos are PermissionDenied on the parent path or a read-only filesystem.","triggerScenarios":"Models directory (app-data dir, e.g. ~/Library/Application Support/Meetily/models or %APPDATA%\\Meetily\\models) is inside a location the process cannot write; a regular file exists at the directory path; sandboxed build without filesystem write entitlements.","commonSituations":"Corporate lockdown of user profile directories; running the app from a read-only install location; macOS sandbox entitlements missing after packaging changes; models dir redirected to an unmounted volume.","solutions":["Create the models directory manually and verify the app user can write to it (touch a file there)","Check ownership and permissions on every parent path of the models directory","For packaged/sandboxed builds, confirm the filesystem write entitlement covers the app-data directory"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Rust: probe writability before download\nasync fn models_dir_writable(dir: &Path) -> bool {\n    std::fs::create_dir_all(dir).is_ok()\n        && std::fs::write(dir.join(\".probe\"), b\"\").is_ok()\n        && std::fs::remove_file(dir.join(\".probe\")).is_ok()\n}","typeGuard":null,"tryCatchPattern":"try {\n  await invoke('download_model', { modelName });\n} catch (e) {\n  if (String(e).includes('Failed to create models directory')) {\n    showSetupHelp('Check permissions on the app-data models folder');\n  } else { throw e; }\n}","preventionTips":["Create and probe the models directory during app onboarding, not at first download","For packaged builds, verify sandbox entitlements grant write access to the app-data path","Log the resolved models_dir path at startup so permission issues are diagnosable"],"tags":["whisper","filesystem","permissions","setup","rust"],"backgroundTag":"directory-create-permission-denied","analyzedSha":"a2cb62e827da7ef59f65064c97233efb2313878e","analyzedAt":"2026-09-12T11:12:14.152Z","contentChangedAt":"2026-09-12T11:12:14.152Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}