{"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":624,"sourceCode":"                \"nemo128.onnx\",\n                \"vocab.txt\",\n            ],\n            QuantizationType::FP32 => vec![\n                \"encoder-model.onnx\",\n                \"decoder_joint-model.onnx\",\n                \"nemo128.onnx\",\n                \"vocab.txt\",\n            ],\n        };\n\n        // Create model directory\n        let model_dir = &model_info.path;\n        if !model_dir.exists() {\n            if let Err(e) = fs::create_dir_all(model_dir).await {\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!(\"Failed to create model directory: {}\", e));\n            }\n        }\n\n        // Clean up incomplete downloads before starting\n        log::info!(\"Checking for incomplete model files to clean up...\");\n        if let Err(e) = self.clean_incomplete_model_directory(model_dir).await {\n            log::warn!(\"Failed to clean incomplete model directory: {}\", e);\n            // Continue anyway - we'll handle errors during download\n        }\n\n        // Optimized HTTP client for large file downloads\n        let client = reqwest::Client::builder()\n            .tcp_nodelay(true)              // Disable Nagle's algorithm for better streaming\n            .pool_max_idle_per_host(1)      // Keep connection alive\n            .timeout(Duration::from_secs(3600))  // 1 hour timeout for large files\n            .connect_timeout(Duration::from_secs(30))\n            .build()\n            .map_err(|e| anyhow!(\"Failed to create HTTP client: {}\", e))?;","sourceCodeStart":606,"sourceCodeEnd":642,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs#L606-L642","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":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}