{"record":{"id":"6e136eafebc5a056","repo":"jdx/mise","slug":"cannot-set-up-from-a-setup-repository-reason","errorCode":null,"errorMessage":"cannot set up from a setup repository: {reason}","messagePattern":"cannot set up from a setup repository: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/ssh.rs","lineNumber":95,"sourceCode":"            );\n            return Ok(());\n        }\n        if let Some(bundle) = self.repository_bundle {\n            let origin = self\n                .repository_origin\n                .ok_or_else(|| eyre::eyre!(\"missing repository origin\"))?;\n            let revision = self\n                .repository_revision\n                .ok_or_else(|| eyre::eyre!(\"missing repository revision\"))?;\n            // a history-managed setup repository is set up from, never\n            // checked out into the configuration directory\n            if let Some(branch) =\n                crate::system::remote_repository::history_branch(&bundle, &revision)?\n            {\n                use crate::system::history::sync::onboard;\n                let store = crate::system::history::checkpoint::Store::open()?;\n                if let Some(reason) = store.unavailable() {\n                    bail!(\"cannot set up from a setup repository: {reason}\");\n                }\n                let fetch_from = bundle.to_string_lossy().into_owned();\n                let outcome = onboard::run(\n                    &store,\n                    &onboard::Onboarding {\n                        fetch_from,\n                        origin,\n                        branch,\n                        yes: self.repository_yes,\n                        dry_run: self.repository_dry_run,\n                    },\n                )\n                .await?;\n                if let Some(directory) = &self.repository_preview_directory {\n                    let preview = outcome\n                        .preview_config\n                        .as_ref()\n                        .ok_or_else(|| eyre::eyre!(\"missing setup configuration preview\"))?;","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/ssh.rs#L77-L113","documentation":"`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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Resolve the store problem named in `{reason}` (release the lock, close other mise sessions).","Inspect/repair the history state directory referenced by `mise bootstrap dotfiles status`.","If the state is corrupt, remove or reset the checkpoint store per the reason, then rerun.","Retry onboarding after the store reports available."],"exampleFix":"// before (stale lock in state dir)\nmise ssh host --from-setup-repository ...\n\n// after: close other sessions / clear the stale lock\nrm <state_dir>/history.lock\nmise ssh host --from-setup-repository ...","handlingStrategy":"retry","validationCode":"# before onboarding, ensure no other mise history store is active\npgrep -f 'mise (ssh|bootstrap)' && echo 'another mise session may hold the history store'","typeGuard":null,"tryCatchPattern":"if (err.message.includes('cannot set up from a setup repository')) {\n  // close other mise sessions / clear stale lock, then retry once\n}","preventionTips":["Avoid running multiple mise bootstrap/ssh onboarding sessions concurrently.","Clean up stale lock files after crashed runs.","Check `mise bootstrap dotfiles status` before onboarding."],"tags":["ssh","state-store","onboarding","history"],"backgroundTag":"invalid-state-transition","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}