{"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":214,"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":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/services_common.rs#L196-L232","documentation":"Some service declaration fields (e.g. user-level unit settings) are only meaningful for `scope = \"user\"` services. When composing system-scope declarations, mise rejects a system service that sets such user-only fields, since systemd would ignore or misinterpret them.","triggerScenarios":"`compose_system_declarations` (via `prepare_requests_from_config` or `reject_configured`) finds a declaration with `scope = \"system\"` whose `user_only_fields()` list is non-empty.","commonSituations":"Copy-pasting a user-service declaration and changing only the scope to \"system\" while leaving user-only keys; merging shared config templates that include user-only options.","solutions":["Remove the user-only fields from the system-scoped service declaration","Or change the service to `scope = \"user\"` if the fields are intended","Check the error message's field list and consult the service docs for which fields apply per scope"],"exampleFix":"# before (mise.toml)\n[services.myapp]\nscope = \"system\"\nrun_as = \"alice\"\n# after\n[services.myapp]\nscope = \"system\"","handlingStrategy":"validation","validationCode":"grep -A5 '\\[services\\.' mise.toml | grep -E 'scope|run_as' # ensure user-only keys are not set when scope = \"system\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check the per-scope field documentation before adding keys","When converting user services to system scope, strip user-only fields","Keep separate config templates per scope"],"tags":["config","systemd","validation"],"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"}