{"record":{"id":"2f2723cb572e1b3b","repo":"gastownhall/beads","slug":"loading-subgraph-for-s-w","errorCode":null,"errorMessage":"loading subgraph for %s: %w","messagePattern":"loading subgraph for (.+?): %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/mol_proxied_server.go","lineNumber":641,"sourceCode":"\t\t\t\treturn nil, \"\", err\n\t\t\t}\n\t\t\treturn r, fmt.Sprintf(\"bd: mol burn %d wisp(s)\", len(wispIDs)), nil\n\t\t})\n\t\tif err != nil {\n\t\t\tif !jsonOutput {\n\t\t\t\tfmt.Fprintf(os.Stderr, \"Error burning wisps: %v\\n\", err)\n\t\t\t}\n\t\t} else {\n\t\t\tbatchResult.TotalDeleted += result.DeletedCount\n\t\t\tbatchResult.Results = append(batchResult.Results, *result)\n\t\t}\n\t}\n\n\tfor _, id := range persistentIDs {\n\t\tresult, err := uow.RunTxResult(ctx, uowProvider, func(ctx context.Context, uw uow.UnitOfWork) (BurnResult, string, error) {\n\t\t\tsubgraph, err := loadTemplateSubgraph(ctx, newUOWMolWriter(uw), id)\n\t\t\tif err != nil {\n\t\t\t\treturn BurnResult{}, \"\", fmt.Errorf(\"loading subgraph for %s: %w\", id, err)\n\t\t\t}\n\t\t\tissueIDs := make([]string, len(subgraph.Issues))\n\t\t\tfor i, issue := range subgraph.Issues {\n\t\t\t\tissueIDs[i] = issue.ID\n\t\t\t}\n\t\t\tres, err := uw.IssueUseCase().DeleteIssues(ctx, domain.DeleteIssuesParams{\n\t\t\t\tIDs:                  issueIDs,\n\t\t\t\tCascade:              true,\n\t\t\t\tUpdateTextReferences: true,\n\t\t\t}, actor)\n\t\t\tif err != nil {\n\t\t\t\treturn BurnResult{}, \"\", fmt.Errorf(\"burning %s: %w\", id, err)\n\t\t\t}\n\t\t\treturn BurnResult{\n\t\t\t\tMoleculeID:   id,\n\t\t\t\tDeletedIDs:   issueIDs,\n\t\t\t\tDeletedCount: res.DeletedCount,\n\t\t\t}, fmt.Sprintf(\"bd: mol burn %s\", id), nil","sourceCodeStart":623,"sourceCodeEnd":659,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/mol_proxied_server.go#L623-L659","documentation":"Wrapped error from loadTemplateSubgraph when loading a molecule's subgraph before deleting all of its issues during `bd mol burn`. Each persistent molecule ID is burned in its own transaction; this error aborts the transaction for the specific ID named in the message, before any DeleteIssues call is made.","triggerScenarios":"Run `bd mol burn <id>` where the ID resolves to a persistent molecule but loadTemplateSubgraph fails: storage read error, dangling dependency edges to missing issues, or driver failure inside the transaction.","commonSituations":"Corrupt or partially synced Dolt database; molecule children deleted out-of-band leaving broken edges; concurrent process modifying the molecule during burn; transient storage outage.","solutions":["Read the wrapped inner error to identify the missing/broken piece","Run `bd doctor` to detect and repair dependency integrity problems","Run `bd dolt pull` if the molecule's children were created on another machine","Retry the burn for the specific failed ID after repair; other molecules already burned are unaffected"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Pre-flight: load the molecule subgraph read-only before burning\nbd mol show <id>   // fails here too if the subgraph is unreadable\nbd doctor          // repair dangling edges first","typeGuard":null,"tryCatchPattern":"if err := runMolBurnProxiedServer(ctx, ids); err != nil {\n    if strings.Contains(err.Error(), \"loading subgraph for\") {\n        log.Printf(\"burn skipped for a broken molecule; run bd doctor then retry that ID\")\n    }\n}","preventionTips":["Dry-check with `bd mol show` before `bd mol burn` — burn is destructive","Keep the DB synced and doctor-clean before bulk burns","Burn one molecule per invocation so one bad ID does not obscure others"],"tags":["go","burn","subgraph","storage","delete"],"backgroundTag":"subgraph-load-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}