{"record":{"id":"547dc639577a8ad8","repo":"gastownhall/beads","slug":"gate-not-found-s","errorCode":null,"errorMessage":"gate not found: %s","messagePattern":"gate not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/gate_proxied_server.go","lineNumber":250,"sourceCode":"\tdefer func() {\n\t\tif c := metrics.Global(); c != nil {\n\t\t\tc.CloseEventAndAdd(evt)\n\t\t}\n\t}()\n\n\tgateID := args[0]\n\twaiter := args[1]\n\n\tif uowProvider == nil {\n\t\treturn HandleError(\"proxied-server UOW provider not initialized\")\n\t}\n\n\tapplied, err := uow.RunTxResult(ctx, uowProvider, func(ctx context.Context, uw uow.UnitOfWork) (gateAddWaiterApply, string, error) {\n\t\tvar out gateAddWaiterApply\n\n\t\tissue, err := uw.IssueUseCase().GetIssue(ctx, gateID)\n\t\tif gateProxiedNotFound(err) {\n\t\t\treturn out, \"\", fmt.Errorf(\"gate not found: %s\", gateID)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn out, \"\", fmt.Errorf(\"reading gate %s: %w\", gateID, err)\n\t\t}\n\t\tif issue.IssueType != \"gate\" {\n\t\t\treturn out, \"\", fmt.Errorf(\"%s is not a gate issue (type=%s)\", gateID, issue.IssueType)\n\t\t}\n\n\t\tfor _, w := range issue.Waiters {\n\t\t\tif w == waiter {\n\t\t\t\tout.already = true\n\t\t\t\t// Empty commit message: a registered waiter is a no-op, and a\n\t\t\t\t// no-op writes no Dolt commit.\n\t\t\t\treturn out, \"\", nil\n\t\t\t}\n\t\t}\n\n\t\tnewWaiters := append(issue.Waiters, waiter)","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/gate_proxied_server.go#L232-L268","documentation":"Thrown inside the gate AddWaiter transaction when GetIssue reports the gate ID does not exist. The caller asked to attach a waiter to a gate issue, but no issue with that ID is present in storage. This distinguishes a clean not-found from a storage failure (which produces 'reading gate %s' instead).","triggerScenarios":"Calling the proxied-server gate AddWaiter path with a gateID that was never created, was deleted, or is mistyped; gateProxiedNotFound(err) returns true for the GetIssue result.","commonSituations":"Typo in the gate issue ID (bd-xxx vs bd-yyy); gate deleted after a workflow run completed; issue created in a different database/remote than the one the server is connected to; stale cached ID from an earlier session.","solutions":["Run `bd show <gateID>` to confirm the issue exists in the connected database","Check for typos in the gate ID; use `bd list --type gate` to list valid gate issues","If the gate was deleted intentionally, remove or recreate the waiter registration instead of retrying","Verify the server is pointed at the expected database/remote (`bd doctor`)"],"exampleFix":"// before: blind AddWaiter call\nerr := client.AddWaiter(ctx, gateID, waiter)\n// after: confirm the gate exists and is a gate first\nissue, err := client.Show(ctx, gateID)\nif err != nil || issue == nil {\n    return fmt.Errorf(\"gate %s does not exist; run bd list --type gate\", gateID)\n}\nif issue.IssueType != \"gate\" {\n    return fmt.Errorf(\"%s is not a gate issue (type=%s)\", gateID, issue.IssueType)\n}\nerr = client.AddWaiter(ctx, gateID, waiter)","handlingStrategy":"validation","validationCode":"issue, err := bdClient.Show(ctx, gateID)\nif err != nil {\n    return fmt.Errorf(\"gate %s does not exist in this database; run bd list --type gate\", gateID)\n}","typeGuard":"func gateExists(ctx context.Context, uc *IssueUseCase, gateID string) bool {\n    issue, err := uc.GetIssue(ctx, gateID)\n    return err == nil && issue != nil\n}","tryCatchPattern":"err := client.AddWaiter(ctx, gateID, waiter)\nif err != nil && strings.Contains(err.Error(), \"gate not found\") {\n    gates, _ := client.List(ctx, ListFilter{IssueType: \"gate\"})\n    return fmt.Errorf(\"gate %s not found; known gates: %v\", gateID, gates)\n}","preventionTips":["Copy gate IDs from `bd list --type gate` output, never from memory","Confirm the server/client point at the same database/remote (`bd doctor`)","Re-resolve gate IDs after any issue-deletion workflow","Use tab-completion or bd's ID resolution instead of hand-typing bd-xxx IDs"],"tags":["gate","not-found","storage","validation"],"backgroundTag":"gate-issue-not-found","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}