{"record":{"id":"d7d5727f2fcfdd7a","repo":"astrid-runtime/astrid","slug":"git-could-not-read-captured-version","errorCode":null,"errorMessage":"git could not read captured version: {}","messagePattern":"git could not read captured version: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-storage-chunker-evidence/src/corpus.rs","lineNumber":114,"sourceCode":"        }\n        let revisions = String::from_utf8(revisions.stdout).context(\"git emitted non-UTF-8 IDs\")?;\n        let mut inputs = Vec::new();\n        for revision in revisions.lines() {\n            if revision.is_empty() || !revision.bytes().all(|byte| byte.is_ascii_hexdigit()) {\n                bail!(\"git emitted an invalid revision ID\");\n            }\n            if !git_path_exists_at_revision(repository, relative_path, revision)? {\n                continue;\n            }\n            let object = format!(\"{revision}:{}\", relative_path.to_string_lossy());\n            let version = Command::new(\"git\")\n                .args([\"-C\"])\n                .arg(repository)\n                .args([\"show\", &object])\n                .output()\n                .context(\"read captured version\")?;\n            if !version.status.success() {\n                bail!(\n                    \"git could not read captured version: {}\",\n                    String::from_utf8_lossy(&version.stderr).trim()\n                );\n            }\n            inputs.push(memory(version.stdout));\n        }\n        if inputs.len() < 2 {\n            bail!(\"captured version chain must contain at least two readable versions\");\n        }\n        Self::from_files(name, CorpusKind::VersionChain, inputs)\n    }\n\n    pub fn synthetic_adversarial() -> Self {\n        let mebibyte = 1024 * 1024;\n        let inputs = vec![\n            memory(Vec::new()),\n            memory(vec![0x5a]),\n            memory(vec![0x7e; 4093]),","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-storage-chunker-evidence/src/corpus.rs#L96-L132","documentation":"For each valid revision, `version_chain_from_git` reads the file content with `git show <revision>:<path>`. If that subprocess fails, the error includes git's trimmed stderr, so this message reports why git could not read the captured version.","triggerScenarios":"`git show <rev>:<path>` returns non-zero — e.g. the path does not exist at that revision (though existence is pre-checked, races are possible), object corruption, or a shallow/partial clone lacking the blob.","commonSituations":"Partial/shallow clones where blobs were not fetched; corrupted or pruned objects; the file removed between the existence check and the show (TOCTOU in a live repo); permission issues running git in the repo.","solutions":["Read the included stderr in the error message — run the same `git show` command to reproduce.","Fetch missing objects if in a partial/shallow clone (`git fetch --unshallow` or `--filter=blob:none` removal).","Run `git fsck` to detect repository/object corruption.","Ensure the repository is not mutated concurrently while the chain is being read."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Ensure the blob is locally available before reading\nlet out = Command::new(\"git\").arg(\"-C\").arg(&repo).args([\"cat-file\", \"-e\", &object]).output()?;\nassert!(out.status.success(), \"object {object} not present locally\");","typeGuard":null,"tryCatchPattern":"match version_chain_from_git(&repo, &path, name) {\n    Err(e) if e.to_string().contains(\"could not read captured version\") => {\n        // parse stderr from the error; fetch missing objects, then retry once\n    }\n    other => other,\n}","preventionTips":["Fully fetch blobs in clones used for corpus generation (avoid partial clones)","Run git fsck to catch corrupted objects before benchmarking","Freeze the repository (no concurrent rewrites) while reading versions"],"tags":["git","subprocess","blob-read"],"backgroundTag":"git-command-failed","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}