jdx/mise · error
cannot connect a setup repository
Error message
cannot connect a setup repository: {reason} What it means
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.
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
Defensive patterns
Strategy: try-catch
Validate before calling
mise dot history >/dev/null 2>&1 || { echo "history store unavailable"; exit 1; } Try / catch
if ! mise dot origin set "$URL" --sync manual 2>err.log; then grep 'cannot connect a setup repository' err.log && mise dot history # inspect reason fi
Prevention
- 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
When it happens
Trigger: `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.
Common situations: Fresh machine where dotfiles history was never initialized; corrupted or partially migrated store; permissions problems on the store directory.
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
- cannot apply
- a glob is required
- `--all` needs `--to
- at least one target or --changed is required
- cannot save
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/f467f7ce8d2c98d3.
Report an issue: GitHub.
Appendix: source
Thrown at src/cli/dotfiles/origin.rs:112
false,
)? {
crate::ui::prompt::Confirmation::Yes => SyncMode::Sync,
crate::ui::prompt::Confirmation::No => SyncMode::Manual,
crate::ui::prompt::Confirmation::Unanswered => {
bail!(
"not connected: stdin ended before an answer; choose --sync manual, --sync sync, or --sync fetch-only"
);
}
crate::ui::prompt::Confirmation::Unavailable => {
bail!(
"not connected: choose --sync manual, --sync sync, or --sync fetch-only to connect without a mode prompt"
);
}
},
};
let (store, tracked, _) = super::history::open().await?;
if let Some(reason) = store.unavailable() {
bail!("cannot connect a setup repository: {reason}");
}
origin::set(
&store,
&tracked,
&origin::SetOptions {
url: self.url.clone(),
branch: self.branch.clone(),
mode,
yes: self.yes,
},
)
.await
}
}
static AFTER_LONG_HELP: &str = color_print::cstr!(
r#"<bold><underline>Examples:</underline></bold>
View on GitHub (pinned to 533346cc37)