gastownhall/beads · error
get dependencies: fetch issues: %w
Error message
get dependencies: fetch issues: %w
What it means
GetDependenciesWithMetadataInTx wraps any error from GetIssuesByIDsInTx when hydrating the issues that the dependency rows point to. The dependency edges themselves were read fine, but fetching the target issue records by their IDs failed. The original error (scan failure, query error, etc.) is preserved via %w.
Source
Thrown at internal/storage/issueops/dependencies.go:1137
}
_ = rows.Close()
if err := rows.Err(); err != nil {
return nil, fmt.Errorf("get dependencies: rows from %s: %w", depTable, err)
}
}
if len(deps) == 0 {
return nil, nil
}
// Fetch all dependency target issues.
ids := make([]string, len(deps))
for i, d := range deps {
ids[i] = d.depID
}
issues, err := GetIssuesByIDsInTx(ctx, tx, ids, nil)
if err != nil {
return nil, fmt.Errorf("get dependencies: fetch issues: %w", err)
}
issueMap := make(map[string]*types.Issue, len(issues))
for _, iss := range issues {
issueMap[iss.ID] = iss
}
var results []*types.IssueWithDependencyMetadata
for _, d := range deps {
issue, ok := issueMap[d.depID]
if !ok {
continue
}
results = append(results, &types.IssueWithDependencyMetadata{
Issue: *issue,
DependencyType: types.DependencyType(d.depType),
})
}
return results, nilView on GitHub (pinned to 71377f2769)
Solutions
- Inspect the wrapped GetIssuesByIDsInTx error (unwrap the %w chain) to find the real failure.
- Check schema consistency: every ID in dependencies/wisp_dependencies should exist in issues or wisp_issues with compatible column types.
- If the dependency list is very large, verify the IN-clause handling/parameter limits of your driver.
- Retry on a fresh transaction if the wrapped error is transient.
Defensive patterns
Strategy: try-catch
Validate before calling
// Pre-check that dependency targets resolve before hydration-heavy calls
ids, err := collectDependencyIDs(ctx, tx, issueID)
if err != nil { return err }
if len(ids) > 1000 { return fmt.Errorf("dependency fan-out too large: %d", len(ids)) } Type guard
func isFetchIssuesErr(err error) bool {
return err != nil && strings.Contains(err.Error(), "fetch issues")
} Try / catch
deps, err := GetDependenciesWithMetadataInTx(ctx, tx, issueID)
if err != nil {
if strings.Contains(err.Error(), "fetch issues") {
log.Printf("hydration failed: %v", errors.Unwrap(err))
}
return err
} Prevention
- Keep dependency tables and issue tables in schema sync via migrations.
- Watch for orphan dependency rows referencing missing issues.
- Unwrap nested errors to see the real GetIssuesByIDsInTx cause before guessing.
- Cap traversal size to avoid oversized IN clauses.
When it happens
Trigger: GetDependenciesWithMetadataInTx found dependency rows, then GetIssuesByIDsInTx failed on the batched SELECT over the collected depends-on IDs — e.g. query error, scan error, or rows error inside the ID-based fetch.
Common situations: Corrupt or mismatched schema between the dependency table and issues/wisp issues tables; oversized IN clause from a huge dependency list; transient DB failure between the two queries; strict type mismatch when scanning issue rows.
Understand the failure class
Background: "query failed", "%w: SQL error" — wrapped database query errors in Go libraries explained — this error's family across 3 libraries.
Related errors
- get dependents: fetch issues: %w
- failed to begin transaction: %w
- failed to recompute is_blocked: %w
- failed to commit is_blocked repairs: %w
- failed to query orphaned dependencies: %w
AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30).
Data as JSON: /api/errors/1d335949ca31b046.
Report an issue: GitHub.