jdx/mise · error
unknown bootstrap hook phase
Error message
unknown bootstrap hook phase {phase_raw:?}; valid phases are: {} What it means
Bootstrap hooks in mise.toml declare a `phase` key that must name a valid BootstrapHookPhase. from_toml parses the phase string and bails with the list of accepted values when parse fails, so a typo cannot silently disable a hook.
Solutions
- Set phase to one of the values listed in the error message (case-sensitive).
- Check mise docs for the current list of bootstrap hook phases.
- Remove the hook table if it was experimental and no longer supported.
Example fix
// before (mise.toml) [[hooks]] phase = "startup" run = "echo hi" // after (use a valid phase from the message) [[hooks]] phase = "pretool" run = "echo hi"
Defensive patterns
Strategy: validation
Validate before calling
const VALID_PHASES: &[&str] = &[/* phases listed in the error message */];
fn valid_phase(p: &str) -> bool { VALID_PHASES.contains(&p) } Type guard
fn parse_phase(p: &str) -> Option<Phase> { VALID_PHASES.iter().find(|v| **v == p).map(|v| Phase(*v)) } Try / catch
match load_hooks(config) {
Err(e) if e.to_string().contains("unknown bootstrap hook phase") => eprintln!("{} — see docs for valid phases", e),
other => other?,
} Prevention
- Copy phase names from the official docs, never from memory.
- Keep a schema/linter for mise.toml to validate hook tables.
- Test hook configs with a dry run before committing.
When it happens
Trigger: Defining a [[hook]] table in a config file whose phase value doesn't match any BootstrapHookPhase variant, e.g. `phase = "preboot"` or `phase = "BeforeRun"` (case/word mismatch).
Common situations: Typo in the phase name; copying an example with an outdated phase name; guessing phase names instead of consulting docs; wrong capitalization.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- agent ' ' `start_calendar_interval. ` must be between and
- agent ' ' `start_calendar_interval` must set at least one…
- agent ' ' `start_calendar_interval` must not be empty
- agent ' ' `queue_directories` must not contain empty entries
- an exec entry with no command
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/43e3fb3c059a1993.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/hooks.rs:82
#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) struct BootstrapHook {
pub phase: BootstrapHookPhase,
pub run: String,
pub config_path: PathBuf,
}
impl BootstrapHook {
pub(crate) fn from_toml(
phase_raw: &str,
value: toml::Value,
config_path: PathBuf,
) -> Result<Vec<Self>> {
let Some(phase) = BootstrapHookPhase::parse(phase_raw) else {
let valid = BootstrapHookPhase::iter()
.map(|phase| phase.as_str())
.collect::<Vec<_>>();
bail!(
"unknown bootstrap hook phase {phase_raw:?}; valid phases are: {}",
valid.join(", ")
);
};
let runs = match value {
toml::Value::String(run) => vec![run],
toml::Value::Array(values) => string_array(values, "expected string commands")?,
toml::Value::Table(mut table) => match table.remove("run") {
Some(toml::Value::String(run)) => vec![run],
Some(toml::Value::Array(values)) => {
string_array(values, "expected `run` to contain string commands")?
}
Some(_) => bail!("expected `run` to be a string or array of strings"),
None => bail!("expected a `run` command"),
},
_ => bail!("expected a string, array of strings, or table with `run`"),
};
let hooks = runsView on GitHub (pinned to 533346cc37)