gastownhall/beads · error
iter dep metadata: %w
Error message
iter dep metadata: %w
What it means
Wraps a repository failure from depRepo.IterWithIssueMetadata after the empty-ID guard passes. Opening the streaming iterator over dependency metadata failed at the storage layer.
Source
Thrown at internal/storage/domain/dependency.go:542
UseWispsTable: useWisp,
})
if err != nil {
return nil, fmt.Errorf("list dep metadata: %w", err)
}
return out, nil
}
func (u *dependencyUseCaseImpl) iterWithMetadata(ctx context.Context, sourceID string, filter DepListFilter, useWisp bool) (storage.Iter[types.IssueWithDependencyMetadata], error) {
if sourceID == "" {
return nil, fmt.Errorf("iter dep metadata: sourceID must not be empty")
}
it, err := u.depRepo.IterWithIssueMetadata(ctx, sourceID, DepListOpts{
Types: filter.Types,
Direction: filter.Direction,
UseWispsTable: useWisp,
})
if err != nil {
return nil, fmt.Errorf("iter dep metadata: %w", err)
}
return it, nil
}
func (u *dependencyUseCaseImpl) countByID(ctx context.Context, sourceID string, filter DepListFilter, useWisp bool) (int64, error) {
if sourceID == "" {
return 0, fmt.Errorf("count by id: sourceID must not be empty")
}
n, err := u.depRepo.CountByID(ctx, sourceID, DepListOpts{
Types: filter.Types,
Direction: filter.Direction,
UseWispsTable: useWisp,
})
if err != nil {
return 0, fmt.Errorf("count by id: %w", err)
}
return n, nil
}View on GitHub (pinned to 71377f2769)
Solutions
- Check the wrapped cause to distinguish connection vs query errors
- Retry; iterator creation is read-only and safe to repeat
- Verify migrations and wisps table presence for the wisp variant
- Bound the context deadline appropriately for large result sets
Defensive patterns
Strategy: try-catch
Validate before calling
if sourceID == "" {
return fmt.Errorf("sourceID required")
} Try / catch
it, err := u.IterWithIssueMetadata(ctx, sourceID, filter)
if err != nil {
// read-only: safe to retry after transient DB errors
if isTransient(errors.Unwrap(err)) {
time.Sleep(backoff); it, err = u.IterWithIssueMetadata(ctx, sourceID, filter)
}
} Prevention
- Retry transient causes; iterator creation is side-effect free
- Verify wisp table exists for the wisp variant
- Watch connection pool exhaustion under concurrent iteration
- Keep schema migrations current
When it happens
Trigger: Calling IterWithIssueMetadata or IterWispWithIssueMetadata with a valid sourceID where IterWithIssueMetadata on depRepo returns an error.
Common situations: DB connection pool exhausted; query timeout on large graphs; schema drift after upgrade; wisp-table variant against a deployment lacking the table.
Related errors
- reparent: remove old parent %s: %w
- reparent: add new parent %s: %w
- GetForIssueIDs: %w
- GetForIssueIDs (wisps): %w
- list dep metadata: %w
AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30).
Data as JSON: /api/errors/bd993bc091ec759b.
Report an issue: GitHub.