Zackriya-Solutions/meetily · critical
Failed to get app data dir
Error message
Failed to get app data dir
What it means
set_models_directory resolves the Parakeet models directory from Tauri's app_data_dir() and .expect()s the Result. app_data_dir() fails when the bundle identifier is missing/invalid in tauri.conf.json or the platform home/data base dir is unresolvable; the panic fires during app setup, before any model can load.
Source
Thrown at frontend/src-tauri/src/parakeet_engine/commands.rs:17
use crate::parakeet_engine::{ModelInfo, ModelStatus, ParakeetEngine, DownloadProgress};
use std::path::PathBuf;
use std::sync::Mutex;
use std::sync::Arc;
use tauri::{command, Emitter, AppHandle, Manager, Runtime};
// Global parakeet engine
pub static PARAKEET_ENGINE: Mutex<Option<Arc<ParakeetEngine>>> = Mutex::new(None);
// Global models directory path (set during app initialization)
static MODELS_DIR: Mutex<Option<PathBuf>> = Mutex::new(None);
/// Initialize the models directory path using app_data_dir
/// This should be called during app setup before parakeet_init
pub fn set_models_directory<R: Runtime>(app: &AppHandle<R>) {
let app_data_dir = app.path().app_data_dir()
.expect("Failed to get app data dir");
let models_dir = app_data_dir.join("models");
// Create directory if it doesn't exist
if !models_dir.exists() {
if let Err(e) = std::fs::create_dir_all(&models_dir) {
log::error!("Failed to create models directory: {}", e);
return;
}
}
log::info!("Parakeet models directory set to: {}", models_dir.display());
let mut guard = MODELS_DIR.lock().unwrap();
*guard = Some(models_dir);
}
/// Get the configured models directoryView on GitHub (pinned to 0281737d87)
Solutions
- Set a valid `identifier` in tauri.conf.json (reverse-DNS, no underscores) — fixes every app_data_dir site
- Return early with a logged error instead of expect: log::error and skip engine init, letting the UI show 'models unavailable'
- Ensure the environment provides a home directory when running headless
- Rebuild so generate_context! embeds the corrected identifier
Example fix
// before
let app_data_dir = app.path().app_data_dir()
.expect("Failed to get app data dir");
// after
let Ok(app_data_dir) = app.path().app_data_dir() else {
log::error!("app_data_dir unresolved; parakeet models disabled");
return;
}; Defensive patterns
Strategy: validation
Validate before calling
if app.path().app_data_dir().is_err() {
log::error!("app_data_dir unresolved; parakeet disabled this session");
return; // skip engine init instead of crashing setup
} Try / catch
let Ok(app_data_dir) = app.path().app_data_dir() else {
log::error!("app_data_dir unresolved; parakeet models disabled");
return;
}; Prevention
- Set a valid reverse-DNS identifier in tauri.conf.json before adding any path-dependent subsystem
- Make set_models_directory fallible or early-return; setup hooks must not panic on environment problems
- Test app startup in HOME-less environments when shipping to kiosks/services
When it happens
Trigger: App setup calls set_models_directory when `identifier` is unset/invalid (e.g. contains underscores) or the process runs without HOME (systemd service, minimal container), panicking the setup thread at launch.
Common situations: Dev builds with stripped tauri.conf.json, renamed identifiers, running the packaged binary from services/sandboxes where the user profile is missing.
Related errors
- failed to get app data dir
- Failed to get app data dir
- Parakeet engine not initialized
- Failed to load Parakeet model {}: {}
- Failed to initialize database
AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16).
Data as JSON: /api/errors/e385ac2d41d79747.
Report an issue: GitHub.