gastownhall/beads · error

loading dependencies: %w

Error message

loading dependencies: %w

What it means

In proxied-server mode, loadGraphSubgraphUOW loads dependency records for all issues in a subgraph via DependencyUseCase().GetIssueDependencyRecords; failure is wrapped with this message. The wrapped error from the use case/storage layer is the real cause.

Source

Thrown at cmd/bd/graph_proxied_server.go:93

			subgraph.IssueMap[iss.ID] = &iss
			queue = append(queue, iss.ID)
		}
	}

	for len(queue) > 0 {
		currentID := queue[0]
		queue = queue[1:]
		addNeighbors(currentID, domain.DepDirectionIn)  // dependents
		addNeighbors(currentID, domain.DepDirectionOut) // dependencies
	}

	ids := make([]string, 0, len(subgraph.Issues))
	for _, iss := range subgraph.Issues {
		ids = append(ids, iss.ID)
	}
	recs, err := uw.DependencyUseCase().GetIssueDependencyRecords(ctx, ids)
	if err != nil {
		return nil, fmt.Errorf("loading dependencies: %w", err)
	}
	for _, iss := range subgraph.Issues {
		for _, dep := range recs[iss.ID] {
			if _, ok := subgraph.IssueMap[dep.DependsOnID]; ok {
				subgraph.Dependencies = append(subgraph.Dependencies, dep)
			}
		}
	}

	return subgraph, nil
}

func loadAllGraphSubgraphsUOW(ctx context.Context, uw uow.UnitOfWork) ([]*TemplateSubgraph, error) {
	var allIssues []*types.Issue
	for _, status := range []types.Status{types.StatusOpen, types.StatusInProgress, types.StatusBlocked} {
		statusCopy := status
		page, err := uw.IssueUseCase().SearchIssues(ctx, "", types.IssueFilter{Status: &statusCopy})
		if err != nil {

View on GitHub (pinned to 71377f2769)

Solutions

  1. Inspect the wrapped cause and fix the underlying storage/use-case error
  2. Retry the graph request
  3. Verify the issues in the requested subgraph still exist and are accessible from the server
Defensive patterns

Strategy: retry

Try / catch

resp, err := client.FetchGraph(ctx, rootID)
if err != nil && strings.Contains(err.Error(), "loading dependencies") {
  time.Sleep(backoff)
  resp, err = client.FetchGraph(ctx, rootID) // transient storage failure retry
}

Prevention

When it happens

Trigger: bd serve (proxied graph server) handling a graph request where the batch dependency-record fetch for the subgraph issue IDs fails.

Common situations: Backend storage unreachable from the server; one of the subgraph issue IDs was deleted concurrently; permission/routing errors in proxied mode.

Related errors


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