{"record":{"id":"9b9e1777fb584a1c","repo":"jdx/mise","slug":"cannot-apply-reason","errorCode":null,"errorMessage":"cannot apply: {reason}","messagePattern":"cannot apply: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/dotfiles/pull.rs","lineNumber":74,"sourceCode":"    take_remote_all: bool,\n\n    /// Resolve every remaining conflict by keeping this machine's version\n    ///\n    /// Paths named by --take-remote take the repository's version; every\n    /// other conflict keeps this machine's. Each kept path must already be\n    /// saved.\n    #[usage(long, conflicts = \"take_remote_all\")]\n    keep_local_all: bool,\n}\n\nimpl DotfilesPull {\n    pub(crate) async fn run(self) -> Result<()> {\n        if !crate::config::Settings::get().history.enabled {\n            bail!(\"history is disabled (history.enabled = false)\");\n        }\n        let (store, tracked, _) = super::history::open().await?;\n        if let Some(reason) = store.unavailable() {\n            bail!(\"cannot apply: {reason}\");\n        }\n        apply::apply(\n            &store,\n            &tracked,\n            &ApplyRequest {\n                paths: self.paths.clone(),\n                dry_run: self.dry_run,\n                yes: self.yes,\n                take_remote: self.take_remote.clone(),\n                keep_local: self.keep_local.clone(),\n                take_remote_all: self.take_remote_all,\n                keep_local_all: self.keep_local_all,\n                automatic: false,\n                plan_only: false,\n            },\n        )\n        .await?;\n        Ok(())","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/dotfiles/pull.rs#L56-L92","documentation":"After the history check, `mise dot pull` opens the store and bails if `store.unavailable()` returns a reason, reporting 'cannot apply: {reason}'. The history store cannot be opened or used, so pending changes cannot be applied.","triggerScenarios":"`mise dot pull` when the history store reports it is unavailable (uninitialized store, IO/permission error, corruption, pending setup). The store's reason is interpolated into the message.","commonSituations":"Read-only or full disk where the store lives; wrong permissions on the store directory; interrupted setup/migration; history newly enabled but never initialized.","solutions":["Read the {reason} in the message and address that specific store issue","Initialize/repair dotfiles history setup before pulling","Check permissions and free space on the store path (see `mise dot history --pending` for state)","Re-run `mise dot pull` after the store is available"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"mise dot history >/dev/null 2>&1 || { echo \"history store unavailable\"; exit 1; }","typeGuard":null,"tryCatchPattern":"if ! mise dot pull 2>err.log; then\n  grep 'cannot apply' err.log && mise dot history  # inspect store reason\nfi","preventionTips":["Ensure the store path is writable and has free disk space","Complete setup before pulling shared changes","Monitor store health after OS/config migrations","Avoid interrupting store operations mid-run"],"tags":["cli","dotfiles","store","apply"],"backgroundTag":"invalid-state-transition","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"}