{"record":{"id":"fccc3b649aa25500","repo":"gastownhall/beads","slug":"s-is-not-a-gate-issue-type-s","errorCode":null,"errorMessage":"%s is not a gate issue (type=%s)","messagePattern":"(.+?) is not a gate issue \\(type=(.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/gate_proxied_server.go","lineNumber":256,"sourceCode":"\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)\n\t\tif err := uw.IssueUseCase().UpdateIssue(ctx, gateID, map[string]any{\"waiters\": newWaiters}, actor); err != nil {\n\t\t\treturn out, \"\", fmt.Errorf(\"updating gate: %w\", err)\n\t\t}\n\t\tif after, getErr := uw.IssueUseCase().GetIssue(ctx, gateID); getErr == nil {\n\t\t\tout.after = after\n\t\t}","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/gate_proxied_server.go#L238-L274","documentation":"Thrown when the issue identified by gateID exists but its IssueType is not \"gate\". The AddWaiter path only accepts gate issues; attaching a waiter to any other issue type is rejected with the actual type included in the message. This is a validation error preventing waiter registration on non-gate issues.","triggerScenarios":"Calling AddWaiter with the ID of a task, bug, feature, epic, or chore issue; a script passes the wrong issue ID (e.g. the waiter's own ID instead of the gate's); the issue's type was changed after a waiter reference was recorded.","commonSituations":"Mixing up parent/child IDs in scripts; attempting to await on a regular task instead of creating a gate; older databases where the issue was created with a different type and later re-typed; copy-pasted IDs from another workflow.","solutions":["Confirm the correct gate ID with `bd list --type gate` and pass that ID, not a task/bug ID","Create a gate issue for the workflow if none exists (`bd create \"...\" -t gate`)","Check the issue's current type with `bd show <id>`; if it was re-typed by mistake, correct it before adding waiters","Fix scripts to resolve the gate ID rather than hard-coding the waiter issue's ID"],"exampleFix":"// before: assumes any issue ID is a valid gate\nclient.AddWaiter(ctx, taskID, waiter)\n// after: verify type before calling\nissue, _ := client.Show(ctx, taskID)\nif issue == nil || issue.IssueType != \"gate\" {\n    return fmt.Errorf(\"%s is not a gate issue; use bd list --type gate\", taskID)\n}\nclient.AddWaiter(ctx, taskID, waiter)","handlingStrategy":"validation","validationCode":"issue, err := bdClient.Show(ctx, gateID)\nif err != nil { return err }\nif issue.IssueType != \"gate\" {\n    return fmt.Errorf(\"%s is type %q, not gate — pick an ID from bd list --type gate\", gateID, issue.IssueType)\n}","typeGuard":"func isGateIssue(issue *Issue) bool {\n    return issue != nil && issue.IssueType == \"gate\"\n}","tryCatchPattern":"err := client.AddWaiter(ctx, gateID, waiter)\nif err != nil && strings.Contains(err.Error(), \"is not a gate issue\") {\n    return fmt.Errorf(\"wrong target: %v; create or locate a gate with: bd create 'wait for X' -t gate\", err)\n}","preventionTips":["Always resolve gate IDs via `bd list --type gate`, never pass task/bug IDs","Create a dedicated gate issue when a workflow needs awaiting instead of reusing a task","Audit scripts for hardcoded issue IDs that may point at non-gate types","If an issue's type was changed, re-check all registered waiters against it"],"tags":["gate","validation","issue-type","wrong-target"],"backgroundTag":"issue-not-a-gate","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}