jdx/mise · error

bootstrap service ' ' cannot be both masked and running

Error message

bootstrap service '{name}' cannot be both masked and running

What it means

A masked systemd-style unit must never be started, so a bootstrap service config that simultaneously sets masked=true and state=running is self-contradictory. mise rejects it at parse time (from_toml_with_origin) rather than applying an ambiguous or unsafe state.

Solutions

  1. Remove masked = true if the service should actually run
  2. Change state to something other than running (e.g. "stopped") if the unit really should be masked
  3. Split into two logically distinct configurations rather than combining mask+run

Example fix

# before
[bootstrap.services.myunit]
masked = true
state = "running"
# after
[bootstrap.services.myunit]
masked = true
state = "stopped"
Defensive patterns

Strategy: validation

Validate before calling

// reject mask+running in your own config lint before apply
for svc in services {
    if svc.masked && svc.state == "running" {
        eprintln!("{}: masked and running are mutually exclusive", svc.name);
    }
}

Prevention

When it happens

Trigger: Loading a mise.toml where a [bootstrap.services.*] entry has masked = true and state = "running" (or the default running state) at the same time.

Common situations: Copying a masked unit snippet and forgetting the existing state line, or a tool-generated config layering masked=true on top of an earlier state=running declaration.

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/a02e62b8514d428b. Report an issue: GitHub.

Appendix: source

Thrown at src/system/services.rs:122

    for request in requests {
        request.inspection = Some(inspect_service(&systemctl, &request.unit));
    }
}

impl ServiceRequest {
    #[cfg(test)]
    fn from_toml(name: String, config: ServiceTomlConfig) -> Result<Self> {
        Self::from_toml_with_origin(name, config, None)
    }

    fn from_toml_with_origin(
        name: String,
        config: ServiceTomlConfig,
        origin: Option<ResourceOrigin>,
    ) -> Result<Self> {
        let unit = normalize_unit_name(&name)?;
        if config.masked && config.state == ServiceState::Running {
            bail!("bootstrap service '{name}' cannot be both masked and running");
        }
        if config.masked && config.enabled {
            bail!("bootstrap service '{name}' cannot be both masked and enabled");
        }
        Ok(Self {
            name,
            unit,
            state: config.state,
            enabled: config.enabled,
            masked: config.masked,
            on_change: config.on_change,
            origin,
            inspection: None,
        })
    }

    pub(crate) fn plan(&self) -> ResourcePlan {
        let id = ResourceId::new("service", &self.name);

View on GitHub (pinned to 533346cc37)