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

  1. Read the interpolated {reason} in the message and fix that underlying store problem first
  2. Complete or re-run dotfiles setup so the store leaves the setup state
  3. Check store directory permissions and disk state
  4. 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

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


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)