gastownhall/beads · error

running performance diagnostics: %w

Error message

running performance diagnostics: %w

What it means

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.).

Source

Thrown at cmd/bd/doctor/perf.go:20

import (
	"fmt"
	"os"
	"runtime"
	"runtime/pprof"
)

// RunPerformanceDiagnostics runs performance diagnostics.
// Delegates to Dolt backend diagnostics.
func RunPerformanceDiagnostics(path string) error {
	beadsDir := ResolveBeadsDirForRepo(path)
	if _, err := os.Stat(beadsDir); os.IsNotExist(err) {
		return fmt.Errorf("no .beads/ directory found at %s; run 'bd init' to initialize beads", path)
	}

	metrics, err := RunDoltPerformanceDiagnostics(path, true)
	if err != nil {
		return fmt.Errorf("running performance diagnostics: %w", err)
	}
	PrintDoltPerfReport(metrics)
	return nil
}

// CollectPlatformInfo gathers platform information for diagnostics.
func CollectPlatformInfo(path string) map[string]string {
	info := make(map[string]string)
	info["os_arch"] = fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH)
	info["go_version"] = runtime.Version()

	beadsDir := ResolveBeadsDirForRepo(path)
	if IsDoltBackend(beadsDir) {
		info["backend"] = "dolt"
	} else {
		info["backend"] = "unknown"
	}

View on GitHub (pinned to 71377f2769)

Solutions

  1. Read the wrapped cause (%w) for the real failure
  2. If backend is not Dolt, run the appropriate backend diagnostics or 'bd dolt start' first
  3. Ensure dolt sql-server is running and reachable at the configured host/port
Defensive patterns

Strategy: try-catch

Validate before calling

if !hasBeadsDir(repo) { return }; // and ensure diagnostics are invoked on a Dolt backend
beadsDir := ResolveBeadsDirForRepo(repo); if !IsDoltBackend(beadsDir) { return }

Try / catch

if err := RunPerformanceDiagnostics(repo); err != nil {
    var cause error; errors.As(err, &cause)
    log.Printf("perf diagnostics failed: %v", cause) // unwrap %w cause
}

Prevention

When it happens

Trigger: RunDoltPerformanceDiagnostics(path, true) returns an error: backend is not Dolt, dolt sql-server is unreachable, or one of the diagnostic queries fails.

Common situations: 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.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/9a6e0666639f1ccb. Report an issue: GitHub.