{"record":{"id":"b18d46debabab2db","repo":"gastownhall/beads","slug":"load-wisp-comments-w","errorCode":null,"errorMessage":"load wisp comments: %w","messagePattern":"load wisp comments: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/export_source.go","lineNumber":273,"sourceCode":"\tmergeExportMap(rel.comments, comments)\n\tcounts, err := s.uw.CommentUseCase().GetCommentCounts(ctx, allIDs)\n\tif err != nil {\n\t\treturn exportRelations{}, fmt.Errorf(\"load comment counts: %w\", err)\n\t}\n\tmergeExportMap(rel.commentCounts, counts)\n\n\twispLabels, err := s.uw.LabelUseCase().GetLabelsForWisps(ctx, allIDs) //nolint:forbidigo // bulk relation load; see GetLabelsForIssues above\n\tif err != nil {\n\t\tif !dberrors.IsTableNotExist(err) {\n\t\t\treturn exportRelations{}, fmt.Errorf(\"load wisp labels: %w\", err)\n\t\t}\n\t} else {\n\t\tmergeExportMap(rel.labels, wispLabels)\n\t}\n\twispComments, err := s.uw.CommentUseCase().GetCommentsForWisps(ctx, allIDs)\n\tif err != nil {\n\t\tif !dberrors.IsTableNotExist(err) {\n\t\t\treturn exportRelations{}, fmt.Errorf(\"load wisp comments: %w\", err)\n\t\t}\n\t} else {\n\t\tmergeExportMap(rel.comments, wispComments)\n\t}\n\twispCounts, err := s.uw.CommentUseCase().GetWispCommentCounts(ctx, allIDs)\n\tif err != nil {\n\t\tif !dberrors.IsTableNotExist(err) {\n\t\t\treturn exportRelations{}, fmt.Errorf(\"load wisp comment counts: %w\", err)\n\t\t}\n\t} else {\n\t\tmergeExportMap(rel.commentCounts, wispCounts)\n\t}\n\n\tdeps, err := s.uw.DependencyUseCase().GetIssueDependencyRecords(ctx, allIDs)\n\tif err != nil {\n\t\treturn exportRelations{}, fmt.Errorf(\"load dependency records: %w\", err)\n\t}\n\trel.deps = deps","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/export_source.go#L255-L291","documentation":"This error wraps a failure from `CommentUseCase().GetCommentsForWisps(ctx, allIDs)` when bulk-loading wisp comments during export relation gathering. Like its sibling loaders, a missing-table condition (dberrors.IsTableNotExist) is tolerated and treated as 'no wisp comments'; anything else is fatal to the export and wrapped with this prefix so the failing step is identifiable.","triggerScenarios":"Calling LoadExportRelations when GetCommentsForWisps fails with a non-table-not-exist error: Dolt backend unreachable, corrupt or locked wisp comments table, SQL execution error, or cancelled context.","commonSituations":"Exporting from a rig where the comments table was never migrated; a stale/hung Dolt server mid-query; concurrent writes locking the comments table during a large export; interrupting `bd export` so ctx is cancelled.","solutions":["Read the wrapped cause and fix the underlying storage issue (restart/reconnect the Dolt server if it's a connection error)","Run schema migrations / `bd doctor` if the comments table may be out of date or corrupt","Retry the export; transient lock or cancellation errors usually clear on a second run","If wisp comments are irrelevant, tolerate the error locally the way IsTableNotExist already does, but only for verified missing-table cases"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// verify storage reachability before the export relation pass\nif err := store.PingContext(ctx); err != nil {\n    return fmt.Errorf(\"storage backend unreachable: %w\", err)\n}","typeGuard":"func isTableNotExist(err error) bool { return dberrors.IsTableNotExist(err) }","tryCatchPattern":"wispComments, err := s.uw.CommentUseCase().GetCommentsForWisps(ctx, allIDs)\nif err != nil {\n    if !dberrors.IsTableNotExist(err) {\n        return fmt.Errorf(\"load wisp comments: %w\", err)\n    }\n}","preventionTips":["Verify wisp comment tables exist/migrated before exporting rigs with wisp data","Avoid cancelling the export context mid-run (don't Ctrl-C large exports; raise timeouts)","Resolve table locks from concurrent writers before exporting","Always inspect the wrapped cause to target the real storage failure"],"tags":["go","export","storage","dolt","comments"],"backgroundTag":"database-query-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}