{"record":{"id":"8551d9289c86f915","repo":"gastownhall/beads","slug":"failed-to-get-dependencies-for-s-w","errorCode":null,"errorMessage":"failed to get dependencies for %s: %w","messagePattern":"failed to get dependencies for (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/swarm.go","lineNumber":271,"sourceCode":"\t\t\tWave:         -1, // Will be set later\n\t\t}\n\t\tanalysis.Issues[issue.ID] = node\n\n\t\tif issue.Status == types.StatusClosed {\n\t\t\tanalysis.ClosedIssues++\n\t\t}\n\t}\n\n\t// Build dependency relationships (only within the epic's children)\n\tchildIDSet := make(map[string]bool)\n\tfor _, issue := range childIssues {\n\t\tchildIDSet[issue.ID] = true\n\t}\n\n\tfor _, issue := range childIssues {\n\t\tdeps, err := s.GetDependencyRecords(ctx, issue.ID)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to get dependencies for %s: %w\", issue.ID, err)\n\t\t}\n\n\t\tnode := analysis.Issues[issue.ID]\n\t\tfor _, dep := range deps {\n\t\t\t// Only consider dependencies within the epic (not parent-child to epic itself)\n\t\t\tif dep.DependsOnID == epic.ID && dep.Type == types.DepParentChild {\n\t\t\t\tcontinue // Skip the parent relationship to the epic\n\t\t\t}\n\t\t\t// Only track blocking dependencies\n\t\t\tif !dep.Type.AffectsReadyWork() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// Only track dependencies within the epic's children\n\t\t\tif childIDSet[dep.DependsOnID] {\n\t\t\t\tnode.DependsOn = append(node.DependsOn, dep.DependsOnID)\n\t\t\t\tif targetNode, ok := analysis.Issues[dep.DependsOnID]; ok {\n\t\t\t\t\ttargetNode.DependedOnBy = append(targetNode.DependedOnBy, issue.ID)\n\t\t\t\t}","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/swarm.go#L253-L289","documentation":"Wrapped error from analyzeEpicForSwarm in cmd/bd/swarm.go:271. While building the dependency graph for each child of an epic, GetDependencyRecords(ctx, issue.ID) failed, so the analysis cannot proceed and returns the child ID plus the wrapped cause. Unlike getEpicChildren (which silently skips unreadable children at line 122), this path is fatal.","triggerScenarios":"`bd swarm validate <epic>` when the dependency-records query for one of the epic's child issues errors — storage failure, transaction rollback, or driver error while reading the issues dependency table.","commonSituations":"Mid-command DB disconnection; a child issue row referencing a missing/locked dependency record after a failed sync; schema/version mismatch between the bd binary and an older .beads database.","solutions":["Read the wrapped cause to identify the failing child issue (<issue-id> is embedded in the message) and check its records with `bd show <issue-id>`.","Run `bd doctor` to validate the database; repair or restore if corruption is reported.","Re-sync (`bd dolt pull`) if the database is stale relative to the remote.","Upgrade bd if a schema migration is pending — an old binary against a newer DB can fail these reads."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"bd doctor || echo \"database unhealthy\"","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"failed to get dependencies for\") {\n    // parse the child ID from the message and inspect it with bd show\n}","preventionTips":["Keep the database schema in sync with the bd binary version","Run bd dolt pull regularly so dependency rows are complete","Investigate any bd command that exits mid-write before running swarm analysis"],"tags":["go","storage","dependencies","cli"],"backgroundTag":"storage-query-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}