jdx/mise · error

user service '{name}' sets both `builtin` and `command`; cho

Error message

user service '{name}' sets both `builtin` and `command`; choose one

What it means

A user service must define exactly one of `builtin` (a named built-in service definition) or `command` (a custom command). Supplying both is ambiguous, so parsing fails with this error asking you to choose one.

Source

Thrown at src/system/user_services.rs:97

    ) -> Result<Self> {
        if !valid_name(&name) {
            bail!(
                "user service name '{name}' must contain only letters, numbers, '.', '_', or '-'"
            );
        }
        if config.masked {
            bail!("user service '{name}' cannot be masked; use `state = \"absent\"` to remove it");
        }
        if config.on_change != super::services_common::ServiceChangeAction::default() {
            bail!("user service '{name}': `on_change` only applies to system services");
        }
        let mut description = config.description;
        let mut restart = config.restart;
        let mut nice = None;
        let mut unresolved = None;
        let command = match (config.builtin.as_deref(), config.command.as_deref()) {
            (Some(_), Some(_)) => {
                bail!("user service '{name}' sets both `builtin` and `command`; choose one")
            }
            (None, None) => {
                bail!("user service '{name}' must set `command` or `builtin`")
            }
            (Some(builtin_name), None) => {
                let Some(definition) = builtin(builtin_name) else {
                    bail!(
                        "user service '{name}' names unknown builtin '{builtin_name}'; available: {}",
                        BUILTIN_NAMES.join(", ")
                    );
                };
                description.get_or_insert_with(|| definition.description.to_string());
                restart.get_or_insert(definition.restart);
                nice = definition.nice;
                match executable {
                    Some(exe) => Some(
                        std::iter::once(quote_program(&exe.to_string_lossy()))
                            .chain(definition.args.iter().map(|arg| arg.to_string()))

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Keep `builtin` and delete the `command` key if you want the predefined service
  2. Keep `command` and delete the `builtin` key if you want a custom command

Example fix

// before
[[bootstrap.linux.user_services]]
name = "syncthing"
builtin = "syncthing"
command = "syncthing -no-browser"

// after
[[bootstrap.linux.user_services]]
name = "syncthing"
command = "syncthing -no-browser"
Defensive patterns

Strategy: validation

Validate before calling

fn validate_user_service(s: &UserServiceConfig) -> Result<(), String> {
    if s.builtin.is_some() && s.command.is_some() {
        return Err(format!("user service '{}': set only one of builtin/command", s.name));
    }
    Ok(())
}

Prevention

When it happens

Trigger: A user service entry in config sets both `builtin = "..."` and `command = "..."`; detected in the match on `(config.builtin.as_deref(), config.command.as_deref())` at src/system/user_services.rs:97.

Common situations: Extending a built-in service by adding a custom `command` alongside `builtin`; copy-paste between entries where one used builtin and one used command.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/21eddbc9ddb286b2. Report an issue: GitHub.