{"record":{"id":"f467f7ce8d2c98d3","repo":"jdx/mise","slug":"cannot-connect-a-setup-repository-reason","errorCode":null,"errorMessage":"cannot connect a setup repository: {reason}","messagePattern":"cannot connect a setup repository: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/dotfiles/origin.rs","lineNumber":112,"sourceCode":"                false,\n            )? {\n                crate::ui::prompt::Confirmation::Yes => SyncMode::Sync,\n                crate::ui::prompt::Confirmation::No => SyncMode::Manual,\n                crate::ui::prompt::Confirmation::Unanswered => {\n                    bail!(\n                        \"not connected: stdin ended before an answer; choose --sync manual, --sync sync, or --sync fetch-only\"\n                    );\n                }\n                crate::ui::prompt::Confirmation::Unavailable => {\n                    bail!(\n                        \"not connected: choose --sync manual, --sync sync, or --sync fetch-only to connect without a mode prompt\"\n                    );\n                }\n            },\n        };\n        let (store, tracked, _) = super::history::open().await?;\n        if let Some(reason) = store.unavailable() {\n            bail!(\"cannot connect a setup repository: {reason}\");\n        }\n        origin::set(\n            &store,\n            &tracked,\n            &origin::SetOptions {\n                url: self.url.clone(),\n                branch: self.branch.clone(),\n                mode,\n                yes: self.yes,\n            },\n        )\n        .await\n    }\n}\n\nstatic AFTER_LONG_HELP: &str = color_print::cstr!(\n    r#\"<bold><underline>Examples:</underline></bold>\n","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/dotfiles/origin.rs#L94-L130","documentation":"After opening the history store, `mise dot origin set` checks `store.unavailable()` and bails if the store reports it cannot operate, reporting the store's reason. A repository still in 'setup' state cannot be connected to an origin.","triggerScenarios":"`mise dot origin set` when the dotfiles history store is unavailable — e.g. store not initialized/setup incomplete, storage errors, or another setup step pending. The exact cause string is interpolated into the message.","commonSituations":"Fresh machine where dotfiles history was never initialized; corrupted or partially migrated store; permissions problems on the store directory.","solutions":["Read the interpolated {reason} in the message and fix that underlying store problem first","Complete or re-run dotfiles setup so the store leaves the setup state","Check store directory permissions and disk state","Verify history is enabled and initialized: run `mise dot history` to inspect the store"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"mise dot history >/dev/null 2>&1 || { echo \"history store unavailable\"; exit 1; }","typeGuard":null,"tryCatchPattern":"if ! mise dot origin set \"$URL\" --sync manual 2>err.log; then\n  grep 'cannot connect a setup repository' err.log && mise dot history  # inspect reason\nfi","preventionTips":["Initialize dotfiles history setup on new machines before connecting an origin","Verify store health with `mise dot history` regularly","Fix permissions/ownership of the store directory","Re-run setup after failed migrations"],"tags":["cli","dotfiles","store","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"}