Zackriya-Solutions/meetily · error
Could not find system data directory
Error message
Could not find system data directory
What it means
Production fallback when no models directory is provided: both dirs::data_dir() (XDG_DATA_HOME / APPDATA / ~/Library/Application Support) and dirs::home_dir() returned None, so there is nowhere to place models. The process environment lacks the platform's standard user/home variables.
Source
Thrown at frontend/src-tauri/src/summary/summary_engine/model_manager.rs:147
/// Create a new model manager with custom models directory
pub fn new_with_models_dir(models_dir: Option<PathBuf>) -> Result<Self> {
let models_dir = if let Some(dir) = models_dir {
dir
} else {
// Fallback: Use current directory in development
let current_dir = std::env::current_dir()
.map_err(|e| anyhow!("Failed to get current directory: {}", e))?;
if cfg!(debug_assertions) {
// Development mode
current_dir.join("models").join("summary")
} else {
// Production mode fallback (caller should provide path)
log::warn!("ModelManager: No models directory provided, using fallback path");
dirs::data_dir()
.or_else(|| dirs::home_dir())
.ok_or_else(|| anyhow!("Could not find system data directory"))?
.join("Meetily")
.join("models")
.join("summary")
}
};
log::info!(
"Built-in AI ModelManager using directory: {}",
models_dir.display()
);
Ok(Self {
models_dir,
available_models: Arc::new(RwLock::new(HashMap::new())),
active_downloads: Arc::new(RwLock::new(HashSet::new())),
cancel_download_flag: Arc::new(RwLock::new(None)),
})
}View on GitHub (pinned to 0281737d87)
Solutions
- Always pass an explicit models directory via new_with_models_dir in production code paths
- Set the missing variable for service contexts (HOME on Unix, APPDATA on Windows)
- In containers, set HOME=/data or XDG_DATA_HOME=/data
- Fail fast at app startup with a clear message instead of constructing the manager lazily
Defensive patterns
Strategy: validation
Validate before calling
// Fail fast with a clear message when the environment is incomplete
let base = dirs::data_dir()
.or_else(dirs::home_dir)
.ok_or_else(|| anyhow!("No user data dir: set HOME (Unix) or APPDATA (Windows)"))?;
let models_dir = base.join("Meetily").join("models").join("summary"); Prevention
- Pass an explicit models directory from the Tauri app path resolver instead of relying on env fallbacks
- For services/containers, always set HOME or XDG_DATA_HOME / APPDATA
- Validate the environment at startup rather than deep inside model construction
When it happens
Trigger: Running the binary as a systemd/Windows service without HOME or APPDATA set; minimal containers that drop environment variables; CI or test harnesses invoking the manager directly with a cleared environment.
Common situations: Windows service context missing %APPDATA%; Docker containers without HOME; test runners that scrub env.
Related errors
- Failed to get current directory: {}
- Decode task join error: {}
- Resample task join error: {}
- VAD task panicked: {}
- Parakeet transcription failed on segment {}: {}
AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16).
Data as JSON: /api/errors/db81be1b022fcbc2.
Report an issue: GitHub.