{"record":{"id":"4f124b267256cd9f","repo":"jdx/mise","slug":"bootstrap-service-name-cannot-be-both-masked-a-4f124b","errorCode":null,"errorMessage":"bootstrap service '{name}' cannot be both masked and enabled","messagePattern":"bootstrap service '(.+?)' cannot be both masked and enabled","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/services.rs","lineNumber":125,"sourceCode":"}\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);\n        let desired = self.desired();\n        let Some(inspection) = &self.inspection else {\n            return self.with_origin(ResourcePlan::new(","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/services.rs#L107-L143","documentation":"Masking a unit also disables it, so masked=true combined with enabled=true is contradictory. mise rejects this combination when constructing the Service resource from TOML to avoid undefined or unsafe apply behavior.","triggerScenarios":"Loading a config where a [bootstrap.services.*] table sets masked = true together with enabled = true.","commonSituations":"An existing enabled service that someone added masked = true to in order to 'turn off', instead of disabling it; template or copied config blocks carrying both flags.","solutions":["Set enabled = false (or drop the line) when masked = true, since masking already prevents enabling","Remove masked = true if you actually want the service enabled","Use masked + enabled=false deliberately to fully lock a unit"],"exampleFix":"# before\n[bootstrap.services.myunit]\nmasked = true\nenabled = true\n# after\n[bootstrap.services.myunit]\nmasked = true\nenabled = false","handlingStrategy":"validation","validationCode":"if svc.masked && svc.enabled {\n    eprintln!(\"{}: masked and enabled are mutually exclusive\", svc.name);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["To disable a service permanently, prefer masked = true with enabled omitted/false","Do not add masked=true on top of an already-enabled service as a 'kill switch'","Validate service tables whenever configs are merged or templated"],"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"}