{"record":{"id":"d956527681cb36a8","repo":"jdx/mise","slug":"bootstrap-service-name-sets-which-only-app","errorCode":null,"errorMessage":"bootstrap service '{name}' sets {}, which only applies to `scope = \"user\"` services","messagePattern":"bootstrap service '(.+?)' sets (.+?), which only applies to `scope = \"user\"` services","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/services_common.rs","lineNumber":208,"sourceCode":"                .insert(source.clone());\n        }\n    }\n}\n\n/// The system-scope entries of `[bootstrap.services]`, validated: fields that\n/// only apply to user services are rejected here so a typo in `scope` cannot\n/// silently turn a user service into a lookup of a system unit.\npub(crate) fn compose_system_declarations(\n    config: &Config,\n) -> Result<IndexMap<String, (ServiceTomlConfig, ResourceOrigin)>> {\n    let mut out = IndexMap::new();\n    for (name, (declaration, origin)) in compose_declarations(config)? {\n        if declaration.scope() != ServiceScope::System {\n            continue;\n        }\n        let user_only = declaration.user_only_fields();\n        if !user_only.is_empty() {\n            bail!(\n                \"bootstrap service '{name}' sets {}, which only applies to `scope = \\\"user\\\"` services\",\n                user_only.join(\", \")\n            );\n        }\n        out.insert(name, (declaration, origin));\n    }\n    Ok(out)\n}\n\n/// The user-scope entries of `[bootstrap.services]`.\npub(crate) fn compose_user_declarations(\n    config: &Config,\n) -> Result<IndexMap<String, (ServiceTomlConfig, ResourceOrigin)>> {\n    Ok(compose_declarations(config)?\n        .into_iter()\n        .filter(|(_, (declaration, _))| declaration.scope() == ServiceScope::User)\n        .collect())\n}","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/services_common.rs#L190-L226","documentation":"mise validates bootstrap (systemd) service declarations at config-load time. Fields returned by `user_only_fields()` (such as restart/WakeSystem-ish options) are only meaningful for `scope = \"user\"` services, so if a `scope = \"system\"` service sets them, compose_system_declarations rejects the config with this message listing the offending fields.","triggerScenarios":"A `[bootstrap_services.<name>]` (or equivalent config) block with `scope = \"system\"` (or omitted, defaulting to system) that also sets a user-only field; raised from compose_system_declarations during prepare_requests_from_config or reject_configured.","commonSituations":"Copying a user-scope service example and changing the scope to system without removing user-only fields; typos where a field intended for user services lands in the system service block.","solutions":["Remove the listed user-only fields from the system-scope service declaration","Change the service to `scope = \"user\"` if you actually need those fields","Consult mise bootstrap service docs for which fields are valid per scope"],"exampleFix":"// before\n[bootstrap_services.myapp]\nscope = \"system\"\nfoo_only_for_user = true\n\n// after\n[bootstrap_services.myapp]\nscope = \"system\"","handlingStrategy":"validation","validationCode":"if decl.scope() == ServiceScope::System && !decl.user_only_fields().is_empty() {\n    eprintln!(\"move user-only fields out of system service: {:?}\", decl.user_only_fields());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep user-only options only in `scope = \"user\"` service blocks","Validate config with mise before committing it (e.g. `mise config ls` / doctor)","Copy service examples from docs matching the intended scope"],"tags":["config","validation","services"],"backgroundTag":"invalid-config-value","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"}