{"record":{"id":"ecbe3bb189c9155a","repo":"Zackriya-Solutions/meetily","slug":"could-not-find-system-data-directory","errorCode":null,"errorMessage":"Could not find system data directory","messagePattern":"Could not find system data directory","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs","lineNumber":141,"sourceCode":"\nimpl ParakeetEngine {\n    /// Create a new Parakeet engine with optional custom models directory\n    pub fn new_with_models_dir(models_dir: Option<PathBuf>) -> Result<Self> {\n        let models_dir = if let Some(dir) = models_dir {\n            dir.join(\"parakeet\") // Parakeet models in subdirectory\n        } else {\n            // Fallback to default location\n            let current_dir = std::env::current_dir()\n                .map_err(|e| anyhow!(\"Failed to get current directory: {}\", e))?;\n\n            if cfg!(debug_assertions) {\n                // Development mode\n                current_dir.join(\"models\").join(\"parakeet\")\n            } else {\n                // Production mode\n                dirs::data_dir()\n                    .or_else(|| dirs::home_dir())\n                    .ok_or_else(|| anyhow!(\"Could not find system data directory\"))?\n                    .join(\"Meetily\")\n                    .join(\"models\")\n                    .join(\"parakeet\")\n            }\n        };\n\n        log::info!(\"ParakeetEngine using models directory: {}\", models_dir.display());\n\n        // Create directory if it doesn't exist\n        if !models_dir.exists() {\n            std::fs::create_dir_all(&models_dir)?;\n        }\n\n        Ok(Self {\n            models_dir,\n            current_model: Arc::new(RwLock::new(None)),\n            current_model_name: Arc::new(RwLock::new(None)),\n            available_models: Arc::new(RwLock::new(HashMap::new())),","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs#L123-L159","documentation":"In release builds, ParakeetEngine::new_with_models_dir's default-location fallback found neither dirs::data_dir() nor dirs::home_dir(), so it cannot construct the models path (Meetily/models/parakeet). Both lookups depend on the environment/home being resolvable; when they are not, path resolution is impossible.","triggerScenarios":"Running the packaged app from a context without HOME/XDG_DATA_HOME (launchd/systemd services with a stripped environment), or a Windows session whose user profile did not load.","commonSituations":"Auto-launch daemons; kiosk/service-style deployments; unusual sandboxed runtimes.","solutions":["Set HOME (and XDG_DATA_HOME) in the launching service/launchd unit","Pass an explicit models_dir resolved from the Tauri app handle (app.path().app_data_dir()) so this fallback is never exercised","On Windows, verify the user profile and Known Folders resolve (run from a normal login session)"],"exampleFix":"// before\ndirs::data_dir()\n    .or_else(|| dirs::home_dir())\n    .ok_or_else(|| anyhow!(\"Could not find system data directory\"))?\n    .join(\"Meetily\").join(\"models\").join(\"parakeet\")\n\n// after - caller passes an explicit dir resolved from the Tauri handle\nlet models_dir = app.path().app_data_dir()\n    .map_err(|e| anyhow!(\"Could not resolve app data dir: {e}\"))?\n    .join(\"models\");\nlet engine = ParakeetEngine::new_with_models_dir(Some(models_dir))?;","handlingStrategy":"validation","validationCode":"fn data_dir_resolvable() -> bool {\n    dirs::data_dir().is_some() || dirs::home_dir().is_some()\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass an explicit models_dir resolved from Tauri's app_data_dir","Set HOME in service units that launch the app","Test packaged builds in clean/minimal environments"],"tags":["dirs","environment","models","parakeet","release-build"],"backgroundTag":"missing-home-environment-variable","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}