{"record":{"id":"65aed660df52d201","repo":"GitoxideLabs/gitoxide","slug":"at-least-one-object-couldn-t-be-looked-up-even-tho","errorCode":null,"errorMessage":"At least one object couldn't be looked up even though it must exist","messagePattern":"At least one object couldn't be looked up even though it must exist","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"gitoxide-core/src/repository/odb.rs","lineNumber":254,"sourceCode":"            {\n                let objects = repo.objects.clone();\n                move |_| (objects.clone().into_inner(), counter, false)\n            },\n            |id, (odb, counter, has_error), _threads_left, _stop_everything| -> anyhow::Result<()> {\n                counter.fetch_add(1, Ordering::Relaxed);\n                if let Err(_err) = odb.header(id) {\n                    *has_error = true;\n                    gix::trace::error!(err = ?_err, \"Object that is known to be present wasn't found\");\n                }\n                Ok(())\n            },\n            || Some(std::time::Duration::from_millis(100)),\n            |(_, _, has_error)| has_error,\n        )?;\n\n        progress.show_throughput(start);\n        if errors.contains(&true) {\n            bail!(\"At least one object couldn't be looked up even though it must exist\");\n        }\n    }\n\n    #[cfg(feature = \"serde\")]\n    {\n        serde_json::to_writer_pretty(out, &stats)?;\n    }\n\n    Ok(())\n}\n\npub fn entries(repo: gix::Repository, format: OutputFormat, mut out: impl io::Write) -> anyhow::Result<()> {\n    if format != OutputFormat::Human {\n        bail!(\"Only human output format is supported at the moment\");\n    }\n\n    for object in repo.objects.iter()? {\n        let object = object?;","sourceCodeStart":236,"sourceCodeEnd":272,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gitoxide-core/src/repository/odb.rs#L236-L272","documentation":"During threaded or single-threaded object lookups the command tracks per-object errors; after processing it checks whether any lookup reported an error and fails the whole run, because every supplied object id was expected to already exist in the object database.","triggerScenarios":"`statistics()` finishes iterating `object_ids` and `errors.contains(&true)` — at least one id (from pack index or explicit input) could not be looked up, e.g. due to a missing/corrupt pack or interruption mid-run.","commonSituations":"Verifying a pack file whose companion pack/idx is missing or truncated; corrupted object store; interrupted downloads leaving partial packs; cancellation during the run.","solutions":["Run `gix repo odb` integrity/verify to find which objects fail, then repair or re-fetch the affected pack.","Check the progress/stderr output for the specific failing object id and whether the corresponding pack data file exists.","Re-download or re-pack the repository (`git gc` / fresh clone) if the store is corrupt."],"exampleFix":"// caller-side handling\nmatch gix_repo_odb_statistics(&ids) {\n    Err(e) if e.to_string().contains(\"couldn't be looked up\") => {\n        verify_and_repair_odb()?; // locate missing pack objects, re-clone if needed\n    }\n    r => r?,\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match odb_statistics(ids) {\n    Err(e) if e.to_string().contains(\"couldn't be looked up\") => {\n        run_integrity_check_and_repair()?;\n    }\n    r => r?,\n}","preventionTips":["Verify pack completeness (pack data + idx present) before lookup-heavy operations.","Handle interruption signals gracefully so partial runs are resumable.","Periodically run ODB integrity checks on long-lived stores."],"tags":["odb","object-database","corruption","git","gitoxide"],"backgroundTag":"resource-not-found","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}