jdx/mise · error

default inline shell args must not be empty

Error message

default inline shell args must not be empty

What it means

run_phase in src/system/hooks.rs resolves the configured default inline shell via Settings::get().default_inline_shell() and expects it as a non-empty [program, args...] vector. If the shell setting resolves to an empty vector (split_first returns None), it cannot spawn hooks and bails with this error. It is an internal/config invariant that the default inline shell has at least a program name.

Solutions

  1. Set default_inline_shell to a valid shell invocation, e.g. "/bin/bash -c" or "sh -c"
  2. Remove the empty default_inline_shell setting to fall back to the platform default
  3. Check global and project mise.toml/settings for an empty value and fix it

Example fix

# before
default_inline_shell = ""
# after
default_inline_shell = "/bin/bash -c"
Defensive patterns

Strategy: validation

Validate before calling

# ensure the inline shell setting is non-empty before running hooks
shell = settings.get("default_inline_shell")
assert shell and shell.strip(), "default_inline_shell must be a non-empty shell command"

Try / catch

match run_phase(...).await {
    Err(e) if e.to_string().contains("default inline shell") =>
        eprintln!("fix default_inline_shell in settings; falling back to /bin/sh -c"),
    Err(e) => return Err(e),
    Ok(v) => Ok(v),
}

Prevention

When it happens

Trigger: The default_inline_shell setting is set to an empty string or empty array so Settings::default_inline_shell() yields an empty vec; run_phase then tries to split_first() before launching phase hooks.

Common situations: Users setting default_inline_shell = "" or [] in global or project config to 'disable' the inline shell; broken settings migrations leaving the value empty; trimming whitespace-only values that become empty.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/9b9f8caf6c4e75ed. Report an issue: GitHub.

Appendix: source

Thrown at src/system/hooks.rs:144

        }
    }
    Ok(out)
}

pub(crate) async fn run_phase(
    config: &Config,
    hooks: &[BootstrapHook],
    phase: BootstrapHookPhase,
    dry_run: bool,
) -> Result<()> {
    let phase_hooks: Vec<_> = hooks.iter().filter(|hook| hook.phase == phase).collect();
    if phase_hooks.is_empty() {
        return Ok(());
    }
    info!("bootstrap: {phase} hooks");
    let shell = Settings::get().default_inline_shell()?;
    let Some((program, shell_args)) = shell.split_first() else {
        bail!("default inline shell args must not be empty");
    };
    for hook in phase_hooks {
        let run = if crate::tera::contains_template_syntax(&hook.run) {
            let mut tera = if dry_run {
                crate::tera::get_tera_for_dry_run(hook.config_path.parent())
            } else {
                crate::tera::get_tera(hook.config_path.parent())
            };
            let mut context = config.bootstrap_tera_ctx(&hook.config_path).clone();
            if context.get("config_root").is_none() {
                let config_root =
                    crate::config::config_file::config_root::config_root(&hook.config_path);
                context.insert("config_root", &config_root);
            }
            crate::tera::render_str(&mut tera, &hook.run, &context).map_err(|err| {
                eyre::eyre!(
                    "[bootstrap.hooks.{phase}] in {}: failed to render template: {err}",
                    hook.config_path.display()

View on GitHub (pinned to 533346cc37)