{"record":{"id":"da3c21fb08fbdca0","repo":"jdx/mise","slug":"this-machine-is-connected-to-url-mise-bootstra","errorCode":null,"errorMessage":"this machine is connected to {url}; `mise bootstrap dotfiles origin --remove` disconnects it, or `mise bootstrap dotfiles origin set {origin}` moves it","messagePattern":"this machine is connected to (.+?); `mise bootstrap dotfiles origin --remove` disconnects it, or `mise bootstrap dotfiles origin set (.+?)` moves it","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/sync/onboard.rs","lineNumber":204,"sourceCode":"        if refs.iter().any(|(_, name)| name == candidate) {\n            return Ok(Some(\n                candidate.trim_start_matches(\"refs/heads/\").to_string(),\n            ));\n        }\n    }\n    Ok(refs\n        .iter()\n        .find_map(|(_, name)| name.strip_prefix(\"refs/heads/\").map(str::to_string)))\n}\n\n/// A machine connected to another repository is not silently moved.\nfn refuse_other_connection(store: &Store, origin: &str, branch: &str) -> Result<()> {\n    let status = run::read_status(store.state_dir())?;\n    if let Some(url) = &status.origin_url\n        && !status.disconnected\n        && (url != origin || status.origin_branch.as_deref() != Some(branch))\n    {\n        bail!(\n            \"this machine is connected to {url}; `mise bootstrap dotfiles origin --remove` disconnects it, or `mise bootstrap dotfiles origin set {origin}` moves it\"\n        );\n    }\n    Ok(())\n}\n\n/// Fetches the branch into the store and says what the repository is. A\n/// format this mise does not understand is an error; an ordinary\n/// repository leaves nothing behind.\nfn probe(store: &Store, fetch_from: &str, branch: &str) -> Result<RepoState> {\n    let repo = store\n        .repo()\n        .ok_or_else(|| eyre::eyre!(\"probing a setup repository requires git\"))?;\n    Remote::new(repo, fetch_from).fetch_tip(branch)?;\n    let upstream = repo.ref_oid(UPSTREAM_REF)?;\n    let state = format::detect(repo, upstream.as_deref())?;\n    state.check()?;\n    if !matches!(state, RepoState::Marked(_)) && upstream.is_some() {","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/history/sync/onboard.rs#L186-L222","documentation":"Safety bail in refuse_other_connection: this machine's history status is already connected to a different repository URL than the one requested, and onboarding never silently repoints a machine to a new repository. The error names both remediation commands (disconnect or set a new origin).","triggerScenarios":"Thrown at src/system/history/sync/onboard.rs:204 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run `mise bootstrap dotfiles origin --remove` to disconnect from the current repository first","Or run `mise bootstrap dotfiles origin set <new-url>` to move the connection deliberately","Then re-run onboarding against the intended repository"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}