{"record":{"id":"804497592c996899","repo":"jdx/mise","slug":"files","errorCode":null,"errorMessage":"files: {}","messagePattern":"files: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/files.rs","lineNumber":2250,"sourceCode":"            missing_sources.join(\"\\n\")\n        ));\n    }\n    if !broken.is_empty() {\n        problems.push(format!(\"entries with errors:\\n{}\", broken.join(\"\\n\")));\n    }\n    if !conflicts.is_empty() && !opts.force {\n        problems.push(format!(\n            \"refusing to overwrite existing files ({}):\\n{}\",\n            opts.force_hint,\n            conflicts\n                .iter()\n                .map(|p| format!(\"  {}\", p.display_user()))\n                .collect::<Vec<_>>()\n                .join(\"\\n\")\n        ));\n    }\n    if !problems.is_empty() {\n        bail!(\"files: {}\", problems.join(\"\\nfiles: \"));\n    }\n    Ok(ApplyPlan {\n        todo,\n        record_symlink_each,\n        reconciliation: plan_symlink_each_reconciliation(active_requests, requests)?,\n    })\n}\n\nfn cleanup_reconciled_directories(reconciliation: &SymlinkEachReconciliation) -> Result<()> {\n    for target in &reconciliation.targets {\n        for start in reconciliation\n            .stale_links\n            .iter()\n            .filter(|link| link.target.starts_with(target))\n            .filter_map(|link| link.target.parent())\n            .sorted_by_key(|path| std::cmp::Reverse(path.components().count()))\n            .unique()\n        {","sourceCodeStart":2232,"sourceCodeEnd":2268,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/files.rs#L2232-L2268","documentation":"Aggregate error raised while building an apply plan: one or more `[files]` entries failed validation, and the per-entry problem lines are joined and prefixed with \"files: \". Each problem line names the failing entry and its underlying error.","triggerScenarios":"Calling the files apply/planning API when any dotfiles entry has a validation problem (missing source, invalid target, unreadable path, etc.); problems collected during plan construction are non-empty.","commonSituations":"A config entry references a deleted source file, a target path with wrong type, or another per-entry error surfaced during validation before anything is applied.","solutions":["Read each problem line in the message; it names the `[files]` entry (by target) and the underlying error.","Fix the referenced config entry in mise.toml (source path, target path).","Re-run after all listed entries validate."],"exampleFix":"// before (mise.toml)\n[[files]]\nsource = \"~/dotfiles/vimrc\"\ntarget = \"~/.vimrc\"  # ~/dotfiles/vimrc was deleted\n\n// after\n# restore the file in the repo or remove the [[files]] entry\n[[files]]\nsource = \"~/dotfiles/vimrc\"\ntarget = \"~/.vimrc\"","handlingStrategy":"validation","validationCode":"fn validate_files_entries(config: &toml::Value) -> anyhow::Result<()> {\n    if let Some(entries) = config.get(\"files\").and_then(|f| f.as_array()) {\n        for e in entries {\n            let source = e.get(\"source\").and_then(|s| s.as_str())\n                .ok_or_else(|| anyhow::anyhow!(\"[[files]] entry missing source\"))?;\n            if !std::path::Path::new(shellexpand::tilde(source).as_ref()).exists() {\n                anyhow::anyhow::bail!(\"[[files]] source does not exist: {source}\");\n            }\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().starts_with(\"files: \") => {\n        eprintln!(\"Fix each listed [files] entry in mise.toml:\\n{e}\");\n    }\n    Err(e) => return Err(e),\n    Ok(plan) => apply(plan),\n}","preventionTips":["Run a dry-run/plan before applying files changes.","Keep [[files]] sources and targets under version control and validate paths after moves/renames.","Remove config entries for deleted sources immediately."],"tags":["dotfiles","config","validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}