jdx/mise · error · eyre::Report
[bootstrap.files]." ": absent files must not declare source…
Error message
[bootstrap.files]."{}": absent files must not declare source or content What it means
The mirror of the previous case: a file declared state = "absent" is only being removed, so attaching a body makes no sense. from_toml bails via the catch-all (_, _, ManagedState::Absent) arm when an absent file declares source or content.
Solutions
- Remove the `content` and `source` keys from the absent file entry.
- Keep the body definition in a separate commented-out or versioned entry if it may return later.
Example fix
# before [bootstrap.files."/etc/old.conf"] content = "stale" state = "absent" # after [bootstrap.files."/etc/old.conf"] state = "absent"
Defensive patterns
Strategy: validation
Validate before calling
// rust
fn validate_absent(entry: &FileEntry) -> Result<(), &'static str> {
if entry.state == State::Absent && (entry.source.is_some() || entry.content.is_some()) {
return Err("absent files must not declare source or content");
}
Ok(())
} Prevention
- When flipping state to absent, delete the content/source keys at the same time.
- Model absent files with a dedicated type (e.g. RemovedFile { path }) that has no body field.
- Add a schema enum: present requires body, absent forbids it.
When it happens
Trigger: Parsing a [bootstrap.files] entry with state = "absent" where `source` and/or `content` is Some.
Common situations: Flipping an existing present-file entry to absent to decommission it while leaving its old content/source keys in place; bulk search-replace of state without pruning content.
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]." ": source and content are mutually…
- [bootstrap.directories].
- [bootstrap.files]." ": present files require source or…
- 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/d67e8d06c6c72b4a.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/managed_files.rs:617
)
}
(Some(source), None, ManagedState::Present) => {
let source = resolve_source_path(base, &source);
Some(fs::read_to_string(&source).wrap_err_with(|| {
format!(
"[bootstrap.files].\"{}\": failed to read source {}",
path.display(),
source.display()
)
})?)
}
(None, Some(content), ManagedState::Present) => Some(content),
(None, None, ManagedState::Present) => bail!(
"[bootstrap.files].\"{}\": present files require source or content",
path.display()
),
(None, None, ManagedState::Absent) => None,
(_, _, ManagedState::Absent) => bail!(
"[bootstrap.files].\"{}\": absent files must not declare source or content",
path.display()
),
};
if config.template {
let rendered = content
.as_deref()
.map(|content| secrets.render(root_config, content, base, &path, &origin.config))
.transpose()
.wrap_err_with(|| {
format!(
"[bootstrap.files].\"{}\": failed to render template",
path.display()
)
})?;
content = rendered;
}
Ok(Self {View on GitHub (pinned to 533346cc37)