jdx/mise · error
files: entries with errors
Error message
files: entries with errors:
{} What it means
Before applying dotfiles, mise renders every `template`-mode entry; if any render fails, it collects all errors and bails with a single aggregated 'files: entries with errors' listing each failure. This gives one report of every broken template instead of failing on the first.
Solutions
- Read each listed sub-error and fix the corresponding template (syntax, variables).
- Define the missing variables/secrets the template references.
- Change problematic entries from template mode to plain copy if templating is not needed.
Example fix
// before
"~/.gitconfig" = { source = "gitconfig.tmpl", mode = "template" } // uses {{ email }} which is unset
// after (config)
[files.env]
email = "me@example.com"
// or fix the .tmpl file's syntax/variable name Defensive patterns
Strategy: try-catch
Validate before calling
// Render each template locally before apply:
for (target, entry) in template_entries {
render_template(&config, entry, &secrets)
.unwrap_or_else(|e| eprintln!("{target}: {e}"));
} Try / catch
match dotfiles_apply() {
Err(e) if e.to_string().starts_with("files: entries with errors:") => {
for line in e.to_string().lines().skip(1) { eprintln!("fix: {line}"); }
}
other => other?,
} Prevention
- Keep template variables defined in the same config file that uses them.
- Set required secrets before running apply.
- Preview renders with status/dry-run before applying.
When it happens
Trigger: Running dotfile apply/status where one or more `mode = "template"` entries fail render_template — undefined variables, bad template syntax, missing secrets referenced in the template.
Common situations: A template references a secret that is not set; Tera/Jinja syntax error after editing; variable renamed in a newer config; template depends on machine-specific context absent on a new host.
Related errors
- dotfile cannot declare both source and content
- dotfile : inline content does not support mode, exclude, or…
- dotfile target must be absolute or start with ~/
- failed to list Git-tracked files in
- failed to locate Git repository for
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/e2db085d68d30b07.
Report an issue: GitHub.
Appendix: source
Thrown at src/system/files.rs:1721
}
/// Render every configured dotfile template before a full bootstrap can
/// mutate anything. Secret values are cached, but templates are rendered again
/// when applied so hooks can update dynamic inputs such as files or commands.
pub(crate) fn preflight_templates(
config: &Config,
requests: &[FileRequest],
secrets: &SecretValues,
) -> Result<()> {
validate_composed_file_footprints(requests)?;
let broken = requests
.iter()
.filter(|req| req.mode == FileMode::Template)
.filter_map(|req| render_template(config, req, secrets).err())
.map(|err| format!(" {err}"))
.collect::<Vec<_>>();
if !broken.is_empty() {
bail!("files: entries with errors:\n{}", broken.join("\n"));
}
Ok(())
}
/// directories a symlink-each entry needs: the target itself plus every
/// intermediate directory for nested source files
fn needed_dirs(req: &FileRequest) -> Result<Vec<PathBuf>> {
let mut out = indexmap::IndexSet::new();
out.insert(req.target.clone());
for (_, target) in walk_source_files(req)? {
let mut dir = target.parent();
while let Some(d) = dir {
if d == req.target {
break;
}
out.insert(d.to_path_buf());
dir = d.parent();
}View on GitHub (pinned to 533346cc37)