{"record":{"id":"2f0dc2dd3344f1a2","repo":"gastownhall/beads","slug":"searching-children-of-s-w","errorCode":null,"errorMessage":"searching children of %s: %w","messagePattern":"searching children of (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/label_proxied_server.go","lineNumber":163,"sourceCode":"\t}\n\n\tvar (\n\t\tchildren []*types.Issue\n\t\tparentID string\n\t)\n\terr := uow.RunTx(ctx, uowProvider, func(ctx context.Context, uw uow.UnitOfWork) (string, error) {\n\t\tparent, _, rerr := workapi.GetIssueOrWisp(ctx, workapi.NewUOWDetailSource(uw), args[0])\n\t\tif errors.Is(rerr, storage.ErrNotFound) {\n\t\t\treturn \"\", fmt.Errorf(\"resolving parent %q: not found\", args[0])\n\t\t}\n\t\tif rerr != nil {\n\t\t\treturn \"\", fmt.Errorf(\"resolving parent %q: %w\", args[0], rerr)\n\t\t}\n\t\tparentID = parent.ID\n\n\t\tpage, err := uw.IssueUseCase().SearchIssues(ctx, \"\", types.IssueFilter{ParentID: &parentID})\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"searching children of %s: %w\", parentID, err)\n\t\t}\n\t\tchildren = page.Items\n\t\tif len(children) == 0 {\n\t\t\treturn \"\", nil\n\t\t}\n\t\t// THE ONE SURVIVING WISP SWITCH, and it is named rather than hidden.\n\t\t// This is the same four-way shape ga-26w10 deleted from `bd label` and\n\t\t// ga-2ltro.12 deleted from `bd tag`, `bd set-state` and the molecule\n\t\t// port — the branch a front door can get backwards and put a wisp's\n\t\t// label in the durable table. It survives because propagate is a search\n\t\t// plus a fan-out that must land as ONE transaction over N children, and\n\t\t// a per-child Lifecycle.Update is N transactions: the atomicity this\n\t\t// command has today would be the price of the migration. The shape that\n\t\t// keeps both is issueops.BatchApplier.ApplyBatch with one ItemUpdate per\n\t\t// child carrying this same label patch, and it is blocked on a cmd/bd\n\t\t// accessor for that role. That is the follow-up this waiver names\n\t\t// (ga-2ltro.12); it is the last one on this list that WRITES.\n\t\tfor _, child := range children {","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/label_proxied_server.go#L145-L181","documentation":"This error wraps a failure from IssueUseCase().SearchIssues when listing the children of a parent issue during label propagation. The parent was resolved successfully, but querying issues filtered by ParentID failed (storage/backend error). It is wrapped with %w so the underlying storage error is preserved for errors.Is/As inspection.","triggerScenarios":"Calling the label propagate flow where args[0] resolves to a parent issue, and SearchIssues(ctx, \"\", IssueFilter{ParentID: &parentID}) returns a non-nil err — e.g. Dolt/storage backend unavailable, corrupt database, or query timeout.","commonSituations":"Database server down or unreachable mid-command; corrupted .beads/Dolt workspace; permission errors on the storage backend while running `bd label <parent> --propagate` style commands.","solutions":["Check the wrapped root cause in the error chain and fix the underlying storage/connection issue first","Verify the workspace database is healthy (e.g. bd doctor) and that the Dolt server/DB is reachable","Re-run the label command once storage is restored; the operation is a read of children plus label fan-out and is safe to retry"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before propagating, verify storage is reachable\nif _, err := uw.IssueUseCase().SearchIssues(ctx, \"\", types.IssueFilter{ParentID: &parentID, Limit: intPtr(1)}); err != nil {\n    return fmt.Errorf(\"storage unavailable: %w\", err)\n}","typeGuard":"func isStorageError(err error) bool {\n    var serr *storage.StorageError\n    return errors.As(err, &serr)\n}","tryCatchPattern":"page, err := uw.IssueUseCase().SearchIssues(ctx, \"\", types.IssueFilter{ParentID: &parentID})\nif err != nil {\n    if isStorageError(err) { /* retry or report backend down */ }\n    return fmt.Errorf(\"searching children of %s: %w\", parentID, err)\n}","preventionTips":["Run bd doctor before bulk operations to confirm workspace health","Keep the Dolt server/DB connection verified in scripts before batch label operations","Handle errors via errors.Is/As on the wrapped cause, not string matching"],"tags":["storage","label-propagation","error-wrapping"],"backgroundTag":"storage-query-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}