{"record":{"id":"89b11b939f780e44","repo":"abhigyanpatwari/GitNexus","slug":"committed-overlay-destination-is-unavailable-tar","errorCode":null,"errorMessage":"committed overlay destination is unavailable: {target}","messagePattern":"committed overlay destination is unavailable: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/promotion_apply.py","lineNumber":551,"sourceCode":"    )\n    if not rev.ok or rev.stdout_capture_overflow or rev.stdout_capture is None:\n        raise ValueError(\"could not resolve the committed promotion base\")\n    commit = rev.stdout_capture.decode(\"ascii\", errors=\"strict\").strip()\n    if not commit or any(character not in \"0123456789abcdefABCDEF\" for character in commit):\n        raise ValueError(\"committed promotion base is not an immutable object id\")\n    bindings: dict[str, str] = {}\n    for relative, _content in payload:\n        for target in mirror_targets(relative):\n            key = target.as_posix()\n            if key in bindings:\n                raise ValueError(f\"duplicate overlay destination: {target}\")\n            result = run_managed(\n                [\"git\", \"-C\", str(root), \"show\", f\"{commit}:{key}\"],\n                timeout=60,\n                capture_stdout_bytes=MAX_CANDIDATE_OVERLAY_BYTES + 1,\n            )\n            if not result.ok or result.stdout_capture_overflow or result.stdout_capture is None:\n                raise ValueError(f\"committed overlay destination is unavailable: {target}\")\n            bindings[key] = hashlib.sha256(result.stdout_capture).hexdigest()\n    return bindings\n\n\ndef _write_recovery_artifact(\n    root_descriptor: int,\n    repo_root: Path,\n    *,\n    failure: BaseException,\n    rollback_failures: list[str],\n    replacements: list[dict[str, Any]],\n    transaction_state: str,\n) -> Path:\n    recovery_name = \".wfbench-overlay-recovery-\" + datetime.now(UTC).strftime(\"%Y%m%dT%H%M%S%fZ\") + \".json\"\n\n    def descriptor_path(descriptor: int, fallback: Path) -> Path:\n        try:\n            return Path(os.readlink(f\"/proc/self/fd/{descriptor}\"))","sourceCodeStart":533,"sourceCodeEnd":569,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/promotion_apply.py#L533-L569","documentation":"Thrown in `committed_destination_base_digests` when `git show {commit}:{key}` fails for a target path. The promoter needs the bytes of every committed destination to hash them; if any target is missing from that commit, overflowed the byte cap, or git reported an error, the committed binding cannot be captured.","triggerScenarios":"Calling `committed_destination_base_digests(overlay, ref=<ref>)` where the commit does not contain one of the overlay's target paths (`git show` exits non-zero), the file is larger than `MAX_CANDIDATE_OVERLAY_BYTES`, or `stdout_capture_overflow`/`None` capture made the result unusable.","commonSituations":"Overlay targets a file that was added in a later commit than `<ref>`; the path was renamed/removed before `<ref>`; the target path is in `.gitignore` and was never committed; the file is binary and exceeds the byte cap; the commit SHA resolved correctly but the path key has wrong casing or leading slash.","solutions":["Confirm the file exists at that commit: `git -C <repo> cat-file -e <commit>:<path>` — if it errors, pick a ref where the file exists.","Check path casing and that the key uses no leading slash (`mirror_targets` produces repo-relative paths).","If the file is large, raise `MAX_CANDIDATE_OVERLAY_BYTES` or remove that target from the overlay.","Ensure the overlay was generated against the same commit you are binding (don't add new files to the overlay without committing them first)."],"exampleFix":"# before: overlay references docs/NEW.md not yet committed\nbases = committed_destination_base_digests(overlay)  # -> ValueError\n# after: commit the file, then capture\nimport subprocess\nsubprocess.run(['git', 'add', 'docs/NEW.md'], cwd=repo_root, check=True)\nsubprocess.run(['git', 'commit', '-m', 'add docs/NEW.md'], cwd=repo_root, check=True)\nbases = committed_destination_base_digests(overlay)","handlingStrategy":"validation","validationCode":"import subprocess\nfrom workflow_bench.promotion_apply import candidate_overlay_payload, mirror_targets, MAX_CANDIDATE_OVERLAY_BYTES\n\ndef all_targets_exist_at_commit(repo_root, overlay, ref=\"HEAD\") -> bool:\n    _, payload = candidate_overlay_payload(overlay)\n    targets = [t.as_posix() for rel, _ in payload for t in mirror_targets(rel)]\n    for key in targets:\n        r = subprocess.run(\n            [\"git\", \"-C\", str(repo_root), \"cat-file\", \"-e\", f\"{ref}:{key}\"],\n        )\n        if r.returncode != 0:\n            return False\n    return True","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Commit every target file before capturing committed bases.","Keep target paths repo-relative with no leading slash and correct casing.","If a file is large, raise `MAX_CANDIDATE_OVERLAY_BYTES` or exclude it from the overlay."],"tags":["git","committed-content","validation","input-error"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}