{"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":"exception","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                        replace_history: false,\n                    },\n                )\n                .await?;\n                if let Some(directory) = &self.repository_preview_directory {\n                    let preview = outcome\n                        .preview_config\n                        .as_ref()","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/ssh.rs#L77-L113","documentation":"During `mise ssh` setup from a setup repository, mise opens the local history checkpoint Store before onboarding. If the store reports itself unavailable (`store.unavailable()` returns a reason — e.g. the history store cannot be opened or initialized), mise aborts the onboarding with the underlying reason. This prevents onboarding runs against a history store that cannot record checkpoints.","triggerScenarios":"Running `mise ssh` setup from a setup repository where `Store::open()` succeeds but the store reports an unavailability reason — corrupted or unwritable history store, unsupported storage location, or history disabled in this environment.","commonSituations":"Running in containers/CI where the history directory is read-only or missing; a corrupted checkpoint store from a previous crash; environments where the history feature is intentionally disabled.","solutions":["Read the {reason} in the message and fix the underlying store issue (permissions, disk space, corrupt files).","Repair or clear the history checkpoint store directory, then retry.","If history is not needed, disable/ignore the onboarding step or skip syncing history from the setup repository."],"exampleFix":"// before: history store unusable\nmise ssh --setup-repo ... \n// cannot set up from a setup repository: <reason>\n\n// after: fix store location/permissions (e.g. make history dir writable)\nchmod u+w ~/.local/share/mise/history\nmise ssh --setup-repo ...","handlingStrategy":"retry","validationCode":"test -w \"${MISE_HISTORY_DIR:-$HOME/.local/share/mise/history}\" || echo 'history store not writable' >&2","typeGuard":null,"tryCatchPattern":"mise ssh --setup-repo ... || { echo \"onboard failed: $? — fix history store then retry\" >&2; }","preventionTips":["Ensure the history/checkpoint store directory exists and is writable in containers and CI","Repair or clear a corrupted store after crashes before re-running setup","Skip history sync if the environment intentionally disables history"],"tags":["cli","ssh","history","setup"],"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"}