gastownhall/beads · error
get dependency counts: dependent rows: %w
Error message
get dependency counts: dependent rows: %w
What it means
Returned by GetDependencyCountsInTx after finishing iteration of the 'dependents counts' result set when rows.Err() reports a driver-level failure during iteration (connection loss, cancellation, server error). Equivalent to the blocker-rows variant but on the inbound (dependents) query.
Source
Thrown at internal/storage/issueops/dependency_queries.go:518
if optionalBlockedTable(depTable) && isTableNotExistError(err) {
continue
}
return nil, fmt.Errorf("get dependency counts (dependents from %s): %w", depTable, err)
}
for blockingRows.Next() {
var id string
var cnt int
if err := blockingRows.Scan(&id, &cnt); err != nil {
_ = blockingRows.Close()
return nil, fmt.Errorf("get dependency counts: scan dependent: %w", err)
}
if c, ok := result[id]; ok {
c.DependentCount += cnt
}
}
_ = blockingRows.Close()
if err := blockingRows.Err(); err != nil {
return nil, fmt.Errorf("get dependency counts: dependent rows: %w", err)
}
}
}
return result, nil
}
// GetBlockingInfoForIssuesInTx returns blocking dependency records for a set of issue IDs.
// Returns three maps:
// - blockedByMap: issueID -> list of IDs blocking it
// - blocksMap: issueID -> list of IDs it blocks
// - parentMap: childID -> parentID (parent-child deps)
func GetBlockingInfoForIssuesInTx(ctx context.Context, tx DBTX, issueIDs []string) (
blockedByMap map[string][]string,
blocksMap map[string][]string,
parentMap map[string]string,
err error,
) {View on GitHub (pinned to 71377f2769)
Solutions
- Check the wrapped error: context cancellation means raise the timeout or reduce per-call work.
- Retry the call — iteration errors from transient network issues usually clear on re-run.
- Verify connectivity to the remote Dolt server (ping, server logs) and restart if it crashed.
- Split large ID lists into smaller calls to shorten each streamed result.
- If behind a proxy/LB, raise its idle timeout for long-running queries.
Example fix
// before: one giant call over a flaky link
result, err := GetDependencyCountsInTx(ctx, tx, thousandsOfIDs)
// after: bounded timeout + retry per chunk
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
for _, chunk := range chunkIDs(thousandsOfIDs, 100) {
if _, err := GetDependencyCountsInTx(ctx, tx, chunk); err != nil {
if !isTransient(err) { return err }
time.Sleep(backoff) // then retry chunk
}
} Defensive patterns
Strategy: retry
Validate before calling
// Go: check context and connectivity before the call
if ctx.Err() != nil {
return ctx.Err()
}
if err := tx.PingContext(ctx); err != nil {
return fmt.Errorf("database unreachable: %w", err)
} Type guard
func isDependentRowsError(err error) bool {
return err != nil && strings.Contains(err.Error(), "dependent rows")
} Try / catch
counts, err := GetDependencyCountsInTx(ctx, tx, ids)
if isDependentRowsError(err) && isRetryable(err) {
time.Sleep(exponentialBackoff(attempt))
counts, err = GetDependencyCountsInTx(ctx, tx, ids)
} Prevention
- Set generous context timeouts for remote Dolt operations.
- Split very large ID sets into smaller calls.
- Use connection pools with health checks (ConnMaxLifetime, idle pings).
- Watch for proxy/LB idle timeouts and raise them for DB traffic.
- Alert on remote server restarts to correlate with iteration errors.
When it happens
Trigger: Calling GetDependencyCountsInTx when the database connection drops or the context is cancelled while streaming dependents counts from dependencies/wisp_dependencies, or the remote Dolt server fails mid-response.
Common situations: Network interruptions to remote backends; context deadlines on slow queries; Dolt server restarts; TLS/proxy idle timeouts cutting off long result streams.
Related errors
- get dependency records: rows: %w
- get dependency counts: blocker rows: %w
- get blocking info: blocked-by rows: %w
- server not reachable: %w
- row iteration error: %w
AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30).
Data as JSON: /api/errors/f06d17ed94fa67d9.
Report an issue: GitHub.