{"record":{"id":"ce84d20fddd057f5","repo":"gastownhall/beads","slug":"resolving-parent-q-w","errorCode":null,"errorMessage":"resolving parent %q: %w","messagePattern":"resolving parent %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/label_proxied_server.go","lineNumber":157,"sourceCode":"\t}\n\tif strings.HasPrefix(label, \"provides:\") {\n\t\treturn HandleErrorRespectJSON(\"'provides:' labels are reserved for cross-project capabilities. Hint: use 'bd ship %s' instead\", strings.TrimPrefix(label, \"provides:\"))\n\t}\n\tif uowProvider == nil {\n\t\treturn HandleError(\"proxied-server UOW provider not initialized\")\n\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","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/label_proxied_server.go#L139-L175","documentation":"The generic counterpart to the not-found case: GetIssueOrWisp failed with an error other than storage.ErrNotFound while resolving the parent issue in the proxied-server label flow, and it is wrapped with %w preserving the cause (auth failure, server/storage error, etc.).","triggerScenarios":"`bd label <sub> <parent-id> ...` through a proxied server where the GetIssueOrWisp call errors — server unreachable mid-call, permission/adapter failure, malformed response from the work API.","commonSituations":"Server-side outages or restarting daemon while issuing label commands; authentication/authorization problems against the proxied server; driver/storage faults on the server.","solutions":["Read the wrapped %w cause and address it (restart server, re-authenticate).","Retry the command once the server is healthy.","Fall back to the non-proxied path if appropriate, after confirming the server config in bd is correct."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"# check server reachability before the command\nbd doctor >/dev/null 2>&1 || { echo \"bd server unhealthy\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":"out=$(bd label add \"$PARENT_ID\" \"$LABEL\" 2>&1) || {\n  echo \"$out\" >&2   # wrapped %w shows the upstream cause\n  sleep 2; bd label add \"$PARENT_ID\" \"$LABEL\"   # retry transient server faults\n}","preventionTips":["Monitor server/daemon health before batch label operations.","Re-authenticate when wrapped errors indicate permission failures.","Retry only idempotent label operations; inspect %w first for permanent causes."],"tags":["labels","proxied-server","upstream-error"],"backgroundTag":"issue-id-resolution-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}