GitoxideLabs/gitoxide · info
name retrieval configured
Error message
name retrieval configured
What it means
Same `OverlayIter::next` merge logic for packed entries: `expect("name retrieval configured")` fires when a packed entry that was peeked as `Some` cannot be retrieved by `next()`. In this arm it runs when a loose entry exists alongside a peeked packed entry and the packed name sorts greater. Peek/next disagreement on the packed iterator is the only cause.
Solutions
- Retry the iteration after external ref mutations settle
- Prevent concurrent pack/gc operations during reads (or use file locking)
- Verify `packed-refs` is well-formed (`git pack-refs --all` regenerates it)
- If it persists, file a gix-ref bug with the repository state
Defensive patterns
Strategy: retry
Try / catch
// Retry loop around collection with a fresh iterator per attempt
for attempt in 0..3 { match catch_unwind(|| fresh_iter().collect::<Vec<_>>()) { Ok(v) => return v, Err(_) => continue } } Prevention
- Treat packed-refs as immutable during a read pass
- Serialize readers/writers with repository-level locking
- Avoid mixing loose-ref updates and packed-refs rewrites concurrently
- Escalate reproducible cases to gix-ref maintainers
When it happens
Trigger: Mixed loose+packed iteration where the peeked packed reference cannot be consumed — concurrent `packed-refs` modification or an iterator implementation bug.
Common situations: Essentially unreachable for single-threaded use on a static repository; seen only with concurrent ref database mutation or library bugs.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- peeked value exists
- caller knows there is a common iter
- prior peek
- this one only happens on iteration creation
- BUG: packed refs cannot contain symbolic refs, catch that…
AI-assisted analysis of GitoxideLabs/gitoxide@e73179060b (2026-09-08).
Data as JSON: /api/errors/f78a4330c1561647.
Report an issue: GitHub.
Appendix: source
Thrown at gix-ref/src/store/file/overlay_iter.rs:179
let res = packed_iter.next().expect("peeked value exists");
Some(self.convert_packed(res))
}
(Some((_, kind)), None) | (Some((Err(_), kind)), Some(_)) => {
let res = self.loose_iter(kind).next().expect("prior peek");
Some(self.convert_loose(res))
}
(Some((Ok((_, loose_name)), kind)), Some(Ok(packed))) => match loose_name.as_ref().cmp(packed.name) {
Ordering::Less => {
let res = self.loose_iter(kind).next().expect("prior peek");
Some(self.convert_loose(res))
}
Ordering::Equal => {
drop(packed_iter.next());
let res = self.loose_iter(kind).next().expect("prior peek");
Some(self.convert_loose(res))
}
Ordering::Greater => {
let res = packed_iter.next().expect("name retrieval configured");
Some(self.convert_packed(res))
}
},
},
None => match peek_loose(&mut self.iter_git_dir, self.iter_common_dir.as_mut()) {
None => None,
Some((_, kind)) => self.loose_iter(kind).next().map(|res| self.convert_loose(res)),
},
}
}
}
impl<'repo> Platform<'repo> {
/// Return an iterator over all references, loose or packed, sorted by their name.
///
/// Errors are returned similarly to what would happen when loose and packed refs were iterated by themselves.
pub fn all<'p>(&'p self) -> std::io::Result<LooseThenPacked<'p, 'repo>> {
self.store.iter_packed(self.packed.as_ref().map(|b| &***b))View on GitHub (pinned to e73179060b)