jdx/mise · error

cannot set up from a setup repository: {reason}

Error message

cannot set up from a setup repository: {reason}

What it means

`mise ssh` bootstrap-from-setup-repository (src/cli/ssh.rs:95) refuses to onboard when the local history checkpoint Store reports itself unavailable. `store.unavailable()` returns a reason (e.g. locked, corrupted, or otherwise unusable state store), and onboarding from an already-set-up repository would write into it, so mise bails with the store's reason embedded in the message.

Source

Thrown at src/cli/ssh.rs:95

            );
            return Ok(());
        }
        if let Some(bundle) = self.repository_bundle {
            let origin = self
                .repository_origin
                .ok_or_else(|| eyre::eyre!("missing repository origin"))?;
            let revision = self
                .repository_revision
                .ok_or_else(|| eyre::eyre!("missing repository revision"))?;
            // a history-managed setup repository is set up from, never
            // checked out into the configuration directory
            if let Some(branch) =
                crate::system::remote_repository::history_branch(&bundle, &revision)?
            {
                use crate::system::history::sync::onboard;
                let store = crate::system::history::checkpoint::Store::open()?;
                if let Some(reason) = store.unavailable() {
                    bail!("cannot set up from a setup repository: {reason}");
                }
                let fetch_from = bundle.to_string_lossy().into_owned();
                let outcome = onboard::run(
                    &store,
                    &onboard::Onboarding {
                        fetch_from,
                        origin,
                        branch,
                        yes: self.repository_yes,
                        dry_run: self.repository_dry_run,
                    },
                )
                .await?;
                if let Some(directory) = &self.repository_preview_directory {
                    let preview = outcome
                        .preview_config
                        .as_ref()
                        .ok_or_else(|| eyre::eyre!("missing setup configuration preview"))?;

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Resolve the store problem named in `{reason}` (release the lock, close other mise sessions).
  2. Inspect/repair the history state directory referenced by `mise bootstrap dotfiles status`.
  3. If the state is corrupt, remove or reset the checkpoint store per the reason, then rerun.
  4. Retry onboarding after the store reports available.

Example fix

// before (stale lock in state dir)
mise ssh host --from-setup-repository ...

// after: close other sessions / clear the stale lock
rm <state_dir>/history.lock
mise ssh host --from-setup-repository ...
Defensive patterns

Strategy: retry

Validate before calling

# before onboarding, ensure no other mise history store is active
pgrep -f 'mise (ssh|bootstrap)' && echo 'another mise session may hold the history store'

Try / catch

if (err.message.includes('cannot set up from a setup repository')) {
  // close other mise sessions / clear stale lock, then retry once
}

Prevention

When it happens

Trigger: Running a `mise ssh` command that onboards from a setup repository while `Store::open()` yields a store whose `unavailable()` is Some(reason) — e.g. the history/state directory is locked by another process or in an unsupported state.

Common situations: Concurrent mise sessions holding the checkpoint store; a stale lock left after a crashed run; a corrupted or migrated-away state directory; running onboarding where the history feature is disabled or unsupported.

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@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/6e136eafebc5a056. Report an issue: GitHub.