Zackriya-Solutions/meetily · error · anyhow::Error
Could not find system data directory
Error message
Could not find system data directory
What it means
Release-mode fallback when no models_dir was provided: the engine tries dirs::data_dir() and then dirs::home_dir() to build <data>/Meetily/models, and both returned None. The process cannot resolve any user data directory - typically no HOME on Unix and no XDG_DATA_HOME either.
Source
Thrown at frontend/src-tauri/src/whisper_engine/whisper_engine.rs:121
// Development mode - try frontend and backend directories
if current_dir.join("models").exists() {
current_dir.join("models")
} else if current_dir.join("../models").exists() {
current_dir.join("../models")
} else if current_dir.join("backend/whisper-server-package/models").exists() {
current_dir.join("backend/whisper-server-package/models")
} else if current_dir.join("../backend/whisper-server-package/models").exists() {
current_dir.join("../backend/whisper-server-package/models")
} else {
// Create models directory in current directory for development
current_dir.join("models")
}
} else {
// Production mode fallback (shouldn't reach here, caller should provide path)
log::warn!("WhisperEngine: 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")
}
};
log::info!("WhisperEngine using models directory: {}", models_dir.display());
log::info!("Debug mode: {}", cfg!(debug_assertions));
// Log acceleration capabilities
let gpu_support = Self::detect_gpu_acceleration();
log::info!("Hardware acceleration support: {}", if gpu_support { "enabled" } else { "disabled" });
#[cfg(feature = "metal")]
log::info!("Apple Metal GPU support: enabled");
#[cfg(feature = "openblas")]
log::info!("OpenBLAS CPU optimization: enabled");
View on GitHub (pinned to 0281737d87)
Solutions
- Always pass models_dir explicitly (e.g. the Tauri app_data_dir) instead of relying on this fallback
- Set HOME=/some/dir (or XDG_DATA_HOME) in the launching environment
- Run the app in a normal user session rather than a bare service account
Defensive patterns
Strategy: validation
Validate before calling
let models_dir = match provided_dir {
Some(d) => d,
None => std::env::var("HOME").map(|h| PathBuf::from(h).join(".local/share"))
.or_else(|_| std::env::var("XDG_DATA_HOME").map(PathBuf::from))
.map(|d| d.join("Meetily/models"))
.ok_or_else(|| anyhow!("no data dir: pass models_dir or set HOME"))?,
}; Prevention
- Pass models_dir explicitly in every production code path; the fallback exists only for emergencies
- When running under systemd/docker/cron, set HOME or XDG_DATA_HOME in the unit/spec
- Fail fast at startup if neither an explicit dir nor HOME resolves, rather than deep in WhisperEngine::new
When it happens
Trigger: Constructing WhisperEngine in a release build with models_dir: None inside a stripped environment: a systemd unit, cron job, or container without HOME set, or a Windows service session where the known-folder/appdata resolution fails.
Common situations: Running the packaged binary from a service manager or Docker without HOME/XDG_DATA_HOME; CI smoke tests that launch the release build in a bare environment.
Related errors
- Failed to get current directory: {}
- No audio samples decoded from file
- Whisper transcription failed on segment {}: {}
- Failed to load model '{}': {}
- Whisper engine not initialized
AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16).
Data as JSON: /api/errors/8bdc0045833756b6.
Report an issue: GitHub.