gastownhall/beads · error

loading deps for %s: %w

Error message

loading deps for %s: %w

What it means

buildLinearParentLinks loads each issue's dependencies (with metadata) from the store via GetDependenciesWithMetadata to derive parent-child links for reconciliation. If the store query fails, the error is wrapped as 'loading deps for <issue-id>'.

Source

Thrown at cmd/bd/linear.go:1401

		if ident == "" {
			continue
		}
		idToIdent[issue.ID] = ident
	}
	if len(idToIdent) == 0 {
		return nil, nil
	}
	// Second pass: walk each child-bead's dependencies, find the
	// parent-child edge, and emit a link if both ends are Linear-synced.
	links := make([]linear.ParentLink, 0)
	for _, issue := range issues {
		childIdent, ok := idToIdent[issue.ID]
		if !ok {
			continue
		}
		deps, err := store.GetDependenciesWithMetadata(ctx, issue.ID)
		if err != nil {
			return nil, fmt.Errorf("loading deps for %s: %w", issue.ID, err)
		}
		for _, d := range deps {
			if d == nil || d.DependencyType != types.DepParentChild {
				continue
			}
			// child depends-on parent — the dep target's embedded Issue is the parent.
			parentIdent, ok := idToIdent[d.Issue.ID]
			if !ok {
				continue
			}
			links = append(links, linear.ParentLink{
				ChildIdentifier:  childIdent,
				ParentIdentifier: parentIdent,
			})
		}
	}
	return links, nil
}

View on GitHub (pinned to 71377f2769)

Solutions

  1. Retry the linear sync after confirming the store is healthy (`bd doctor`)
  2. Restart the bd daemon / reconnect the store, then re-run
  3. Check Dolt database integrity and restore from backup if the deps data is corrupted

Example fix

// before
$ bd linear sync
Error: loading deps for bd-abc123: connection refused
// after
$ bd doctor && bd daemon restart
$ bd linear sync
Defensive patterns

Strategy: retry

Validate before calling

if err := exec.Command("bd", "doctor").Run(); err != nil {
	return fmt.Errorf("store unhealthy; fix before linear sync")
}

Try / catch

err := runLinearSync(ctx)
if err != nil && strings.Contains(err.Error(), "loading deps for") {
	time.Sleep(2 * time.Second)
	err = runLinearSync(ctx) // retry once after store recovers
}

Prevention

When it happens

Trigger: Reconciling Linear parents (bd linear sync/push) when the underlying store query for an issue's dependencies fails — DB connection loss, corrupted Dolt data, or store closed mid-operation.

Common situations: Dolt database locked or unavailable during long sync; daemon restarted mid-run; disk/IO errors; interrupted migration leaving the deps table unreadable.

Related errors


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