jdx/mise · error · eyre::Report
[bootstrap.directories].
Error message
[bootstrap.directories]."{}": recursive is only valid with state = "absent" What it means
ManagedDirectoryTomlConfig conversion validates that the `recursive` flag is only used with state = "absent": recursion controls recursive removal and is meaningless (and likely a mistake) for directory creation. from_toml bails when state is Present and recursive is true.
Solutions
- Remove `recursive = true` from the present-state directory entry.
- If recursive removal is intended, keep recursive and set state = "absent" instead.
- Create needed parent directories as their own present-state directory entries.
Example fix
# before
[bootstrap.directories]
"/var/lib/app" = { state = "present", recursive = true }
# after
[bootstrap.directories]
"/var/lib/app" = { state = "present" } Defensive patterns
Strategy: validation
Validate before calling
// rust
fn validate_dir_entry(state: State, recursive: bool) -> Result<(), &'static str> {
if state == State::Present && recursive {
return Err("recursive is only valid with state = \"absent\"");
}
Ok(())
} Prevention
- Treat recursive as a removal-only flag; document it next to state = "absent" examples.
- When flipping an absent+recursive entry to present, always drop recursive.
- Use a schema where recursive is nested under an absent-only variant.
When it happens
Trigger: Building a managed directory from TOML where the table sets both `state = "present"` and `recursive = true`.
Common situations: Copy-pasting an absent-directory entry and flipping state to present without dropping recursive; misunderstanding recursive as 'create parent directories too'.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- [bootstrap.files]." ": absent files must not declare source…
- [bootstrap.files]." ": present files require source or…
- [bootstrap.files]." ": source and content are mutually…
- managed path ' ' cannot be present while managed ancestor '…
- managed path ' ' ( ) conflicts with ancestor ' ' ( )…
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/9db22ad810fc4432.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/managed_files.rs:706
crate::file::replace_path(source)
} else {
PathBuf::from(source)
};
if source.is_absolute() {
source
} else {
base.join(source)
}
}
impl ManagedDirectoryRequest {
fn from_toml(
path: PathBuf,
config: ManagedDirectoryTomlConfig,
origin: ResourceOrigin,
) -> Result<Self> {
if config.state == ManagedState::Present && config.recursive {
bail!(
"[bootstrap.directories].\"{}\": recursive is only valid with state = \"absent\"",
path.display()
);
}
Ok(Self {
path,
phase: config.phase,
owner: nonempty("owner", config.owner)?,
group: nonempty("group", config.group)?,
mode: parse_mode(config.mode.as_deref(), 0o755)?,
state: config.state,
recursive: config.recursive,
replace: config.replace,
notify: config.notify,
origin,
inspection: None,
})
}View on GitHub (pinned to 533346cc37)