{"record":{"id":"327832601efcfe6a","repo":"jdx/mise","slug":"cannot-save-reason","errorCode":null,"errorMessage":"cannot save: {reason}","messagePattern":"cannot save: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/dotfiles/save.rs","lineNumber":127,"sourceCode":"        draft.description = self.description.clone();\n        draft.description_source = Some(if trigger == Trigger::Agent {\n            DescriptionSource::Agent\n        } else {\n            DescriptionSource::User\n        });\n        draft.task = self.task.clone();\n        draft.labels = self.label.clone();\n        tokio::task::spawn_blocking(move || self.save_checkpoint(&store, &tracked, draft)).await?\n    }\n\n    fn capture(\n        &self,\n        store: &Store,\n        tracked: &crate::system::history::tracked::TrackedSet,\n        draft: Draft,\n    ) -> Result<()> {\n        if let Some(reason) = store.unavailable() {\n            bail!(\"cannot save: {reason}\");\n        }\n        // a save is a write: it waits for no running operation, refuses to\n        // interleave with one, and closes one that died\n        let _operation = crate::system::history::scope::take_operation_lock(store, tracked)?;\n        match store.attempt(tracked, draft)? {\n            Outcome::Created(entry) => {\n                info!(\n                    \"history: saved checkpoint {}: {}\",\n                    entry.id, entry.checkpoint.description\n                );\n                Ok(())\n            }\n            Outcome::Unchanged => {\n                info!(\"history: nothing changed since the latest checkpoint\");\n                Ok(())\n            }\n            Outcome::Unavailable(reason) => bail!(\"cannot save: {reason}\"),\n        }","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/dotfiles/save.rs#L109-L145","documentation":"Before performing a save, capture checks `store.unavailable()` and aborts if the history store cannot be used (e.g. the store directory is unreadable, corrupt, or in an incompatible state). The reason string from the store is embedded in the error.","triggerScenarios":"Running `mise dot save` when the history store reports itself unavailable via Store::unavailable(), evaluated at the start of capture().","commonSituations":"Corrupt or version-mismatched history store directory; unwritable/read-only state dir; store locked by an incompatible writer; disk full.","solutions":["Read the reason embedded in the error message for the specific cause","Verify the history state directory exists and is writable","Repair or reset the store per the reason (re-initialize, fix permissions, free disk space)"],"exampleFix":"// before\nmise dot save   // cannot save: store directory not writable\n// after\nchmod u+w ~/.local/share/mise/dotfiles-history\nmise dot save","handlingStrategy":"try-catch","validationCode":"store_dir=~/.local/share/mise/dotfiles-history\n[ -d \"$store_dir\" ] && [ -w \"$store_dir\" ] || echo \"store dir missing or unwritable\"","typeGuard":null,"tryCatchPattern":"mise dot save update || {\n  status=$?\n  echo \"save failed (store unavailable?) — see message for reason\"\n  exit $status\n}","preventionTips":["Keep the history state directory writable by the current user","Monitor disk space on the state partition","Avoid running concurrent mise dot mutations","After mise upgrades, verify the store still opens (mise dot status)"],"tags":["cli","dotfiles","store-unavailable"],"backgroundTag":"file-write-failed","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}