jdx/mise · error

enabled accounts were prepared

Error message

enabled accounts were prepared

What it means

Internal invariant in `mise bootstrap` preflight. `configured_accounts` is computed as Some(...) whenever `accounts_enabled || (linux && files_enabled)` (src/cli/bootstrap.rs:1134-1139); `managed_accounts` unwraps it only inside `accounts_enabled.then(...)`, which implies the first disjunct was true, so the Option is always Some. This expect is a regression guard for refactors of the skip/BootstrapPart logic — it is not reachable through any combination of user flags in this code.

Source

Thrown at src/cli/bootstrap.rs:1143

    pub(super) async fn run(self) -> Result<()> {
        if let Some(command) = self.command {
            return command.run().await;
        }
        let mut config = Config::get().await?;
        let mut hooks = system::hooks_from_config(&config);
        let skip = self.skip_parts();
        let accounts_enabled = !skip.contains(&BootstrapPart::Accounts);
        let files_enabled = !skip.contains(&BootstrapPart::Files);
        let configured_accounts =
            if accounts_enabled || (cfg!(target_os = "linux") && files_enabled) {
                Some(system::accounts::prepare_requests_from_config(&config)?)
            } else {
                None
            };
        let managed_accounts = accounts_enabled.then(|| {
            configured_accounts
                .as_ref()
                .expect("enabled accounts were prepared")
        });
        let secrets = system::secrets::resolve(&config, self.prompt_secrets)?;
        let managed_system_files = if !files_enabled {
            None
        } else {
            Some(system::managed_files::prepare_requests_from_config(
                &config, &secrets,
            )?)
        };
        if let Some((files, directories)) = &managed_system_files {
            system::managed_files::validate_principals(
                files,
                directories,
                configured_accounts.as_ref(),
                accounts_enabled,
            )?;
        }
        let services_enabled = !skip.contains(&BootstrapPart::Services);

View on GitHub (pinned to 6f52dcdf99)

Solutions

  1. If hit as a user: update/pin a released mise — this is a bug in that build, not your config
  2. Workaround: run `mise bootstrap --skip=accounts` to bypass the accounts branch
  3. As a contributor: restore the invariant — prepare account requests whenever !skip.contains(&BootstrapPart::Accounts) before the unwrap
  4. Report with MISE_DEBUG=1 and the panic backtrace at https://github.com/jdx/mise/issues

Example fix

// before (broken refactor):
let configured_accounts = (cfg!(target_os = "linux") && files_enabled)
    .then(|| system::accounts::prepare_requests_from_config(&config).ok())
    .flatten();
let managed_accounts = accounts_enabled.then(|| {
    configured_accounts.as_ref().expect("enabled accounts were prepared") // panics
});

// after: keep prepare condition a superset of accounts_enabled
let configured_accounts =
    if accounts_enabled || (cfg!(target_os = "linux") && files_enabled) {
        Some(system::accounts::prepare_requests_from_config(&config)?)
    } else {
        None
    };
Defensive patterns

Strategy: fallback

Try / catch

# Rust embedders: contain the panic and fall back to a partial bootstrap
let result = std::panic::catch_unwind(|| {
    // block_on(mise bootstrap) equivalent
});
if result.is_err() { run_bootstrap_with_skip("accounts")?; }

Prevention

When it happens

Trigger: Only a source change that makes the accounts part enabled while skipping `system::accounts::prepare_requests_from_config` (e.g. someone edits the condition at line 1134) — the process then panics during `mise bootstrap` preflight. No config or flag combination triggers it in shipped builds.

Common situations: Contributors refactoring BootstrapPart skip handling or accounts preflight; users on a broken custom build. Normal `mise bootstrap` runs, including --skip/--only combinations, never hit it.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22). Data as JSON: /api/errors/7630937b874ac8c8. Report an issue: GitHub.