{"record":{"id":"949ac5577e97ce59","repo":"gastownhall/beads","slug":"failed-to-analyze-epic-v","errorCode":null,"errorMessage":"failed to analyze epic: %v","messagePattern":"failed to analyze epic: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/swarm_proxied_server.go","lineNumber":68,"sourceCode":"\t\t}\n\n\t\tepic, err := uw.IssueUseCase().GetIssue(ctx, epicID)\n\t\tif gateProxiedNotFound(err) || (err == nil && epic == nil) {\n\t\t\t// Classic reports a nil epic after a successful resolve this way;\n\t\t\t// keep the message for parity.\n\t\t\treturn nil, fmt.Errorf(\"epic '%s' not found\", epicID)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to get epic: %v\", err)\n\t\t}\n\n\t\tif epic.IssueType != types.TypeEpic && epic.IssueType != \"molecule\" {\n\t\t\treturn nil, fmt.Errorf(\"'%s' is not an epic or molecule (type: %s)\", epicID, epic.IssueType)\n\t\t}\n\n\t\tanalysis, err := analyzeEpicForSwarm(ctx, r, epic)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to analyze epic: %v\", err)\n\t\t}\n\t\treturn analysis, nil\n\t})\n\tif err != nil {\n\t\treturn HandleErrorRespectJSON(\"%v\", err)\n\t}\n\n\tif !verbose {\n\t\tanalysis.Issues = nil\n\t}\n\n\tif jsonOutput {\n\t\tif jerr := outputJSON(analysis); jerr != nil {\n\t\t\treturn jerr\n\t\t}\n\t\tif !analysis.Swarmable {\n\t\t\treturn SilentExit()\n\t\t}","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/swarm_proxied_server.go#L50-L86","documentation":"Error from runSwarmValidateProxiedServer in cmd/bd/swarm_proxied_server.go:68. Wraps any failure returned by analyzeEpicForSwarm — the graph-building pass over the epic's children (dependency reads, cycle/front analysis). Any wrapped storage error inside the analysis bubbles up under this prefix. It is printed via HandleErrorRespectJSON, honoring --json output mode.","triggerScenarios":"`bd swarm validate <epic>` in proxied-server mode when analyzeEpicForSwarm errors — typically a GetDependencyRecords failure on one of the children (see the \"failed to get dependencies for %s\" wrap inside it).","commonSituations":"Storage flakiness mid-analysis; a corrupted dependency row for one child; database lock contention from a concurrent bd process writing during the read transaction.","solutions":["Look at the full error chain to find the real cause (usually a per-child dependency-read failure).","Check the named child issue with `bd show <child-id>` and repair or recreate its dependencies if corrupt.","Re-run when no other bd process is writing to avoid lock contention.","Run `bd doctor`; restore/sync the database if corruption is detected."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"bd doctor || echo \"database unhealthy before swarm validate\"","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"failed to analyze epic\") {\n    // drill into the wrapped cause; usually a per-child dependency read failure\n}","preventionTips":["Run swarm analysis when no other bd process is writing","Keep the database healthy with periodic bd doctor checks","Repair corrupt dependency records as soon as they surface"],"tags":["go","cli","analysis","storage"],"backgroundTag":"analysis-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}