gastownhall/beads · error

hydrate ready row %s: dependency records: %w

Error message

hydrate ready row %s: dependency records: %w

What it means

hydrateReadyRow fetches full dependency records for the claimed issue via DependencyUseCase().GetForIssueIDs and wraps any failure. Like the counts step, an issue whose dependency records cannot be loaded is not returned as a claimable result, so the whole claim fails with this wrapped error.

Source

Thrown at internal/storage/uow/ready_claimer.go:108

		return nil, nil
	}
	return hydrateReadyRow(ctx, uw, claimed.Issue)
}

// hydrateReadyRow fills in the relationship cardinalities a ready row carries,
// reading them in the caller's unit of work so the counts describe the state
// that transaction is about to commit. A failed count read is an error rather
// than a zero, matching the store-backed sibling: a result nobody can hydrate
// is not a result.
func hydrateReadyRow(ctx context.Context, uw UnitOfWork, issue *types.Issue) (*types.IssueWithCounts, error) {
	ids := []string{issue.ID}
	depCounts, err := uw.DependencyUseCase().CountsByIssueIDs(ctx, ids)
	if err != nil {
		return nil, fmt.Errorf("hydrate ready row %s: dependency counts: %w", issue.ID, err)
	}
	records, err := uw.DependencyUseCase().GetForIssueIDs(ctx, ids)
	if err != nil {
		return nil, fmt.Errorf("hydrate ready row %s: dependency records: %w", issue.ID, err)
	}
	commentCounts, err := uw.CommentUseCase().GetCommentCounts(ctx, ids)
	if err != nil {
		return nil, fmt.Errorf("hydrate ready row %s: comment counts: %w", issue.ID, err)
	}

	issue.Dependencies = records[issue.ID]
	counts := depCounts[issue.ID]
	if counts == nil {
		counts = &types.DependencyCounts{}
	}
	var parent *string
	for _, dep := range records[issue.ID] {
		if dep.Type == types.DepParentChild {
			parent = &dep.DependsOnID
			break
		}
	}

View on GitHub (pinned to 71377f2769)

Solutions

  1. Retry the command
  2. Check server logs for the underlying SQL error surfaced by %w
  3. Verify integrity of dependency tables if errors repeat on the same issue
  4. Check network/timeout settings to the database

Example fix

null
Defensive patterns

Strategy: retry

Validate before calling

// Go: pre-verify dependency records load cleanly
_, err := uw.DependencyUseCase().GetForIssueIDs(ctx, []string{issueID})
if err != nil { /* fix data/access before claiming */ }

Type guard

func isDepRecordsHydrationError(err error) bool {
  return err != nil && strings.Contains(err.Error(), "dependency records: ")
}

Try / catch

issue, err := ClaimNextInUOW(ctx)
if isDepRecordsHydrationError(err) {
  // retry transient; if it repeats on the same issue, inspect dependency rows for corruption
  time.Sleep(time.Second); issue, err = ClaimNextInUOW(ctx)
}
return issue, err

Prevention

When it happens

Trigger: ClaimNextInUOW → hydrateReadyRow where GetForIssueIDs(ctx, [issueID]) errors — SQL failure, connection drop, or use-case error while loading dependency rows for the claimed issue.

Common situations: Dolt server hiccup during 'bd ready'; concurrent writers causing contention on dependency tables; malformed dependency rows triggering a scan error; ctx cancellation mid-query.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/c4cee9f1859ba256. Report an issue: GitHub.