gastownhall/beads · error

failed to get swarm dependencies: %v

Error message

failed to get swarm dependencies: %v

What it means

Thrown by the swarm command's epic-resolution path when reading the dependency records of a swarm molecule fails. The wrapper calls r.GetDependencyRecords(ctx, issue.ID); any storage/DB error surfaces wrapped here. It is a passthrough wrapper — the underlying cause is the %v payload.

Source

Thrown at cmd/bd/swarm_proxied_server.go:132

		issueID, err := utils.ResolvePartialID(ctx, r, args[0])
		if err != nil {
			return nil, fmt.Errorf("issue '%s' not found: %v", args[0], err)
		}

		issue, err := uw.IssueUseCase().GetIssue(ctx, issueID)
		if gateProxiedNotFound(err) || (err == nil && issue == nil) {
			return nil, fmt.Errorf("issue '%s' not found", issueID)
		}
		if err != nil {
			return nil, fmt.Errorf("failed to get issue: %v", err)
		}

		var epic *types.Issue

		if issue.IssueType == "molecule" && issue.MolType == types.MolTypeSwarm {
			deps, err := r.GetDependencyRecords(ctx, issue.ID)
			if err != nil {
				return nil, fmt.Errorf("failed to get swarm dependencies: %v", err)
			}
			for _, dep := range deps {
				if dep.Type == types.DepRelatesTo {
					epic, err = uw.IssueUseCase().GetIssue(ctx, dep.DependsOnID)
					if err != nil {
						return nil, fmt.Errorf("failed to get linked epic: %v", err)
					}
					break
				}
			}
			if epic == nil {
				return nil, fmt.Errorf("swarm molecule '%s' has no linked epic", issueID)
			}
		} else if issue.IssueType == types.TypeEpic || issue.IssueType == "molecule" {
			epic = issue
		} else {
			return nil, fmt.Errorf("'%s' is not an epic or swarm molecule (type: %s)", issueID, issue.IssueType)
		}

View on GitHub (pinned to 71377f2769)

Solutions

  1. Inspect the wrapped %v cause in the message and fix the underlying storage error first
  2. Run `bd doctor` to check the local Dolt database health
  3. Re-open the workspace / retry after the DB lock or transient I/O error clears
  4. If the DB is corrupted, restore from .beads/issues.jsonl export or git history
Defensive patterns

Strategy: retry

Validate before calling

// verify the DB is reachable before invoking the swarm command
if err := db.Ping(); err != nil {
    return fmt.Errorf("beads DB unavailable: %w", err)
}

Try / catch

deps, err := getSwarmDeps(ctx, issueID)
if err != nil {
    var transient *StorageUnavailableError
    if errors.As(err, &transient) {
        // retry with backoff
    }
    return err
}

Prevention

When it happens

Trigger: Calling the swarm command against an issue whose IssueType=="molecule" && MolType==MolTypeSwarm while the dependency-row query fails: database unavailable, corrupted beads DB, closed/stale storage handle, or context cancellation mid-query.

Common situations: Running `bd swarm` against a repo where .beads/Dolt DB is locked by another process or partially synced; disk/network failure opening the embedded database; querying a molecule in a workspace where the DB was deleted or corrupted.

Related errors


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