{"record":{"id":"b653560c029083f9","repo":"gitbutlerapp/gitbutler","slug":"object-for-prefix-exists","errorCode":null,"errorMessage":"object for prefix exists","messagePattern":"object for prefix exists","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-debug/src/command/graph.rs","lineNumber":68,"sourceCode":"        .map(|rev_spec| repo.rev_parse_single(rev_spec))\n        .transpose()?\n        .map(|id| id.detach());\n    let opts = but_graph::init::Options {\n        extra_target_commit_id: extra_target,\n        collect_tags: true,\n        hard_limit: graph_args.hard_limit,\n        commits_limit_hint: graph_args.limit.flatten(),\n        commits_limit_recharge_location: graph_args\n            .limit_extension\n            .iter()\n            .map(|short_hash| {\n                repo.objects\n                    .lookup_prefix(\n                        gix::hash::Prefix::from_hex(short_hash).expect(\"valid hex prefix\"),\n                        None,\n                    )\n                    .unwrap()\n                    .expect(\"object for prefix exists\")\n                    .expect(\"the prefix is unambiguous\")\n            })\n            .collect(),\n        dangerously_skip_postprocessing_for_debugging: graph_args.no_post,\n        worktrees: false,\n    };\n\n    let graph = match graph_args.ref_name.as_deref() {\n        None => but_graph::Graph::from_head(\n            &repo,\n            &meta,\n            but_core::ref_metadata::ProjectMeta::default(),\n            &mut setup::debug_db()?,\n            opts,\n        ),\n        Some(ref_name) => {\n            let mut reference = repo.find_reference(ref_name)?;\n            let id = reference.peel_to_id()?;","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but-debug/src/command/graph.rs#L50-L86","documentation":"A panic (expect) in but-debug's graph command: gix's lookup_prefix() returned Ok(None) for a --limit-extension prefix, meaning no object in the object database starts with that hex prefix. The debug tool assumes passed prefixes exist and aborts otherwise.","triggerScenarios":"Running `but debug graph --limit-extension <hex>` where <hex> is valid hex but matches no object: wrong repository, truncated/garbled hash, or an object that only exists in a different clone.","commonSituations":"Copying a hash from a different repo/PR/fork; a hash from before a shallow-clone boundary; case-sensitive typos that still form valid hex; running the command in the wrong worktree.","solutions":["Confirm the object exists: `git rev-parse <prefix>` in the same repository; use its output as the value.","Run the debug command from the correct repository/worktree.","If the repo is shallow, fetch more history (`git fetch --unshallow` or deepen) so the object is present."],"exampleFix":"# before\nbut debug graph --limit-extension 4c1f0ab  # no such object here\n\n# after\ngit rev-parse --verify 4c1f0ab && but debug graph --limit-extension $(git rev-parse --short 4c1f0ab)","handlingStrategy":"validation","validationCode":"# verify the prefix resolves to an object before the debug run\ngit rev-parse --verify --quiet \"${EXT}^{commit}\" >/dev/null || { echo \"no object for prefix $EXT\" >&2; exit 2; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only pass prefixes you obtained from this repository (rev-parse, log output).","Deepen shallow clones before debugging old history.","Run debug commands from the intended worktree."],"tags":["rust","cli","debug-tooling","panic","object-not-found"],"backgroundTag":"object-not-found","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}