{"record":{"id":"6c4caad1c69380c0","repo":"jdx/mise","slug":"managed-system-files-are-only-supported-on-unix","errorCode":null,"errorMessage":"managed system files are only supported on Unix","messagePattern":"managed system files are only supported on Unix","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/managed_files.rs","lineNumber":802,"sourceCode":"                    resolve_group(group)?;\n                }\n            }\n        }\n    }\n    Ok(())\n}\n\n#[cfg(not(unix))]\npub fn validate_principals(\n    files: &[ManagedFileRequest],\n    directories: &[ManagedDirectoryRequest],\n    _accounts: Option<&super::accounts::AccountRequests>,\n    _allow_pending_accounts: bool,\n) -> Result<()> {\n    if files.is_empty() && directories.is_empty() {\n        return Ok(());\n    }\n    bail!(\"managed system files are only supported on Unix\")\n}\n\nimpl PrivilegedAction {\n    fn requires_preemptive_elevation(&self) -> Result<bool> {\n        match self {\n            // Ownership changes normally require privilege. Avoid creating or\n            // replacing a path before discovering that at set_metadata().\n            Self::WriteFile {\n                path,\n                owner,\n                group,\n                replace,\n                ..\n            } => Ok(owner.is_some()\n                || group.is_some()\n                || (*replace && replacement_is_not(path, ManagedPathKind::File)?)),\n            Self::CreateDirectory {\n                path,","sourceCodeStart":784,"sourceCodeEnd":820,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/system/managed_files.rs#L784-L820","documentation":"mise's managed system files feature ([bootstrap.files] / [bootstrap.directories] in mise.toml) applies Unix ownership semantics: chown for owner/group (uid/gid) and chmod for mode. The Windows build of validate_principals only accepts empty request lists; any file or directory request fails because owner/group principals cannot be resolved without Unix credentials. Empty tables are fine and return Ok.","triggerScenarios":"Running any code path that validates managed file/directory requests (e.g. mise bootstrap) on a Windows build while mise.toml contains non-empty [bootstrap.files] or [bootstrap.directories] tables.","commonSituations":"A team shares a mise.toml that manages /etc/... files; Windows teammates or Windows CI runners clone the repo and run mise bootstrap and hit the Unix-only guard immediately.","solutions":["Move [bootstrap.files]/[bootstrap.directories] entries out of the shared mise.toml into a config layer Windows never loads (e.g. a Unix-only environment config or mise.local.toml kept on Unix machines)","Remove the file/directory entries on Windows machines entirely","Keep the tables but empty on Windows - empty lists pass validation","Run the bootstrap on a Unix host (WSL, container, Linux CI runner) instead of native Windows"],"exampleFix":"# before (shared mise.toml, loaded on every OS)\n[bootstrap.files]\n\"/etc/app/app.conf\" = { content = \"key=value\", owner = \"app\", mode = \"0644\" }\n\n# after: keep managed files in a Unix-only config layer\n# mise.toml stays platform-neutral; entries live in a config Windows does not load\n[bootstrap.files]\n\"/etc/app/app.conf\" = { content = \"key=value\", owner = \"app\", mode = \"0644\" }","handlingStrategy":"validation","validationCode":"if cfg!(not(unix)) && !(files.is_empty() && directories.is_empty()) {\n    // skip managed-files handling on this platform instead of calling validate_principals\n}","typeGuard":"fn managed_files_supported() -> bool {\n    cfg!(unix)\n}","tryCatchPattern":"match validate_principals(&files, &dirs, accounts, allow_pending) {\n    Ok(()) => {}\n    Err(e) if e.to_string().contains(\"managed system files are only supported on Unix\") => {\n        // expected on Windows: skip or warn\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Keep OS-specific bootstrap resources in per-platform config layers","Gate managed-files config in CI by runner OS","Document in the repo README that managed system files are Unix-only"],"tags":["platform-support","windows","unix","bootstrap","managed-files","config"],"backgroundTag":"unsupported-platform","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}