jdx/mise · error
edits: cannot apply these entries, fix them manually
Error message
edits: cannot apply these entries, fix them manually:
{} What it means
Before applying, `apply` validates every `[dotfiles]` entry and collects the problems reported by per-entry resolution (mutually exclusive fields, unknown values, marker conflicts, and so on). If any problems were found it bails with an aggregated message listing the offending entries and refuses to modify any files, so the user can fix the entries manually rather than having apply skip or partially write edits.
Solutions
- Read each listed problem line and fix the corresponding entry in your config (remove conflicting fields, correct values).
- Manually repair the target file if the problem is about reconciling existing content (e.g. restore or delete the stale marker region).
- Remove entries you no longer want.
- Re-run the apply command; it should proceed or report only remaining problems.
Example fix
# before (config with a problem entry) [dotfiles."~/.zshrc".broken] line = "export FOO=1" block = "export BAR=2" # after [dotfiles."~/.zshrc".broken] line = "export FOO=1"
Defensive patterns
Strategy: try-catch
Validate before calling
// pre-validate all entries before invoking apply
for (id, e) in &entries {
let ops = [e.block.is_some(), e.source.is_some(), e.line.is_some()].iter().filter(|b| **b).count();
if ops != 1 { return Err(format!("entry {id}: exactly one of block/source/line required")); }
} Try / catch
match mise_edits_apply() {
Err(e) if e.to_string().starts_with("edits: cannot apply these entries") => {
// parse the per-entry problem list from e and fix config entries manually
}
other => other?,
} Prevention
- Run `mise edits` (diff mode) before every apply to surface problem entries without touching files.
- Keep one operation field and only documented option values in each entry.
- After upgrading mise, re-validate existing entries against new validation rules.
- Don't hand-edit marker regions in target files; let mise manage them.
When it happens
Trigger: Running an apply variant (e.g. `mise edits apply`) while one or more entries in the config fail validation in `resolve_entry`, or a target file's current content cannot be reconciled with the desired edit. All collected problem strings are joined and raised at src/system/edits.rs:689.
Common situations: Users upgrade mise and old entries with now-invalid fields (bad template, position-with-block, newline in line) suddenly block the whole apply; a mis-edited config after manual tweaking; an entry whose marker region in the target file was deleted or corrupted by hand.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- `--all` needs `--to
- at least one target or --changed is required
- cannot apply
- --changed does not accept target arguments
- destination variants require an explicit source when any…
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/1eece8be77c26c2d.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/edits.rs:689
// markers exist: compare content to see if anything would change
None => match block_state(req, desired.as_deref()) {
Ok(FileState::Applied) => continue,
Ok(_) => todo.push((req, desired)),
Err(err) => {
problems.push(format!(
" \"{}\" ({}): {err}",
req.path_raw,
req.describe_op()
));
continue;
}
},
// missing — needs applying
Some(_) => todo.push((req, desired)),
}
}
if !problems.is_empty() {
bail!(
"edits: cannot apply these entries, fix them manually:\n{}",
problems.join("\n")
);
}
if todo.is_empty() {
info!("edits: all edits are applied");
return Ok(true);
}
if opts.dry_run {
for (req, desired) in &todo {
// template state wasn't computed (no rendering on dry runs), so
// the entry may already be converged
let conditional =
desired.is_none() && matches!(&req.op, EditOp::Block { template: true, .. });
let suffix = if conditional { " (if changed)" } else { "" };
miseprintln!(
"edit {} ({}){suffix}",
req.path.display_user(),View on GitHub (pinned to 533346cc37)