{"record":{"id":"a02e62b8514d428b","repo":"jdx/mise","slug":"bootstrap-service-name-cannot-be-both-masked-a","errorCode":null,"errorMessage":"bootstrap service '{name}' cannot be both masked and running","messagePattern":"bootstrap service '(.+?)' cannot be both masked and running","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/services.rs","lineNumber":122,"sourceCode":"    for request in requests {\n        request.inspection = Some(inspect_service(&systemctl, &request.unit));\n    }\n}\n\nimpl ServiceRequest {\n    #[cfg(test)]\n    fn from_toml(name: String, config: ServiceTomlConfig) -> Result<Self> {\n        Self::from_toml_with_origin(name, config, None)\n    }\n\n    fn from_toml_with_origin(\n        name: String,\n        config: ServiceTomlConfig,\n        origin: Option<ResourceOrigin>,\n    ) -> Result<Self> {\n        let unit = normalize_unit_name(&name)?;\n        if config.masked && config.state == ServiceState::Running {\n            bail!(\"bootstrap service '{name}' cannot be both masked and running\");\n        }\n        if config.masked && config.enabled {\n            bail!(\"bootstrap service '{name}' cannot be both masked and enabled\");\n        }\n        Ok(Self {\n            name,\n            unit,\n            state: config.state,\n            enabled: config.enabled,\n            masked: config.masked,\n            on_change: config.on_change,\n            origin,\n            inspection: None,\n        })\n    }\n\n    pub(crate) fn plan(&self) -> ResourcePlan {\n        let id = ResourceId::new(\"service\", &self.name);","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/services.rs#L104-L140","documentation":"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.","triggerScenarios":"Loading a mise.toml where a [bootstrap.services.*] entry has masked = true and state = \"running\" (or the default running state) at the same time.","commonSituations":"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.","solutions":["Remove masked = true if the service should actually run","Change state to something other than running (e.g. \"stopped\") if the unit really should be masked","Split into two logically distinct configurations rather than combining mask+run"],"exampleFix":"# before\n[bootstrap.services.myunit]\nmasked = true\nstate = \"running\"\n# after\n[bootstrap.services.myunit]\nmasked = true\nstate = \"stopped\"","handlingStrategy":"validation","validationCode":"// reject mask+running in your own config lint before apply\nfor svc in services {\n    if svc.masked && svc.state == \"running\" {\n        eprintln!(\"{}: masked and running are mutually exclusive\", svc.name);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember masked=true implies stopped and disabled — never pair it with running/enabled","Lint bootstrap service tables for mutually exclusive flags in CI","Keep one source of truth for service state to avoid layered conflicting edits"],"tags":["config","services","validation","conflict"],"backgroundTag":"conflicting-config-options","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}