{"record":{"id":"55f6128bd99fda4d","repo":"Zackriya-Solutions/meetily","slug":"failed-to-get-current-directory-55f612","errorCode":null,"errorMessage":"Failed to get current directory: {}","messagePattern":"Failed to get current directory: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/whisper_engine/whisper_engine.rs","lineNumber":98,"sourceCode":"        Self::new_with_models_dir(None)\n    }\n\n    /// Create a new WhisperEngine with optional custom models directory\n    /// If models_dir is None, uses default location (app data dir for production, local for dev)\n    pub fn new_with_models_dir(models_dir: Option<PathBuf>) -> Result<Self> {\n        // PERFORMANCE: Suppress verbose whisper.cpp and Metal logs\n        // These C library logs bypass Rust logging and clutter output\n        // Set environment variables to reduce C library verbosity\n        std::env::set_var(\"GGML_METAL_LOG_LEVEL\", \"1\"); // 0=off, 1=error, 2=warn, 3=info\n        std::env::set_var(\"WHISPER_LOG_LEVEL\", \"1\");    // Reduce whisper.cpp verbosity\n\n        let models_dir = if let Some(dir) = models_dir {\n            // Use provided directory (for production with app_data_dir)\n            dir\n        } else {\n            // Fallback: determine based on debug/release mode\n            let current_dir = std::env::current_dir()\n                .map_err(|e| anyhow!(\"Failed to get current directory: {}\", e))?;\n\n            // Development: Use frontend/models or backend directories\n            // Production: Use system directories (should be overridden by caller)\n            if cfg!(debug_assertions) {\n                // Development mode - try frontend and backend directories\n                if current_dir.join(\"models\").exists() {\n                    current_dir.join(\"models\")\n                } else if current_dir.join(\"../models\").exists() {\n                    current_dir.join(\"../models\")\n                } else if current_dir.join(\"backend/whisper-server-package/models\").exists() {\n                    current_dir.join(\"backend/whisper-server-package/models\")\n                } else if current_dir.join(\"../backend/whisper-server-package/models\").exists() {\n                    current_dir.join(\"../backend/whisper-server-package/models\")\n                } else {\n                    // Create models directory in current directory for development\n                    current_dir.join(\"models\")\n                }\n            } else {","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/whisper_engine/whisper_engine.rs#L80-L116","documentation":"When no models_dir is supplied, WhisperEngine::new falls back to std::env::current_dir() to probe development model directories. The OS call failed - on Unix this almost always means the process's working directory was deleted while the process was still running.","triggerScenarios":"Constructing WhisperEngine without an explicit models_dir while the cwd has been removed: running the dev binary from a directory that a clean/rebuild script deleted and recreated, or launching from a temp or unmounted path.","commonSituations":"Running cargo tauri dev after clean_run.sh removed directories out from under the shell; launching the binary from a removable/unmounted drive; sandboxed environments that restrict getcwd.","solutions":["Pass an explicit models_dir when constructing WhisperEngine - production code should never rely on the cwd fallback","Restart the app from a directory that currently exists","Avoid deleting/recreating the working directory while the dev server or app process is running"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Never rely on the cwd fallback in app code\nlet models_dir = app.path().app_data_dir()?.join(\"models\");\nlet engine = WhisperEngine::new(Some(models_dir)).await?;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass an explicit models_dir (Tauri app_data_dir) when constructing WhisperEngine","Do not delete/recreate the directory a dev process was launched from while it runs","If hit in dev, restarting the app from an existing directory resolves it"],"tags":["whisper","path","environment","filesystem"],"backgroundTag":"current-directory-unavailable","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}