{"record":{"id":"21802fbe04028473","repo":"gastownhall/beads","slug":"issue-s-not-found-21802f","errorCode":null,"errorMessage":"issue %s not found","messagePattern":"issue (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/heartbeat_proxied_server.go","lineNumber":37,"sourceCode":"\n// runHeartbeatProxiedServer routes bd heartbeat through the proxied-server\n// plane. The lease write is EPHEMERAL (the dolt_ignored leases table,\n// bd-lrgn1): the transaction commits via uow.RunTxEphemeral's SQL-only form,\n// so a heartbeat mints exactly ZERO Dolt commits per invocation — the same\n// commit discipline as the classic DoltStore.HeartbeatIssue, and deliberately\n// nothing here sets commandDidWrite or creates a Dolt commit. The exit code\n// is the worker contract (workers call this every ~90s and only check rc):\n// 0 = lease refreshed; nonzero = the lease is gone (wrong owner, not\n// in_progress, closed, reclaimed) and the worker should stop.\nfunc runHeartbeatProxiedServer(ctx context.Context, id string) error {\n\tif uowProvider == nil {\n\t\treturn HandleErrorRespectJSON(\"proxied-server UOW provider not initialized\")\n\t}\n\n\tres, err := uow.RunTxEphemeral(ctx, uowProvider, func(ctx context.Context, uw uow.UnitOfWork) (heartbeatProxiedOutcome, error) {\n\t\tissue, _, rerr := workapi.GetIssueOrWisp(ctx, workapi.NewUOWDetailSource(uw), id)\n\t\tif errors.Is(rerr, storage.ErrNotFound) {\n\t\t\treturn heartbeatProxiedOutcome{}, fmt.Errorf(\"issue %s not found\", id)\n\t\t}\n\t\tif rerr != nil {\n\t\t\treturn heartbeatProxiedOutcome{}, fmt.Errorf(\"resolving %s: %w\", id, rerr)\n\t\t}\n\t\t// Wisps resolve here too and are refused below: the repo verb\n\t\t// classifies them ErrNotClaimable (\"is ephemeral\"), same as classic.\n\t\tif herr := uw.IssueUseCase().Heartbeat(ctx, issue.ID, actor); herr != nil {\n\t\t\treturn heartbeatProxiedOutcome{}, fmt.Errorf(\"heartbeat %s: %w\", issue.ID, herr)\n\t\t}\n\t\treturn heartbeatProxiedOutcome{id: issue.ID, title: issue.Title}, nil\n\t})\n\tif err != nil {\n\t\treturn HandleErrorRespectJSON(\"%v\", err)\n\t}\n\n\tSetLastTouchedID(res.id)\n\treturn renderHeartbeatSuccess(res.id, res.title)\n}","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/heartbeat_proxied_server.go#L19-L55","documentation":"Returned when workapi.GetIssueOrWisp reports storage.ErrNotFound for the given issue ID during a proxied heartbeat command. It means no issue (classic or wisp) with that ID exists in the database. This is an expected, user-facing 'unknown ID' error, not an internal failure.","triggerScenarios":"bd heartbeat <id> (proxied server path) is run with an ID that GetIssueOrWisp cannot resolve; errors.Is(rerr, storage.ErrNotFound) is true and the message is formatted with the requested ID.","commonSituations":"Typo in the issue ID, issue was deleted or closed and cleaned up, heartbeat issued against a different database/repo than where the issue lives, or prefix abbreviation that matches nothing.","solutions":["Run bd list or bd show to confirm the exact issue ID.","Check you are in the repo/database where the issue was created (sync may be needed: bd dolt pull).","If the issue was deleted, create a new issue instead of heartbeating the stale ID."],"exampleFix":"// before\nbd heartbeat bd-9999\n// error: issue bd-9999 not found\n// after: resolve the real ID first\nbd list --json | jq '.[].id'\nbd heartbeat bd-123","handlingStrategy":"validation","validationCode":"// before heartbeating, confirm the ID exists\nbd list --json | jq -e --arg id \"$ID\" 'any(.[]; .id == $id)'","typeGuard":null,"tryCatchPattern":"if strings.Contains(err.Error(), \"not found\") {\n\t// prompt user for correct ID via bd list / bd show\n}","preventionTips":["Copy issue IDs from bd list output rather than typing them.","Sync (bd dolt pull) before operating on issues created elsewhere.","Script against full IDs, not ambiguous prefixes."],"tags":["not-found","heartbeat","issue-id","proxied-server"],"backgroundTag":"issue-not-found","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}