{"record":{"id":"a63415d7eb197174","repo":"gastownhall/beads","slug":"failed-to-search-issues-w-a63415","errorCode":null,"errorMessage":"failed to search issues: %w","messagePattern":"failed to search issues: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/graph_proxied_server.go","lineNumber":112,"sourceCode":"\t}\n\tfor _, iss := range subgraph.Issues {\n\t\tfor _, dep := range recs[iss.ID] {\n\t\t\tif _, ok := subgraph.IssueMap[dep.DependsOnID]; ok {\n\t\t\t\tsubgraph.Dependencies = append(subgraph.Dependencies, dep)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn subgraph, nil\n}\n\nfunc loadAllGraphSubgraphsUOW(ctx context.Context, uw uow.UnitOfWork) ([]*TemplateSubgraph, error) {\n\tvar allIssues []*types.Issue\n\tfor _, status := range []types.Status{types.StatusOpen, types.StatusInProgress, types.StatusBlocked} {\n\t\tstatusCopy := status\n\t\tpage, err := uw.IssueUseCase().SearchIssues(ctx, \"\", types.IssueFilter{Status: &statusCopy})\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to search issues: %w\", err)\n\t\t}\n\t\tallIssues = append(allIssues, page.Items...)\n\t}\n\n\tif len(allIssues) == 0 {\n\t\treturn nil, nil\n\t}\n\n\tissueMap := make(map[string]*types.Issue, len(allIssues))\n\tids := make([]string, 0, len(allIssues))\n\tfor _, issue := range allIssues {\n\t\tissueMap[issue.ID] = issue\n\t\tids = append(ids, issue.ID)\n\t}\n\n\trecs, err := uw.DependencyUseCase().GetIssueDependencyRecords(ctx, ids)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to load dependencies: %w\", err)","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/graph_proxied_server.go#L94-L130","documentation":"Wraps an error returned by UnitOfWork.IssueUseCase().SearchIssues while collecting all open/in-progress/blocked issues to build graph subgraphs in the proxied graph server. The %w preserves the underlying storage/use-case error. It indicates the issue search backend failed during graph server startup or request handling.","triggerScenarios":"loadAllGraphSubgraphsUOW calls SearchIssues(ctx, \"\", types.IssueFilter{Status: &statusCopy}) for each of StatusOpen, StatusInProgress, StatusBlocked; any non-nil error from the underlying storage/query layer for any of those three statuses produces this error.","commonSituations":"Corrupt or locked Dolt database, disconnected storage driver in proxied-server mode, a schema migration mismatch making the issues table unqueryable, or a transient storage failure during one status query.","solutions":["Inspect the wrapped cause (%v of the returned error) to see the underlying storage error and fix it (e.g. restart/reconnect storage).","Verify the database is reachable and the schema is current (bd doctor / storage driver connectivity).","Retry the command; if one status consistently fails, test that specific filter against the DB directly."],"exampleFix":"// before: opaque handling\npage, err := uw.IssueUseCase().SearchIssues(ctx, \"\", types.IssueFilter{Status: &statusCopy})\nif err != nil { return nil, err }\n// after: keep context but log cause for diagnosis\nif err != nil {\n\treturn nil, fmt.Errorf(\"failed to search issues (status=%s): %w\", status, err)\n}","handlingStrategy":"try-catch","validationCode":"// Go: verify storage reachable before graph load\nif err := uw.Ping(ctx); err != nil { return fmt.Errorf(\"storage unavailable: %w\", err) }","typeGuard":null,"tryCatchPattern":"page, err := uw.IssueUseCase().SearchIssues(ctx, \"\", filter)\nif err != nil {\n\tvar storageErr *storage.Error\n\tif errors.As(err, &storageErr) { /* reconnect/retry storage */ }\n\treturn fmt.Errorf(\"failed to search issues: %w\", err)\n}","preventionTips":["Run bd doctor to validate storage health before long-running proxied server sessions.","Keep the Dolt driver connected; reconnect on transient failures.","Ensure schema migrations are applied before starting the graph server."],"tags":["storage","query","graph-server","wrapped-error"],"backgroundTag":"issue-search-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}