{"record":{"id":"9a6e0666639f1ccb","repo":"gastownhall/beads","slug":"running-performance-diagnostics-w","errorCode":null,"errorMessage":"running performance diagnostics: %w","messagePattern":"running performance diagnostics: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/doctor/perf.go","lineNumber":20,"sourceCode":"\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"runtime\"\n\t\"runtime/pprof\"\n)\n\n// RunPerformanceDiagnostics runs performance diagnostics.\n// Delegates to Dolt backend diagnostics.\nfunc RunPerformanceDiagnostics(path string) error {\n\tbeadsDir := ResolveBeadsDirForRepo(path)\n\tif _, err := os.Stat(beadsDir); os.IsNotExist(err) {\n\t\treturn fmt.Errorf(\"no .beads/ directory found at %s; run 'bd init' to initialize beads\", path)\n\t}\n\n\tmetrics, err := RunDoltPerformanceDiagnostics(path, true)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"running performance diagnostics: %w\", err)\n\t}\n\tPrintDoltPerfReport(metrics)\n\treturn nil\n}\n\n// CollectPlatformInfo gathers platform information for diagnostics.\nfunc CollectPlatformInfo(path string) map[string]string {\n\tinfo := make(map[string]string)\n\tinfo[\"os_arch\"] = fmt.Sprintf(\"%s/%s\", runtime.GOOS, runtime.GOARCH)\n\tinfo[\"go_version\"] = runtime.Version()\n\n\tbeadsDir := ResolveBeadsDirForRepo(path)\n\tif IsDoltBackend(beadsDir) {\n\t\tinfo[\"backend\"] = \"dolt\"\n\t} else {\n\t\tinfo[\"backend\"] = \"unknown\"\n\t}\n","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/doctor/perf.go#L2-L38","documentation":"After confirming .beads/ exists, RunPerformanceDiagnostics calls RunDoltPerformanceDiagnostics; any error from the Dolt-side diagnostics is wrapped with this prefix and returned. The cause is the inner diagnostic failure (non-Dolt backend, server down, query failure, etc.).","triggerScenarios":"RunDoltPerformanceDiagnostics(path, true) returns an error: backend is not Dolt, dolt sql-server is unreachable, or one of the diagnostic queries fails.","commonSituations":"Repo configured for a non-Dolt (e.g. JSONL/SQLite) backend while running Dolt perf diagnostics; dolt sql-server stopped or crashed; database corruption causing query errors.","solutions":["Read the wrapped cause (%w) for the real failure","If backend is not Dolt, run the appropriate backend diagnostics or 'bd dolt start' first","Ensure dolt sql-server is running and reachable at the configured host/port"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if !hasBeadsDir(repo) { return }; // and ensure diagnostics are invoked on a Dolt backend\nbeadsDir := ResolveBeadsDirForRepo(repo); if !IsDoltBackend(beadsDir) { return }","typeGuard":null,"tryCatchPattern":"if err := RunPerformanceDiagnostics(repo); err != nil {\n    var cause error; errors.As(err, &cause)\n    log.Printf(\"perf diagnostics failed: %v\", cause) // unwrap %w cause\n}","preventionTips":["Check IsDoltBackend before requesting Dolt perf diagnostics","Keep dolt sql-server running before doctor runs","Always log errors.Unwrap output to find the true cause"],"tags":["beads","dolt","doctor","wrapping"],"backgroundTag":"dolt-diagnostics-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}