Zackriya-Solutions/meetily · error · anyhow::Error

Failed to save onboarding store to disk: {}

Error message

Failed to save onboarding store to disk: {}

What it means

store.save() failed to persist onboarding-status.json to disk after set("status", ...). The in-memory store updated fine; flushing to the config dir failed - an OS-level write problem (permissions, disk full, path issues) or the file being locked.

Source

Thrown at frontend/src-tauri/src/onboarding.rs:104

    // Get or create store
    let store = app.store("onboarding-status.json")
        .map_err(|e| anyhow::anyhow!("Failed to access onboarding store: {}", e))?;

    // Update last_updated timestamp
    let mut status = status.clone();
    status.last_updated = chrono::Utc::now().to_rfc3339();

    // Serialize status to JSON value
    let status_value = serde_json::to_value(&status)
        .map_err(|e| anyhow::anyhow!("Failed to serialize onboarding status: {}", e))?;

    // Save to store
    store.set("status", status_value);

    // Persist to disk
    store.save()
        .map_err(|e| anyhow::anyhow!("Failed to save onboarding store to disk: {}", e))?;

    info!("Successfully persisted onboarding status to disk");
    Ok(())
}

/// Reset onboarding status (delete from store)
pub async fn reset_onboarding_status<R: Runtime>(
    app: &AppHandle<R>,
) -> Result<()> {
    info!("Resetting onboarding status");

    let store = app.store("onboarding-status.json")
        .map_err(|e| anyhow::anyhow!("Failed to access onboarding store: {}", e))?;

    // Clear the status key
    store.delete("status");

    // Persist deletion to disk

View on GitHub (pinned to 0281737d87)

Solutions

  1. Check free space and write permissions on the config dir (df -h; ls -l)
  2. Ensure only one instance of the app runs (single-instance plugin)
  3. Retry the save once - transient AV/backup locks commonly clear
  4. If the directory was deleted externally, recreate it and retry
Defensive patterns

Strategy: retry

Validate before calling

// Check the store file is writable before save
fn store_writable(path: &std::path::Path) -> bool {
    if let Some(p) = path.parent() {
        if std::fs::create_dir_all(p).is_err() { return false; }
    }
    std::fs::OpenOptions::new().write(true).create(true).open(path).is_ok()
}

Try / catch

// One bounded retry absorbs transient locks (AV/backup scanners)
let mut last = None;
for _ in 0..2 {
    match store.save() {
        Ok(()) => { last = None; break; }
        Err(e) => { last = Some(e); std::thread::sleep(std::time::Duration::from_millis(250)); }
    }
}
if let Some(e) = last { warn!("Could not persist onboarding status: {e}"); }

Prevention

When it happens

Trigger: Config directory read-only or out of space; onboarding-status.json locked by another process (second app instance, backup/AV scanner); the directory was removed while the app was running.

Common situations: Disk-full machines; enterprise policies protecting user config dirs; two instances of the app running simultaneously.

Related errors


AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16). Data as JSON: /api/errors/e6ba61ff403c102e. Report an issue: GitHub.