{"record":{"id":"5663e7230bf6883d","repo":"Zackriya-Solutions/meetily","slug":"failed-to-save-store-to-disk","errorCode":null,"errorMessage":"Failed to save store to disk: {}","messagePattern":"Failed to save store to disk: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/audio/recording_preferences.rs","lineNumber":161,"sourceCode":"          preferences.save_folder, preferences.auto_save, preferences.file_format,\n          preferences.preferred_mic_device, preferences.preferred_system_device);\n\n    // Get or create store\n    let store = app\n        .store(\"recording_preferences.json\")\n        .map_err(|e| anyhow::anyhow!(\"Failed to access store: {}\", e))?;\n\n    // Serialize preferences to JSON value\n    let prefs_value = serde_json::to_value(preferences)\n        .map_err(|e| anyhow::anyhow!(\"Failed to serialize preferences: {}\", e))?;\n\n    // Save to store\n    store.set(\"preferences\", prefs_value);\n\n    // Persist to disk\n    store\n        .save()\n        .map_err(|e| anyhow::anyhow!(\"Failed to save store to disk: {}\", e))?;\n\n    info!(\"Successfully persisted recording preferences to disk\");\n\n    // Save backend preference to global config\n    #[cfg(target_os = \"macos\")]\n    if let Some(backend_str) = &preferences.system_audio_backend {\n        if let Some(backend) = AudioCaptureBackend::from_string(backend_str) {\n            info!(\"Setting audio capture backend to: {:?}\", backend);\n            crate::audio::capture::set_current_backend(backend);\n        }\n    }\n\n    // Ensure the directory exists\n    ensure_recordings_directory(&preferences.save_folder)?;\n\n    Ok(())\n}\n","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/audio/recording_preferences.rs#L143-L179","documentation":"store.save() failed while flushing recording_preferences.json to disk in the app data directory. The in-memory store was updated but the filesystem write failed - a plain I/O error such as ENOSPC, EACCES, or a lock held by another process.","triggerScenarios":"Disk full; the app data directory or store file was made read-only (permissions change, sandbox); the file is momentarily locked by antivirus or cloud-sync (OneDrive, Dropbox) during write; the directory was deleted while the app was running.","commonSituations":"Full disks on meeting machines; corporate endpoint protection scanning app-data files; two app instances writing the same store concurrently; portable apps run from read-only media.","solutions":["Free disk space and retry saving preferences","Verify the app data folder is writable and owned by the running user","Exclude the app data directory from cloud-sync and antivirus real-time scanning","Avoid running two app instances that persist the same store file"],"exampleFix":"// before\nstore\n    .save()\n    .map_err(|e| anyhow::anyhow!(\"Failed to save store to disk: {}\", e))?;\n\n// after - one bounded retry for transient locks, then surface a clear error\nlet mut attempt = 0;\nloop {\n    match store.save() {\n        Ok(_) => break,\n        Err(e) if attempt < 2 => {\n            attempt += 1;\n            warn!(\"Store save failed (attempt {}): {}\", attempt, e);\n            std::thread::sleep(std::time::Duration::from_millis(250));\n        }\n        Err(e) => return Err(anyhow::anyhow!(\"Failed to save store to disk after retries: {}\", e)),\n    }\n}","handlingStrategy":"retry","validationCode":"// Pre-save checks: writable directory and free space\nlet dir = app.path().app_data_dir()?;\nlet meta = std::fs::metadata(&dir)?;\nif meta.permissions().readonly() { /* surface config error before saving */ }","typeGuard":null,"tryCatchPattern":"Retry store.save() up to 2-3 times with short backoff (locks from AV/sync are transient); on final failure keep the in-memory value, warn, and retry on next preferences change or app exit.","preventionTips":["Exclude the app data directory from cloud-sync folders and antivirus real-time scanning","Monitor free disk space and warn the user before writes start failing","Never run two app instances against the same app-data store file"],"tags":["io","disk-full","file-lock","persistence","tauri"],"backgroundTag":"file-write-failed","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}