{"record":{"id":"4396fca26c1dc249","repo":"jdx/mise","slug":"incoming-setup-is-missing-required-source","errorCode":null,"errorMessage":"incoming setup is missing required source {}","messagePattern":"incoming setup is missing required source (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/sync/preflight.rs","lineNumber":154,"sourceCode":"        let planned = plans\n            .iter()\n            .find(|plan| roots.locate(&plan.branch_path).path() == Some(source.as_path()));\n        match planned.and_then(|plan| plan.apply.as_ref()) {\n            Some(Some((mode, oid))) => {\n                if mode != \"100644\" && mode != \"100755\" {\n                    bail!(\n                        \"required source is not a regular file: {}\",\n                        source.display()\n                    );\n                }\n                repo.cat_object(oid)?;\n            }\n            Some(None) => bail!(\n                \"incoming setup deletes required source {}\",\n                source.display()\n            ),\n            None if !source.exists() && !has_incoming_child(&roots, source, plans) => {\n                bail!(\n                    \"incoming setup is missing required source {}\",\n                    source.display()\n                );\n            }\n            None => {}\n        }\n    }\n    Ok(())\n}\n\nfn has_incoming_child(roots: &Roots, path: &Path, plans: &[PathPlan]) -> bool {\n    plans.iter().any(|plan| {\n        plan.apply.as_ref().is_some_and(Option::is_some)\n            && roots\n                .locate(&plan.branch_path)\n                .path()\n                .is_some_and(|p| p.starts_with(path))\n    })","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/history/sync/preflight.rs#L136-L172","documentation":"Thrown in sources() when a required source file neither has an incoming plan nor exists on disk, and no incoming child file will create it. mise cannot satisfy a declared dependency whose source is simply absent everywhere.","triggerScenarios":"A required source path is not in the incoming plans (None), does not exist on the local filesystem, and has_incoming_child finds no incoming entry that would populate it.","commonSituations":"A newly added requirement references a file the setup author forgot to commit; a typo in a source path; pulling only part of the shared setup.","solutions":["Commit the missing source file to the shared setup and re-pull","Fix the typo/wrong path in the declaration listing the requirement","If the file is meant to be generated locally, create it or remove it from required sources"],"exampleFix":"# before\n[[files]]\npath = \"config/tool.toml\"\nrequired_sources = [\"templates/tool-template.toml\"]  # never committed\n# after\ngit add templates/tool-template.toml && git commit -m 'add missing template'","handlingStrategy":"validation","validationCode":"for src in \"${required_sources[@]}\"; do\n  [[ -e \"$src\" ]] || git cat-file -e \"incoming:$src\" 2>/dev/null || echo \"missing required source: $src\"\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add files listed as required sources before pushing the setup change","Use exact paths (no typos) in required_sources declarations","Test a fresh pull of the shared setup into a clean checkout"],"tags":["history-sync","preflight","file-not-found"],"backgroundTag":"file-not-found","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}