{"record":{"id":"bb529b1b981c8571","repo":"jdx/mise","slug":"tracked-file-target-cannot-declare-source-conte","errorCode":null,"errorMessage":"tracked file {target} cannot declare source, content, manifest, or exclude","messagePattern":"tracked file (.+?) cannot declare source, content, manifest, or exclude","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/files.rs","lineNumber":610,"sourceCode":"                if content.is_some() && (mode.is_some() || exclude.is_some() || manifest.is_some())\n                {\n                    bail!(\n                        \"dotfile {target}: inline content does not support mode, exclude, or manifest\"\n                    );\n                }\n                let mode = match mode.as_deref() {\n                    Some(value) => FileMode::parse(value).ok_or_else(|| {\n                        eyre::eyre!(\"unknown dotfile mode {value:?} for {target}\")\n                    })?,\n                    None => default_mode(),\n                };\n                if mode == FileMode::Track\n                    && (source.is_some()\n                        || content.is_some()\n                        || manifest.is_some()\n                        || exclude.is_some())\n                {\n                    bail!(\n                        \"tracked file {target} cannot declare source, content, manifest, or exclude\"\n                    );\n                }\n                if source.is_some() && content.is_some() {\n                    bail!(\"dotfile {target} cannot declare both source and content\");\n                }\n                if mode != FileMode::Track && source.is_none() && content.is_none() {\n                    implied_source(&resolve_target_arg(&target))?;\n                }\n                if let Some(manifest) = manifest\n                    && (FileManifest::parse(&manifest).is_none()\n                        || !matches!(mode, FileMode::Copy | FileMode::SymlinkEach))\n                {\n                    bail!(\"invalid manifest {manifest:?} for dotfile {target}\");\n                }\n                for pattern in exclude.into_iter().flatten() {\n                    glob::Pattern::new(&pattern)?;\n                }","sourceCodeStart":592,"sourceCodeEnd":628,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/files.rs#L592-L628","documentation":"`mode = \"track\"` marks an already-existing file for tracking in the dotfiles root; it takes no provisioning inputs because the file is not copied, symlinked, or generated from a source. If a tracked entry declares `source`, `content`, `manifest`, or `exclude`, validation fails since those options contradict the track semantics.","triggerScenarios":"Setting `mode = \"track\"` on a `[dotfiles.\"~/...\"]` entry while also specifying any of `source`, `content`, `manifest`, or `exclude`.","commonSituations":"Changing an existing copy/symlink entry to track mode without deleting its `source`/`exclude` keys, or adding `mode = \"track\"` to a templated config snippet that already had `source`.","solutions":["Remove `source`, `content`, `manifest`, and `exclude` from the tracked entry; keep only `mode = \"track\"` (plus allowed keys like `encrypt`/`variants`).","If the file actually needs to be provisioned from a source, drop `mode = \"track\"` and keep `source` with the appropriate mode (copy/symlink).","Use track mode only for files that already exist on the machine and should be adopted into the dotfiles root."],"exampleFix":"// before\n[dotfiles.\"~/.config/foo/bar.conf\"]\nmode = \"track\"\nsource = \"bar.conf\"\n\n// after\n[dotfiles.\"~/.config/foo/bar.conf\"]\nmode = \"track\"","handlingStrategy":"validation","validationCode":"function assertTrackEntry(entry, target) {\n  if (entry.mode === 'track' && ['source','content','manifest','exclude'].some(k => k in entry))\n    throw new Error(`${target}: tracked file cannot declare source/content/manifest/exclude`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  applyDotfiles();\n} catch (e) {\n  if (/tracked file .* cannot declare/.test(e.message)) {\n    console.error('Keep only mode = \"track\" (and encrypt/variants/enabled) on tracked entries');\n  } else throw e;\n}","preventionTips":["Use track mode only when adopting existing files; provisioning options belong to copy/symlink entries","When flipping a mode to track, remove source/content/manifest/exclude in the same edit","Add a config lint that enforces track-mode key restrictions"],"tags":["dotfiles","config-validation","track-mode","mise"],"backgroundTag":"conflicting-config-options","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"}