{"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":955,"sourceCode":"            \"medium-q5_0\" => \"https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-medium-q5_0.bin\",\n            \"large-v3-turbo-q5_0\" => \"https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v3-turbo-q5_0.bin\",\n            \"large-v3-q5_0\" => \"https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v3-q5_0.bin\",\n\n            _ => return Err(anyhow!(\"Unsupported model: {}\", model_name))\n        };\n        \n        log::info!(\"Model URL for {}: {}\", model_name, model_url);\n        \n        // Generate correct filename - all models follow ggml-{model_name}.bin pattern\n        let filename = format!(\"ggml-{}.bin\", model_name);\n        let file_path = self.models_dir.join(&filename);\n        \n        log::info!(\"Downloading to file path: {}\", file_path.display());\n        \n        // Create models directory if it doesn't exist\n        if !self.models_dir.exists() {\n            fs::create_dir_all(&self.models_dir).await\n                .map_err(|e| anyhow!(\"Failed to create models directory: {}\", e))?;\n        }\n        \n        // Update model status to downloading\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        log::info!(\"Creating HTTP client and starting request...\");\n        let client = Client::new();\n        \n        log::info!(\"Sending GET request to: {}\", model_url);\n        let response = client.get(model_url).send().await\n            .map_err(|e| anyhow!(\"Failed to start download: {}\", e))?;\n        \n        log::info!(\"Received response with status: {}\", response.status());","sourceCodeStart":937,"sourceCodeEnd":973,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/whisper_engine/whisper_engine.rs#L937-L973","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":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}