tonhowtf/omniget · error
external_data_cache: failed to create
Error message
external_data_cache: failed to create {}: {} What it means
After resolving the base cache directory, external_data_cache builds base/external-cache/<plugin_id>/<namespace> and calls std::fs::create_dir_all. Any OS-level failure (permissions, read-only filesystem, name issues) is wrapped with the directory path and the io error text. The plugin then cannot store external data.
Solutions
- Read the wrapped OS error: PermissionDenied → fix ownership of the cache base dir; ReadOnly/StorageFull → remount or free space.
- Ensure the base cache directory is writable by the user running the app (chown/chmod on Linux, folder ACLs on Windows).
- Sanitize/limit plugin_id and namespace length so the full path stays under filesystem limits.
- In portable mode, move the app to a writable location.
Example fix
// before (failing)
std::fs::create_dir_all("/home/otheruser/.cache/wtf.tonho.omniget/external-cache/myplugin/data")
// after
sudo chown -R $USER ~/.cache/wtf.tonho.omniget
# or in code: fall back to a writable dir on error Defensive patterns
Strategy: try-catch
Validate before calling
fn cache_base_writable(base: &std::path::Path) -> bool {
base.exists() || std::fs::create_dir_all(base).is_ok()
} Try / catch
match host.external_data_cache(plugin_id, ns) {
Ok(dir) => store(dir),
Err(e) => {
log::error!("cache dir unavailable: {e}"); // includes path + OS reason
// degrade: run plugin without external cache
}
} Prevention
- Check the wrapped path and io::ErrorKind to fix ownership/permissions precisely
- Never run the app as root once, which leaves root-owned cache dirs
- Keep plugin_id/namespace short to avoid path-length limits
- Ensure the install location (portable) is writable
When it happens
Trigger: create_dir_all fails because a parent directory is not writable, the disk is read-only/full, the path component derived from plugin_id/namespace is invalid on the filesystem, or an antivirus/ACL blocks creation.
Common situations: Read-only app dir in portable mode (app on a USB stick mounted read-only); Linux cache dir owned by another user after running once with sudo; Windows path length limits with long plugin ids/namespaces; disk full.
Understand the failure class
Background: mkdir permission denied (EACCES): failed to create directory errors explained — this error's family across 32 libraries.
Related errors
- Failed to open archive
- app_data_dir unavailable
- arquivo invalido
- arquivo não existe
- binario sumiu apos instalar
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/8132b41818d62922.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/src/plugin_host.rs:144
// portable installs keep every file next to the app, so the cache
// lives under the app data dir instead of the OS cache dir
let base = if std::env::var("OMNIGET_PORTABLE").is_ok() {
omniget_core::core::paths::app_data_dir()
.ok_or_else(|| anyhow::anyhow!("external_data_cache: app data dir unavailable"))?
.join("cache")
} else {
dirs::cache_dir()
.ok_or_else(|| {
anyhow::anyhow!(
"external_data_cache: OS cache dir unavailable on this platform"
)
})?
.join("wtf.tonho.omniget")
};
let dir = base.join("external-cache").join(plugin_id).join(namespace);
std::fs::create_dir_all(&dir).map_err(|e| {
anyhow::anyhow!(
"external_data_cache: failed to create {}: {}",
dir.display(),
e
)
})?;
Ok(dir)
}
fn get_cookie_file(&self, domain: &str, account: Option<&str>) -> Option<PathBuf> {
crate::cookies::account_path_for_consumer(domain, account)
}
fn cookie_status(&self, domain: &str) -> omniget_plugin_sdk::CookieStatus {
let registry = crate::cookies::load_registry();
let root = crate::cookies::root_domain_of(domain);
let bucket = match registry.buckets.get(&root) {
Some(b) => b,
None => return omniget_plugin_sdk::CookieStatus::Missing,View on GitHub (pinned to 8600b91f42)