{"record":{"id":"71a6ddfd7cde2860","repo":"jdx/mise","slug":"user-service-name-cannot-be-masked-use-state","errorCode":null,"errorMessage":"user service '{name}' cannot be masked; use `state = \"absent\"` to remove it","messagePattern":"user service '(.+?)' cannot be masked; use `state = \"absent\"` to remove it","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/user_services.rs","lineNumber":86,"sourceCode":"        config: ServiceTomlConfig,\n        origin: Option<ResourceOrigin>,\n    ) -> Result<Self> {\n        Self::from_toml_with_executable(name, config, origin, durable_mise_executable())\n    }\n\n    fn from_toml_with_executable(\n        name: String,\n        config: ServiceTomlConfig,\n        origin: Option<ResourceOrigin>,\n        executable: Option<PathBuf>,\n    ) -> Result<Self> {\n        if !valid_name(&name) {\n            bail!(\n                \"user service name '{name}' must contain only letters, numbers, '.', '_', or '-'\"\n            );\n        }\n        if config.masked {\n            bail!(\"user service '{name}' cannot be masked; use `state = \\\"absent\\\"` to remove it\");\n        }\n        if config.on_change != super::services_common::ServiceChangeAction::default() {\n            bail!(\"user service '{name}': `on_change` only applies to system services\");\n        }\n        let mut description = config.description;\n        let mut restart = config.restart;\n        let mut nice = None;\n        let mut unresolved = None;\n        let command = match (config.builtin.as_deref(), config.command.as_deref()) {\n            (Some(_), Some(_)) => {\n                bail!(\"user service '{name}' sets both `builtin` and `command`; choose one\")\n            }\n            (None, None) => {\n                bail!(\"user service '{name}' must set `command` or `builtin`\")\n            }\n            (Some(builtin_name), None) => {\n                let Some(definition) = builtin(builtin_name) else {\n                    bail!(","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/user_services.rs#L68-L104","documentation":"User services managed by mise do not support the systemd 'masked' state. If a user service entry sets `masked = true`, parsing fails immediately because masking a user unit is not implemented; the library directs you to remove the service with `state = \"absent\"` instead. This is a fail-fast validation in `from_toml_with_executable` so bad config is rejected before any system mutation.","triggerScenarios":"Declaring a `[bootstrap.*.user_services]` (or equivalent) entry whose parsed config has `masked = true`; raised by `from_toml_with_executable` in src/system/user_services.rs:86 during config parsing.","commonSituations":"Copying a systemd unit config that used `Masked=true` into a mise user service block; trying to disable a user service by masking it instead of setting its state to absent.","solutions":["Set `masked = false` (or delete the `masked` key) on the user service entry","If the goal is to remove the service, set `state = \"absent\"` instead of masking","If the goal is to prevent startup, remove the entry from config entirely"],"exampleFix":"// before\n[[bootstrap.linux.user_services]]\nname = \"pulseaudio\"\ncommand = \"pulseaudio\"\nmasked = true\n\n// after\n[[bootstrap.linux.user_services]]\nname = \"pulseaudio\"\ncommand = \"pulseaudio\"\nstate = \"absent\"","handlingStrategy":"validation","validationCode":"fn validate_user_service(s: &UserServiceConfig) -> Result<(), String> {\n    if s.masked {\n        return Err(format!(\"user service '{}' cannot be masked; use state = \\\"absent\\\"\", s.name));\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never set `masked` on user services; masking is a system-service concept","Use `state = \"absent\"` to remove services","Review user service blocks when copying from system service config"],"tags":["config","validation","systemd","user-services"],"backgroundTag":"unsupported-config-value","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}