{"record":{"id":"e388023d30c3e2fd","repo":"gastownhall/beads","slug":"failed-to-get-swarm-dependencies-v","errorCode":null,"errorMessage":"failed to get swarm dependencies: %v","messagePattern":"failed to get swarm dependencies: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/swarm_proxied_server.go","lineNumber":132,"sourceCode":"\t\tissueID, err := utils.ResolvePartialID(ctx, r, args[0])\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"issue '%s' not found: %v\", args[0], err)\n\t\t}\n\n\t\tissue, err := uw.IssueUseCase().GetIssue(ctx, issueID)\n\t\tif gateProxiedNotFound(err) || (err == nil && issue == nil) {\n\t\t\treturn nil, fmt.Errorf(\"issue '%s' not found\", issueID)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to get issue: %v\", err)\n\t\t}\n\n\t\tvar epic *types.Issue\n\n\t\tif issue.IssueType == \"molecule\" && issue.MolType == types.MolTypeSwarm {\n\t\t\tdeps, err := r.GetDependencyRecords(ctx, issue.ID)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to get swarm dependencies: %v\", err)\n\t\t\t}\n\t\t\tfor _, dep := range deps {\n\t\t\t\tif dep.Type == types.DepRelatesTo {\n\t\t\t\t\tepic, err = uw.IssueUseCase().GetIssue(ctx, dep.DependsOnID)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, fmt.Errorf(\"failed to get linked epic: %v\", err)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif epic == nil {\n\t\t\t\treturn nil, fmt.Errorf(\"swarm molecule '%s' has no linked epic\", issueID)\n\t\t\t}\n\t\t} else if issue.IssueType == types.TypeEpic || issue.IssueType == \"molecule\" {\n\t\t\tepic = issue\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"'%s' is not an epic or swarm molecule (type: %s)\", issueID, issue.IssueType)\n\t\t}","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/swarm_proxied_server.go#L114-L150","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the wrapped %v cause in the message and fix the underlying storage error first","Run `bd doctor` to check the local Dolt database health","Re-open the workspace / retry after the DB lock or transient I/O error clears","If the DB is corrupted, restore from .beads/issues.jsonl export or git history"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// verify the DB is reachable before invoking the swarm command\nif err := db.Ping(); err != nil {\n    return fmt.Errorf(\"beads DB unavailable: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"deps, err := getSwarmDeps(ctx, issueID)\nif err != nil {\n    var transient *StorageUnavailableError\n    if errors.As(err, &transient) {\n        // retry with backoff\n    }\n    return err\n}","preventionTips":["Run `bd doctor` before long swarm sessions","Avoid deleting or locking .beads/ while bd runs","Keep bd and Dolt versions aligned"],"tags":["go","swarm","storage"],"backgroundTag":"dependency-query-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}