jdx/mise · error

cannot apply

Error message

cannot apply: {reason}

What it means

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.

Solutions

  1. Read the {reason} in the message and address that specific store issue
  2. Initialize/repair dotfiles history setup before pulling
  3. Check permissions and free space on the store path (see `mise dot history --pending` for state)
  4. Re-run `mise dot pull` after the store is available
Defensive patterns

Strategy: retry

Validate before calling

mise dot history >/dev/null 2>&1 || { echo "history store unavailable"; exit 1; }

Try / catch

if ! mise dot pull 2>err.log; then
  grep 'cannot apply' err.log && mise dot history  # inspect store reason
fi

Prevention

When it happens

Trigger: `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.

Common situations: Read-only or full disk where the store lives; wrong permissions on the store directory; interrupted setup/migration; history newly enabled but never initialized.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/9b9e1777fb584a1c. Report an issue: GitHub.

Appendix: source

Thrown at src/cli/dotfiles/pull.rs:74

    take_remote_all: bool,

    /// Resolve every remaining conflict by keeping this machine's version
    ///
    /// Paths named by --take-remote take the repository's version; every
    /// other conflict keeps this machine's. Each kept path must already be
    /// saved.
    #[usage(long, conflicts = "take_remote_all")]
    keep_local_all: bool,
}

impl DotfilesPull {
    pub(crate) async fn run(self) -> Result<()> {
        if !crate::config::Settings::get().history.enabled {
            bail!("history is disabled (history.enabled = false)");
        }
        let (store, tracked, _) = super::history::open().await?;
        if let Some(reason) = store.unavailable() {
            bail!("cannot apply: {reason}");
        }
        apply::apply(
            &store,
            &tracked,
            &ApplyRequest {
                paths: self.paths.clone(),
                dry_run: self.dry_run,
                yes: self.yes,
                take_remote: self.take_remote.clone(),
                keep_local: self.keep_local.clone(),
                take_remote_all: self.take_remote_all,
                keep_local_all: self.keep_local_all,
                automatic: false,
                plan_only: false,
            },
        )
        .await?;
        Ok(())

View on GitHub (pinned to 533346cc37)