{"record":{"id":"bebe0e207c01ec54","repo":"Zackriya-Solutions/meetily","slug":"failed-to-create-model-directory","errorCode":null,"errorMessage":"Failed to create model directory: {}","messagePattern":"Failed to create model directory: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs","lineNumber":863,"sourceCode":"        )\n        .await\n    }\n\n    async fn download_artifacts(\n        &self,\n        model_name: &str,\n        model_dir: &Path,\n        base_url: &str,\n        artifacts: &[ArtifactSpec],\n        active_download: &ActiveDownload,\n        progress_callback: Option<Box<dyn Fn(DownloadProgress) + Send>>,\n    ) -> Result<(DownloadProgress, Option<Box<dyn Fn(DownloadProgress) + Send>>)> {\n        if active_download.cancellation.is_cancelled() {\n            return Err(DownloadCancelled.into());\n        }\n        fs::create_dir_all(model_dir)\n            .await\n            .map_err(|error| anyhow!(\"Failed to create model directory: {}\", error))?;\n\n        let client = reqwest::Client::builder()\n            .tcp_nodelay(true)\n            .pool_max_idle_per_host(1)\n            .timeout(Duration::from_secs(3600))\n            .connect_timeout(Duration::from_secs(30))\n            .build()\n            .map_err(|error| anyhow!(\"Failed to create HTTP client: {}\", error))?;\n        let total_bytes: u64 = artifacts.iter().map(|artifact| artifact.exact_bytes).sum();\n        let download_started = Instant::now();\n        let mut confirmed_bytes = 0u64;\n        let mut streamed_bytes = 0u64;\n        let mut bytes_since_report = 0u64;\n        let mut last_report = Instant::now();\n        let mut last_percent = 0u8;\n\n        for artifact in artifacts {\n            if active_download.cancellation.is_cancelled() {","sourceCodeStart":845,"sourceCodeEnd":881,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/a2cb62e827da7ef59f65064c97233efb2313878e/frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs#L845-L881","documentation":"Returned by download_model_detailed when fs::create_dir_all fails on the target model directory (models_dir/<name>, e.g. under ~/Library/Application Support/Meetily/models or %APPDATA%\\Meetily\\models). The active_downloads entry is removed before the error is returned, so the failed attempt does not block retries.","triggerScenarios":"The models directory or its parent is read-only or owned by another user; the disk is full; the path is invalid on the platform (restored backup with wrong permissions, sandboxed app container denying writes); corporate policy blocks writes to Application Support/AppData.","commonSituations":"Disk full before a ~670 MB download starts; permissions broken after migrating user accounts or restoring from backup; macOS app sandbox or managed-device policy denying the Application Support path; OneDrive/Folder-Redirection on Windows making AppData unavailable.","solutions":["Check free disk space - the v3 int8 model needs roughly 670 MB plus buffer","Verify write permission on the models dir (shown by parakeet_get_models_directory / open_parakeet_models_folder) and fix ownership/permissions","If policy or sandboxing blocks the default location, point the app at a writable custom models directory instead of the default","Retry the download after fixing - the failed attempt cleaned up its active-download entry"],"exampleFix":"// before\nengine.download_model(name, None).await?;\n\n// after - preflight the models dir before downloading\nlet dir = engine.get_models_directory().await;\nlet probe = dir.join(\".write_test\");\ntokio::fs::write(&probe, b\"x\").await\n    .map_err(|e| anyhow!(\"models dir {} not writable: {e}\", dir.display()))?;\nlet _ = tokio::fs::remove_file(&probe).await;\nengine.download_model(name, None).await?;","handlingStrategy":"validation","validationCode":"// Preflight: writable models dir and enough free space (~700 MB per model)\nlet dir = engine.get_models_directory().await;\ntokio::fs::create_dir_all(&dir).await?; // same op the engine will do\nlet probe = dir.join(\".probe\");\ntokio::fs::write(&probe, b\"x\").await?;\nlet _ = tokio::fs::remove_file(&probe).await;\n// check free space via the appropriate platform API before offering the download","typeGuard":null,"tryCatchPattern":"match engine.download_model(name, None).await {\n    Err(e) if e.to_string().contains(\"Failed to create model directory\") => {\n        // surface a dedicated 'check disk space / permissions' message with the dir path;\n        // the engine already cleaned its active-download entry, so a retry is safe after fixing\n        return Err(e);\n    }\n    other => other?,\n}","preventionTips":["Check free disk space (>= 1 GB) before starting a model download","Verify the Application Support / AppData models folder is writable on managed machines","Watch for OneDrive/Folder Redirection on Windows breaking AppData writes"],"tags":["parakeet","filesystem","permissions","disk-space","download"],"backgroundTag":"filesystem-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"}