{"record":{"id":"5a3362795b61ca58","repo":"gastownhall/beads","slug":"burning-s-w","errorCode":null,"errorMessage":"burning %s: %w","messagePattern":"burning (.+?): %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/mol_proxied_server.go","lineNumber":653,"sourceCode":"\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\n\t\t})\n\t\tif err != nil {\n\t\t\tif !jsonOutput {\n\t\t\t\tfmt.Fprintf(os.Stderr, \"Warning: failed to burn %s: %v\\n\", id, err)\n\t\t\t}\n\t\t\tbatchResult.FailedCount++\n\t\t\tcontinue\n\t\t}\n\t\tbatchResult.TotalDeleted += result.DeletedCount\n\t\tbatchResult.Results = append(batchResult.Results, result)\n\t}\n","sourceCodeStart":635,"sourceCodeEnd":671,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/mol_proxied_server.go#L635-L671","documentation":"Wrapped error from uw.IssueUseCase().DeleteIssues with cascade enabled during `bd mol burn`. The subgraph loaded and all issue IDs were collected, but the cascading delete of the molecule's issues failed for the ID named in the message, rolling back that molecule's burn transaction.","triggerScenarios":"Run `bd mol burn <id>` where DeleteIssues(ctx, {IDs, Cascade: true, UpdateTextReferences: true}) fails: foreign-key-like constraints from text references, storage write error, or one of the collected issue IDs vanished between load and delete.","commonSituations":"Concurrent process modified or deleted molecule children mid-burn; storage backend failure during bulk delete; text-reference rewrite failing on a corrupted comment/description row; permission/readonly mode.","solutions":["Read the wrapped inner error to find which delete step failed","Ensure no other `bd` process is mutating the molecule concurrently, then retry","Run `bd doctor` if the inner error references missing or corrupt issues","As a last resort delete the molecule's issues individually with `bd delete` after unbinding dependencies"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Ensure no concurrent bd processes, then verify the molecule still loads\nbd mol show <id>\nps aux | grep \" bd \"   // check for concurrent writers","typeGuard":null,"tryCatchPattern":"err := runMolBurnProxiedServer(ctx, ids)\nif err != nil && strings.Contains(err.Error(), \"burning\") {\n    // per-molecule transaction rolled back; safe to retry after fixing cause\n    log.Printf(\"burn of %s aborted atomically: %v\", id, err)\n}","preventionTips":["Serialize molecule mutations — never run burn concurrently with other bd writes","Back up (.beads / dolt ref) before large cascading deletes","If DeleteIssues keeps failing on text-reference rewriting, run `bd doctor` to repair corrupt rows"],"tags":["go","burn","cascade-delete","storage","molecule"],"backgroundTag":"cascade-delete-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}