{"record":{"id":"538d40bfe4ff43b2","repo":"jdx/mise","slug":"dotfiles-req-target-raw-source-does-not-exi","errorCode":null,"errorMessage":"[dotfiles].\"{req.target_raw}\": source does not exist: {req.source.display}","messagePattern":"\\[dotfiles\\]\\.\"(.+?)\": source does not exist: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/oci/builder.rs","lineNumber":931,"sourceCode":"\nfn resolve_layer_owner(opts_owner: Option<LayerOwner>, oci: &OciConfig) -> LayerOwner {\n    opts_owner.unwrap_or_else(|| {\n        let uid = oci.user_id.unwrap_or(0);\n        let gid = oci.group_id.unwrap_or(uid);\n        LayerOwner::new(uid, gid)\n    })\n}\n\nfn build_dotfiles_layer(\n    cfg: &Config,\n    requests: &[FileRequest],\n    owner: LayerOwner,\n) -> Result<LayerBlob> {\n    let mut entries = DotfilesLayerEntries::default();\n\n    for req in requests {\n        if !matches!(req.mode, FileMode::Content | FileMode::Track) && !req.source.exists() {\n            bail!(\n                \"[dotfiles].\\\"{}\\\": source does not exist: {}\",\n                req.target_raw,\n                req.source.display()\n            );\n        }\n\n        match req.mode {\n            // a tracked file lives on the machine that tracks it; an image\n            // has nothing to copy\n            FileMode::Track => continue,\n            FileMode::Symlink | FileMode::Copy => {\n                collect_source_as_files(&req.source, &oci_target_path(req)?, &mut entries)\n                    .wrap_err_with(|| {\n                        format!(\"adding [dotfiles].\\\"{}\\\" to OCI image\", req.target_raw)\n                    })?;\n            }\n            FileMode::SymlinkEach => {\n                if !req.source.is_dir() {","sourceCodeStart":913,"sourceCodeEnd":949,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/oci/builder.rs#L913-L949","documentation":"When building the dotfiles layer, mise checks that each `[dotfiles]` entry's `source` path exists on disk — unless the mode is `content` or `track`, which don't read the source file (content is inline; track applies only on the tracked machine). If a copy/symlink/template/symlink-each entry points at a missing file or directory, the build fails with the target and source path in the message.","triggerScenarios":"A `[dotfiles].\"target\"` entry with mode `copy`, `symlink`, `symlink-each`, or `template` whose `source` path doesn't exist at build time — deleted file, wrong relative path, or a path that only exists on another machine.","commonSituations":"Config written on a machine where the dotfile exists but built in a container/CI where it doesn't; renames in the dotfiles repo; source given relative to the wrong base directory; typo in the path.","solutions":["Fix the `source` path in the `[dotfiles]` entry to point at an existing file/directory.","Use `mode = \"content\"` with inline `content` if the file shouldn't be read from disk.","Use `mode = \"track\"` if this target is only meant to be tracked on the machine, not baked into the image.","Create the missing source file, or remove the entry if it's obsolete."],"exampleFix":"# before\n[dotfiles.\"/root/.gitconfig\"]\nsource = \"~/.gitconfig\"   # missing in build environment\nmode = \"copy\"\n# after\n[dotfiles.\"/root/.gitconfig\"]\nmode = \"content\"\ncontent = \"\"\"\n[user]\\n  email = me@example.com\n\"\"\"","handlingStrategy":"validation","validationCode":"// before building, check every non-content/track dotfile source exists\nfor (const req of requests) {\n  if (!['content', 'track'].includes(req.mode) && !fs.existsSync(req.source)) {\n    throw new Error(`[dotfiles].\"${req.target}\": source does not exist: ${req.source}`);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use absolute or correctly-based paths for `source` values.","Prefer `mode = \"content\"` (inline) for files that may not exist on the build machine.","Keep dotfiles sources inside the repo so they exist wherever the build runs.","Prune stale `[dotfiles]` entries when files are renamed or deleted."],"tags":["dotfiles","config","file-not-found","oci"],"backgroundTag":"file-not-found","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"}