jdx/mise · error
cannot apply: {reason}
Error message
cannot apply: {reason} What it means
Thrown by `mise bootstrap dotfiles pull` (run) after opening the history store when `store.unavailable()` returns a reason. The store exists as a concept but cannot serve apply operations (setup incomplete, locked, or corrupted state), so applying remote changes is refused.
Source
Thrown at src/cli/dotfiles/pull.rs:58
yes: bool,
/// Resolve a conflict with the repository's version
#[usage(long, value_name = "PATH")]
take_remote: Vec<PathBuf>,
/// Resolve a conflict by keeping this machine's version (published next)
#[usage(long, value_name = "PATH")]
keep_local: Vec<PathBuf>,
}
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(),
automatic: false,
plan_only: false,
},
)
.await?;
Ok(())
}
}View on GitHub (pinned to afd2eddd3a)
Solutions
- Read the printed reason and complete the indicated setup step
- Run `mise bootstrap dotfiles history --pending` to list incomplete operations and `--recover` them
- Re-initialize the dotfiles history store via the bootstrap setup flow
- Check the history state directory for corruption or permission issues
Example fix
// before mise bootstrap dotfiles pull # cannot apply: setup incomplete // after mise bootstrap dotfiles history --pending mise bootstrap dotfiles history --recover <id> mise bootstrap dotfiles pull
Defensive patterns
Strategy: validation
Validate before calling
# verify store health before pulling if ! mise bootstrap dotfiles history --pending >/dev/null 2>&1; then echo "history store unavailable" >&2; exit 1 fi mise bootstrap dotfiles pull
Try / catch
if ! mise bootstrap dotfiles pull; then mise bootstrap dotfiles history --pending exit 1 fi
Prevention
- Initialize the history store on new machines before pulling
- Recover pending operations promptly after interruptions
- Back up and validate the history state directory after disk issues
When it happens
Trigger: Running `mise bootstrap dotfiles pull` when the opened history store reports itself unavailable via store.unavailable() — e.g. unfinished setup or broken state directory.
Common situations: Fresh machine where the dotfiles store was never initialized; interrupted bootstrap leaving the store in a setup state; corrupted or missing state files in the history directory.
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
- {target_raw}: tracked in place; pass `--mode copy` after `mi
- cannot connect a setup repository: {reason}
- --changed does not accept target arguments
- at least one target or --changed is required
- --source can only be used with one target
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/9b9e1777fb584a1c.
Report an issue: GitHub.