{"record":{"id":"71d6f778b18dc7f2","repo":"gastownhall/beads","slug":"step-s-not-found","errorCode":null,"errorMessage":"step %s not found","messagePattern":"step (.+?) not found","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/mol_port.go","lineNumber":107,"sourceCode":"// store, which opens a second pool connection — a deadlock when\n// MaxOpenConns=1 and the transaction already holds the only one. It also\n// keeps the read consistent with any config written earlier in the same\n// transaction rather than seeing the last committed value.\nfunc (w storeMolWriter) GetConfig(ctx context.Context, key string) (string, error) {\n\tif w.tx != nil {\n\t\treturn w.tx.GetConfig(ctx, key)\n\t}\n\treturn w.DoltStorage.GetConfig(ctx, key)\n}\n\nfunc (w storeMolWriter) ClaimStepIfOpen(ctx context.Context, id, actor string) error {\n\treturn w.DoltStorage.RunInTransaction(ctx, fmt.Sprintf(\"bd: advance to step %s\", id), func(tx storage.Transaction) error {\n\t\tcurrent, err := tx.GetIssue(ctx, id)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif current == nil {\n\t\t\treturn fmt.Errorf(\"step %s not found\", id)\n\t\t}\n\t\tif current.Status != types.StatusOpen {\n\t\t\treturn fmt.Errorf(\"step %s already claimed (status: %s)\", id, current.Status)\n\t\t}\n\t\treturn tx.UpdateIssue(ctx, id, map[string]interface{}{\"status\": types.StatusInProgress}, actor)\n\t})\n}\n\nfunc newStandaloneStoreMolWriter(store storage.DoltStorage) storeMolWriter {\n\treturn storeMolWriter{DoltStorage: store}\n}\n\ntype uowMolReader struct {\n\tuw uow.UnitOfWork\n}\n\nfunc (r uowMolReader) GetIssue(ctx context.Context, id string) (*types.Issue, error) {\n\tissue, isWisp, rerr := workapi.GetIssueOrWisp(ctx, workapi.NewUOWDetailSource(r.uw), id)","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/mol_port.go#L89-L125","documentation":"The molecule step-advance transaction looks up the step issue by ID inside a Dolt transaction and requires it to exist. When `tx.GetIssue` returns nil (the ID does not correspond to any issue), the port layer converts that into a formatted `step %s not found` error so the caller knows the molecule step ID was wrong.","triggerScenarios":"Calling the molecule port's advance/claim operation with an issue ID that does not exist in the database — e.g. a typo'd step ID, an ID from another database, or a deleted/wisp-routed issue. `GetIssue` returns nil inside the `RunInTransaction` callback and the error is raised.","commonSituations":"Copy-pasting an ID with a typo; referencing a step that was closed and cleaned up; pointing at a different workspace/database than the one containing the molecule; stale scripts holding IDs from a re-created molecule.","solutions":["Verify the step ID with `bd show <id>` (or `bd list`) and correct any typo.","List the molecule's actual steps (`bd mol progress <molecule>`) and use one of those IDs.","Confirm you are operating on the same database/workspace that contains the molecule."],"exampleFix":"// before\nerr := writer.AdvanceToStep(ctx, \"bd-9999\", actor)   // id typo\n// after\nerr := writer.AdvanceToStep(ctx, \"bd-1234\", actor)   // verified step id","handlingStrategy":"validation","validationCode":"// shell: confirm the step exists before advancing\nbd show \"$STEP_ID\" --json >/dev/null 2>&1 || { echo \"step $STEP_ID does not exist\"; exit 1; }\n# then invoke the advance/claim step via your mol workflow","typeGuard":"func stepExists(ctx context.Context, r MolReader, id string) bool {\n\tiss, err := r.GetIssue(ctx, id)\n\treturn err == nil && iss != nil\n}","tryCatchPattern":"if err := advance(ctx, stepID, actor); err != nil && strings.Contains(err.Error(), \"not found\") {\n\treturn fmt.Errorf(\"step id %q invalid: %w\", stepID, err)\n}","preventionTips":["Pull step IDs from `bd mol progress <molecule>` output rather than hardcoding them.","Re-verify IDs after burns, wisp flushes, or database rebuilds.","Confirm the working directory/database matches where the molecule lives."],"tags":["cli","not-found","issue-lookup"],"backgroundTag":"issue-not-found","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}