jdx/mise · error

bootstrap service ' ' sets , which only applies to `scope =…

Error message

bootstrap service '{name}' sets {}, which only applies to `scope = "user"` services

What it means

Some service declaration fields (e.g. user-level unit settings) are only meaningful for `scope = "user"` services. When composing system-scope declarations, mise rejects a system service that sets such user-only fields, since systemd would ignore or misinterpret them.

Solutions

  1. Remove the user-only fields from the system-scoped service declaration
  2. Or change the service to `scope = "user"` if the fields are intended
  3. Check the error message's field list and consult the service docs for which fields apply per scope

Example fix

# before (mise.toml)
[services.myapp]
scope = "system"
run_as = "alice"
# after
[services.myapp]
scope = "system"
Defensive patterns

Strategy: validation

Validate before calling

grep -A5 '\[services\.' mise.toml | grep -E 'scope|run_as' # ensure user-only keys are not set when scope = "system"

Prevention

When it happens

Trigger: `compose_system_declarations` (via `prepare_requests_from_config` or `reject_configured`) finds a declaration with `scope = "system"` whose `user_only_fields()` list is non-empty.

Common situations: Copy-pasting a user-service declaration and changing only the scope to "system" while leaving user-only keys; merging shared config templates that include user-only options.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


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

Appendix: source

Thrown at src/system/services_common.rs:214

                .insert(source.clone());
        }
    }
}

/// The system-scope entries of `[bootstrap.services]`, validated: fields that
/// only apply to user services are rejected here so a typo in `scope` cannot
/// silently turn a user service into a lookup of a system unit.
pub(crate) fn compose_system_declarations(
    config: &Config,
) -> Result<IndexMap<String, (ServiceTomlConfig, ResourceOrigin)>> {
    let mut out = IndexMap::new();
    for (name, (declaration, origin)) in compose_declarations(config)? {
        if declaration.scope() != ServiceScope::System {
            continue;
        }
        let user_only = declaration.user_only_fields();
        if !user_only.is_empty() {
            bail!(
                "bootstrap service '{name}' sets {}, which only applies to `scope = \"user\"` services",
                user_only.join(", ")
            );
        }
        out.insert(name, (declaration, origin));
    }
    Ok(out)
}

/// The user-scope entries of `[bootstrap.services]`.
pub(crate) fn compose_user_declarations(
    config: &Config,
) -> Result<IndexMap<String, (ServiceTomlConfig, ResourceOrigin)>> {
    Ok(compose_declarations(config)?
        .into_iter()
        .filter(|(_, (declaration, _))| declaration.scope() == ServiceScope::User)
        .collect())
}

View on GitHub (pinned to 533346cc37)