{"record":{"id":"0955161ea445df5b","repo":"gastownhall/beads","slug":"initial-query-w","errorCode":null,"errorMessage":"initial query: %w","messagePattern":"initial query: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/list_proxied_server.go","lineNumber":157,"sourceCode":"\t\t\tissues, hasMore = workapi.FinishPage(issues, \"id\", false, in.effectiveLimit, false)\n\t\tdefault:\n\t\t\tpage, perr := uw.IssueUseCase().SearchIssues(ctx, \"\", filter)\n\t\t\tif perr != nil {\n\t\t\t\treturn nil, false, nil, perr\n\t\t\t}\n\t\t\tissues, hasMore = workapi.FinishPage(page.Items, in.SortBy, in.Reverse, in.effectiveLimit, page.HasMore)\n\t\t}\n\n\t\tdeps, err := loadDepsForIssues(ctx, uw, issues)\n\t\tif err != nil {\n\t\t\treturn nil, false, nil, err\n\t\t}\n\t\treturn issues, hasMore, deps, nil\n\t}\n\n\tissues, hasMore, deps, err := load()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"initial query: %w\", err)\n\t}\n\tdisplayPrettyListWithDeps(issues, true, deps, hasMore, in.ReadyFlag)\n\tprintTruncationHint(hasMore, in.effectiveLimit)\n\tlastSnapshot := issueSnapshot(issues)\n\n\tfmt.Fprintf(os.Stderr, \"\\nWatching for changes... (Press Ctrl+C to exit)\\n\")\n\n\tsigChan := make(chan os.Signal, 1)\n\tsignal.Notify(sigChan, os.Interrupt, syscall.SIGTERM)\n\tdefer signal.Stop(sigChan)\n\n\tticker := time.NewTicker(2 * time.Second)\n\tdefer ticker.Stop()\n\n\tfor {\n\t\tselect {\n\t\tcase <-sigChan:\n\t\t\tfmt.Fprintf(os.Stderr, \"\\nStopped watching.\\n\")","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/list_proxied_server.go#L139-L175","documentation":"runListProxiedWatch performs the first query of `bd list --watch` and wraps any load failure with 'initial query:'. The watch loop can't start without a baseline snapshot, so the initial fetch error is fatal and labeled distinctly from later refresh failures.","triggerScenarios":"`bd list --watch` (proxied mode) where the first load() — the filtered issue query — returns an error: daemon/storage failure, invalid filter combination, or query backend error.","commonSituations":"Daemon connection drops right as watch starts, an invalid --status/--assignee value rejected by the query layer, or the Dolt backend briefly unavailable.","solutions":["Run `bd list` without --watch first to confirm the plain query works","Check daemon health (`bd doctor`) and restart it if needed","Fix the offending filter flags (validate values like --status)","Retry — if the failure was transient the next invocation should succeed"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"# Verify the same query works without --watch first\nbd list --status open --limit 1 >/dev/null 2>&1 || { echo \"query invalid or backend down\"; exit 1; }","typeGuard":null,"tryCatchPattern":"// Restart watch on initial-query failure\nuntil bd list --watch --status open; do sleep 5; done","preventionTips":["Validate filter flags with a single non-watch run first","Monitor daemon health for long watch sessions","Use --limit to keep the initial query small"],"tags":["watch","query","proxied-server"],"backgroundTag":"initial-query-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}