{"record":{"id":"49783261b43d763a","repo":"gastownhall/beads","slug":"pouring-proto-w","errorCode":null,"errorMessage":"pouring proto: %w","messagePattern":"pouring proto: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/mol_proxied_server.go","lineNumber":127,"sourceCode":"\t\t}\n\n\t\tif in.dryRun {\n\t\t\tvar previews []pourAttachPreview\n\t\t\tfor _, a := range attachments {\n\t\t\t\tpreviews = append(previews, pourAttachPreview{title: a.issue.Title, steps: len(a.subgraph.Issues)})\n\t\t\t}\n\t\t\trenderPourDryRun(protoID, subgraph, vars, in.assignee, in.attachType, previews)\n\t\t\treturn pourProxiedResult{}, \"\", nil\n\t\t}\n\n\t\tspawnResult, err := cloneSubgraphInto(ctx, w, subgraph, CloneOptions{\n\t\t\tVars:     vars,\n\t\t\tAssignee: in.assignee,\n\t\t\tActor:    actor,\n\t\t\tPrefix:   types.IDPrefixMol,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn pourProxiedResult{}, \"\", fmt.Errorf(\"pouring proto: %w\", err)\n\t\t}\n\n\t\ttotalAttached := 0\n\t\tif len(attachments) > 0 {\n\t\t\tspawnedMol, err := w.GetIssue(ctx, spawnResult.NewEpicID)\n\t\t\tif err != nil {\n\t\t\t\treturn pourProxiedResult{}, \"\", fmt.Errorf(\"loading spawned mol: %w\", err)\n\t\t\t}\n\t\t\tfor _, attach := range attachments {\n\t\t\t\tbondResult, err := bondProtoMolAttachInto(ctx, w, attach.subgraph, attach.issue, spawnedMol, in.attachType, vars, \"\", actor, false, true)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn pourProxiedResult{}, \"\", fmt.Errorf(\"attaching %s: %w\", attach.id, err)\n\t\t\t\t}\n\t\t\t\ttotalAttached += bondResult.Spawned\n\t\t\t}\n\t\t}\n\n\t\treturn pourProxiedResult{spawn: spawnResult, totalAttached: totalAttached, attachCount: len(attachments)},","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/mol_proxied_server.go#L109-L145","documentation":"Wrapped error from cloneSubgraphInto during `bd mol pour`. The proto resolved, validated, and passed dry-run checks, but actually cloning the template subgraph into new issues (prefix bd-mol) failed inside the pour transaction. The whole transaction rolls back, so no partial molecule is left behind.","triggerScenarios":"Any `bd mol pour <proto>` where the clone step fails: ID generation collision, storage write error, constraint violation when inserting cloned issues, or failure creating dependency edges among cloned children.","commonSituations":"Database locked or connection dropped mid-transaction; read-only or full storage; duplicated molecule ID prefix exhaustion; a bug in variable substitution producing invalid issue fields (empty title after interpolation).","solutions":["Read the wrapped inner error to identify the failing insert/update and fix that cause","Verify the database is writable and not locked (close other `bd` processes, check disk space)","Retry the pour — the transaction is atomic, so a transient failure leaves no partial state","If variable substitution produced invalid fields, re-run with corrected --var values"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Confirm writable, unlocked storage before pouring\nbd ready 2>&1 && df -h .beads","typeGuard":null,"tryCatchPattern":"err := runPourProxiedServer(ctx, in)\nif err != nil && isTransientStorageError(errors.Unwrap(err)) {\n    time.Sleep(backoff)\n    err = runPourProxiedServer(ctx, in) // safe: pour is transactional\n}","preventionTips":["Avoid running concurrent `bd` writes while pouring","Monitor disk space and database health (`bd doctor`) on CI runners","Test --var values with --dry-run before real pours to avoid invalid interpolated fields"],"tags":["go","storage","clone","pour","molecule"],"backgroundTag":"clone-transaction-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}