Zackriya-Solutions/meetily · error · anyhow::Error
Failed to access store: {}
Error message
Failed to access store: {} What it means
save_recording_preferences calls app.store('recording_preferences.json') from tauri-plugin-store. The error means the store could not be created or loaded - most commonly the plugin was never registered on the Tauri Builder, or the underlying file in the app data directory cannot be read or created.
Source
Thrown at frontend/src-tauri/src/audio/recording_preferences.rs:149
info!("Loaded recording preferences: save_folder={:?}, auto_save={}, format={}, mic={:?}, system={:?}",
prefs.save_folder, prefs.auto_save, prefs.file_format,
prefs.preferred_mic_device, prefs.preferred_system_device);
Ok(prefs)
}
/// Save recording preferences to store
pub async fn save_recording_preferences<R: Runtime>(
app: &AppHandle<R>,
preferences: &RecordingPreferences,
) -> Result<()> {
info!("Saving recording preferences: save_folder={:?}, auto_save={}, format={}, mic={:?}, system={:?}",
preferences.save_folder, preferences.auto_save, preferences.file_format,
preferences.preferred_mic_device, preferences.preferred_system_device);
// Get or create store
let store = app
.store("recording_preferences.json")
.map_err(|e| anyhow::anyhow!("Failed to access store: {}", e))?;
// Serialize preferences to JSON value
let prefs_value = serde_json::to_value(preferences)
.map_err(|e| anyhow::anyhow!("Failed to serialize preferences: {}", e))?;
// Save to store
store.set("preferences", prefs_value);
// Persist to disk
store
.save()
.map_err(|e| anyhow::anyhow!("Failed to save store to disk: {}", e))?;
info!("Successfully persisted recording preferences to disk");
// Save backend preference to global config
#[cfg(target_os = "macos")]
if let Some(backend_str) = &preferences.system_audio_backend {View on GitHub (pinned to 0281737d87)
Solutions
- Confirm tauri_plugin_store is registered in the tauri::Builder chain in lib.rs
- Verify the app data directory exists and is writable by the app user
- Rename or delete the corrupt recording_preferences.json so a fresh store is created
- Inspect the underlying error kind - NotFound, PermissionDenied, and Json errors point to different fixes
Example fix
// before
tauri::Builder::default()
.run(app.handle())?;
// after - store plugin must be registered for app.store() to work
tauri::Builder::default()
.plugin(tauri_plugin_store::Builder::new().build())
.run(app.handle())?; Defensive patterns
Strategy: try-catch
Validate before calling
// Startup smoke test: opening the store early surfaces registration/permission issues immediately
let _ = app.store("recording_preferences.json"); Try / catch
Catch the store error in save_recording_preferences callers and keep preferences in memory (return Ok with a warn log) so a store problem never blocks recording start; queue a retry of the save.
Prevention
- Register tauri_plugin_store in the Builder and add a startup smoke test that opens the store
- Verify app-data directory writability during onboarding
- If the store JSON is corrupt, rename it and rebuild defaults instead of failing every save
When it happens
Trigger: The Builder is missing .plugin(tauri_plugin_store::Builder::new().build()); the app-data directory is missing or read-only; an existing recording_preferences.json is corrupt so the store fails to deserialize on open.
Common situations: A refactor dropped plugin registration; permissions changed on the app support directory; the store file was truncated by a crash or full disk; feature flag for the store plugin disabled in build.
Related errors
- Failed to access onboarding store: {}
- Failed to save store to disk: {}
- Failed to save onboarding store to disk: {}
- Failed to save onboarding store after reset: {}
- failed to get app data dir
AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16).
Data as JSON: /api/errors/163895859d177436.
Report an issue: GitHub.