{"record":{"id":"21eddbc9ddb286b2","repo":"jdx/mise","slug":"user-service-name-sets-both-builtin-and-com","errorCode":null,"errorMessage":"user service '{name}' sets both `builtin` and `command`; choose one","messagePattern":"user service '(.+?)' sets both `builtin` and `command`; choose one","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/user_services.rs","lineNumber":97,"sourceCode":"    ) -> 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!(\n                        \"user service '{name}' names unknown builtin '{builtin_name}'; available: {}\",\n                        BUILTIN_NAMES.join(\", \")\n                    );\n                };\n                description.get_or_insert_with(|| definition.description.to_string());\n                restart.get_or_insert(definition.restart);\n                nice = definition.nice;\n                match executable {\n                    Some(exe) => Some(\n                        std::iter::once(quote_program(&exe.to_string_lossy()))\n                            .chain(definition.args.iter().map(|arg| arg.to_string()))","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/user_services.rs#L79-L115","documentation":"A user service must define exactly one of `builtin` (a named built-in service definition) or `command` (a custom command). Supplying both is ambiguous, so parsing fails with this error asking you to choose one.","triggerScenarios":"A user service entry in config sets both `builtin = \"...\"` and `command = \"...\"`; detected in the match on `(config.builtin.as_deref(), config.command.as_deref())` at src/system/user_services.rs:97.","commonSituations":"Extending a built-in service by adding a custom `command` alongside `builtin`; copy-paste between entries where one used builtin and one used command.","solutions":["Keep `builtin` and delete the `command` key if you want the predefined service","Keep `command` and delete the `builtin` key if you want a custom command"],"exampleFix":"// before\n[[bootstrap.linux.user_services]]\nname = \"syncthing\"\nbuiltin = \"syncthing\"\ncommand = \"syncthing -no-browser\"\n\n// after\n[[bootstrap.linux.user_services]]\nname = \"syncthing\"\ncommand = \"syncthing -no-browser\"","handlingStrategy":"validation","validationCode":"fn validate_user_service(s: &UserServiceConfig) -> Result<(), String> {\n    if s.builtin.is_some() && s.command.is_some() {\n        return Err(format!(\"user service '{}': set only one of builtin/command\", s.name));\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Decide up front: builtin for predefined services, command for custom ones","Avoid editing a builtin entry by adding a command; pick one mechanism"],"tags":["config","validation","mutually-exclusive","user-services"],"backgroundTag":"mutually-exclusive-options","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}