gastownhall/beads · error

burning %s: %w

Error message

burning %s: %w

What it means

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.

Source

Thrown at cmd/bd/mol_proxied_server.go:653

	}

	for _, id := range persistentIDs {
		result, err := uow.RunTxResult(ctx, uowProvider, func(ctx context.Context, uw uow.UnitOfWork) (BurnResult, string, error) {
			subgraph, err := loadTemplateSubgraph(ctx, newUOWMolWriter(uw), id)
			if err != nil {
				return BurnResult{}, "", fmt.Errorf("loading subgraph for %s: %w", id, err)
			}
			issueIDs := make([]string, len(subgraph.Issues))
			for i, issue := range subgraph.Issues {
				issueIDs[i] = issue.ID
			}
			res, err := uw.IssueUseCase().DeleteIssues(ctx, domain.DeleteIssuesParams{
				IDs:                  issueIDs,
				Cascade:              true,
				UpdateTextReferences: true,
			}, actor)
			if err != nil {
				return BurnResult{}, "", fmt.Errorf("burning %s: %w", id, err)
			}
			return BurnResult{
				MoleculeID:   id,
				DeletedIDs:   issueIDs,
				DeletedCount: res.DeletedCount,
			}, fmt.Sprintf("bd: mol burn %s", id), nil
		})
		if err != nil {
			if !jsonOutput {
				fmt.Fprintf(os.Stderr, "Warning: failed to burn %s: %v\n", id, err)
			}
			batchResult.FailedCount++
			continue
		}
		batchResult.TotalDeleted += result.DeletedCount
		batchResult.Results = append(batchResult.Results, result)
	}

View on GitHub (pinned to 71377f2769)

Solutions

  1. Read the wrapped inner error to find which delete step failed
  2. Ensure no other `bd` process is mutating the molecule concurrently, then retry
  3. Run `bd doctor` if the inner error references missing or corrupt issues
  4. As a last resort delete the molecule's issues individually with `bd delete` after unbinding dependencies
Defensive patterns

Strategy: retry

Validate before calling

// Ensure no concurrent bd processes, then verify the molecule still loads
bd mol show <id>
ps aux | grep " bd "   // check for concurrent writers

Try / catch

err := runMolBurnProxiedServer(ctx, ids)
if err != nil && strings.Contains(err.Error(), "burning") {
    // per-molecule transaction rolled back; safe to retry after fixing cause
    log.Printf("burn of %s aborted atomically: %v", id, err)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/5a3362795b61ca58. Report an issue: GitHub.