{"record":{"id":"7630937b874ac8c8","repo":"jdx/mise","slug":"enabled-accounts-were-prepared","errorCode":null,"errorMessage":"enabled accounts were prepared","messagePattern":"enabled accounts were prepared","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/bootstrap.rs","lineNumber":1359,"sourceCode":"    /// Every bootstrap part in order. Returns what ran for the generation\n    /// record; declined prompts end the run early with a note.\n    async fn run_phases(&self) -> Result<Summary> {\n        let mut config = Config::get().await?;\n        let mut hooks = system::hooks_from_config(&config);\n        let skip = self.skip_parts();\n        let summary = Summary { message: None };\n        let accounts_enabled = !skip.contains(&BootstrapPart::Accounts);\n        let files_enabled = !skip.contains(&BootstrapPart::Files);\n        let configured_accounts =\n            if accounts_enabled || (cfg!(target_os = \"linux\") && files_enabled) {\n                Some(system::accounts::prepare_requests_from_config(&config)?)\n            } else {\n                None\n            };\n        let managed_accounts = accounts_enabled.then(|| {\n            configured_accounts\n                .as_ref()\n                .expect(\"enabled accounts were prepared\")\n        });\n        let secrets = system::secrets::resolve(&config, self.prompt_secrets)?;\n        let managed_system_files = if !files_enabled {\n            None\n        } else {\n            Some(system::managed_files::prepare_requests_from_config(\n                &config, &secrets,\n            )?)\n        };\n        if let Some((files, directories)) = &managed_system_files {\n            system::managed_files::validate_principals(\n                files,\n                directories,\n                configured_accounts.as_ref(),\n                accounts_enabled,\n            )?;\n        }\n        let services_enabled = !skip.contains(&BootstrapPart::Services);","sourceCodeStart":1341,"sourceCodeEnd":1377,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/cli/bootstrap.rs#L1341-L1377","documentation":"During bootstrap of managed (system) accounts, `accounts_enabled` gates access to `configured_accounts`, and the `.expect` asserts that when accounts are enabled the config preparation step already produced the parsed account list. The panic means accounts were enabled (via settings/flags) but `configured_accounts` was never populated — the config that should define them is missing or failed earlier parsing.","triggerScenarios":"Running a bootstrap flow (e.g. `mise bootstrap`/system setup) with account management enabled while the configuration contained no `[system.accounts]`-style section, or the config file that defines accounts was not loaded/failed validation earlier.","commonSituations":"User enables account management in settings but never defines the accounts in mise.toml / the system config; a mistyped config key means the accounts section parses to None; config file not trusted or not discovered.","solutions":["Define the managed accounts in your configuration so `configured_accounts` is populated","Disable account management (`accounts_enabled = false` / remove the enabling setting) if you don't use it","Verify the config file containing the accounts section is discovered and trusted (`mise trust`, correct path)","Check key spelling/casing of the accounts config section"],"exampleFix":"# before (mise.toml) — accounts enabled but none configured\n[settings]\nsystem_accounts = true\n# after\n[settings]\nsystem_accounts = true\n\n[[system.accounts]]\nname = \"deploy\"\nuid = 1500","handlingStrategy":"validation","validationCode":"# ensure accounts are both enabled AND configured before bootstrapping\nmise settings get system_accounts && grep -q 'system.accounts' mise.toml || echo 'accounts enabled but none configured'","typeGuard":"function accountsReady(cfg) { return !cfg.settings?.accounts_enabled || Array.isArray(cfg.system?.accounts) && cfg.system.accounts.length > 0; }","tryCatchPattern":"if mise bootstrap 2>&1 | grep -q 'enabled accounts were prepared'; then echo 'define the accounts section in config or disable account management'; fi","preventionTips":["Never enable account management without also defining the accounts section","Run `mise trust` on the config file that defines accounts","Validate config keys against the schema (`mise settings` docs) after edits"],"tags":["bootstrap","config","panic","missing-config","internal-invariant"],"backgroundTag":"missing-required-config-field","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}