jdx/mise · error

user service ' ': `on_change` only applies to system…

Error message

user service '{name}': `on_change` only applies to system services

What it means

User-scope service parsing found a non-default on_change action. on_change (restarting dependent services on change) only applies to system services managed via systemd units; for user services it is meaningless, so from_toml_with_executable rejects the config.

Solutions

  1. Remove `on_change` from the user service declaration
  2. Move the service to system scope ([bootstrap.linux.systemd.units]) if on_change is needed
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/system/user_services.rs:89 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at src/system/user_services.rs:89

        Self::from_toml_with_executable(name, config, origin, durable_mise_executable())
    }

    fn from_toml_with_executable(
        name: String,
        config: ServiceTomlConfig,
        origin: Option<ResourceOrigin>,
        executable: Option<PathBuf>,
    ) -> 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(", ")
                    );

View on GitHub (pinned to 533346cc37)