{"record":{"id":"abee6dfe1cd961cd","repo":"gastownhall/beads","slug":"dolt-sql-server-is-not-running-on-s-d-start-it","errorCode":null,"errorMessage":"dolt sql-server is not running on %s:%d; start it with 'bd dolt start'","messagePattern":"dolt sql-server is not running on (.+?):(.+?); start it with 'bd dolt start'","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/doctor/perf_dolt.go","lineNumber":91,"sourceCode":"\tdbName := configfile.DefaultDoltDatabase\n\tif cfg, err := configfile.Load(beadsDir); err == nil && cfg != nil {\n\t\tdbName = cfg.GetDoltDatabase()\n\t}\n\n\t// Start profiling if requested\n\tif enableProfiling {\n\t\tprofilePath := fmt.Sprintf(\"beads-dolt-perf-%s.prof\", time.Now().Format(\"2006-01-02-150405\"))\n\t\tif profileFile, err := startCPUProfile(profilePath); err != nil {\n\t\t\tfmt.Fprintf(os.Stderr, \"Warning: failed to start CPU profiling: %v\\n\", err)\n\t\t} else {\n\t\t\tmetrics.ProfilePath = profilePath\n\t\t\tdefer stopCPUProfile(profileFile)\n\t\t}\n\t}\n\n\t// Connect and run diagnostics via server\n\tif !serverRunning {\n\t\treturn metrics, fmt.Errorf(\"dolt sql-server is not running on %s:%d; start it with 'bd dolt start'\", dsCfg.Host, dsCfg.Port)\n\t}\n\n\tif err := runDoltServerDiagnostics(metrics, dsCfg.Host, dsCfg.Port, dbName, beadsDir); err != nil {\n\t\treturn metrics, fmt.Errorf(\"server diagnostics failed: %w\", err)\n\t}\n\n\t// Calculate database size\n\tmetrics.DatabaseSize = getDoltDatabaseSize(doltDir)\n\n\treturn metrics, nil\n}\n\n// runDoltServerDiagnostics runs diagnostics via dolt sql-server\nfunc runDoltServerDiagnostics(metrics *DoltPerfMetrics, host string, port int, dbName string, beadsDir string) error {\n\tmetrics.Backend = \"dolt-server\"\n\tmetrics.ServerMode = true\n\n\t// Resolve credentials from config and environment, matching openDoltDB behavior.","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/doctor/perf_dolt.go#L73-L109","documentation":"The Dolt perf diagnostics run through a live dolt sql-server. If the server was not detected running at the configured host:port, the run aborts with this message telling the user how to start it.","triggerScenarios":"RunDoltPerformanceDiagnostics executes with serverRunning == false for the configured DoltServerConfig — dolt sql-server is not listening on dsCfg.Host:dsCfg.Port.","commonSituations":"Forgot to run 'bd dolt start' after reboot; server crashed; connecting from a different container/host where the port isn't published; wrong host/port in config; embedded vs server mode confusion.","solutions":["Run 'bd dolt start' to launch dolt sql-server","Verify the server is listening: check the configured host and port (e.g. ss -ltn / nc -zv host port)","Correct the Dolt server host/port in beads config if pointing at the wrong instance"],"exampleFix":"// before\nRunDoltPerformanceDiagnostics(path, true) // server not started\n// after\nexec.Command(\"bd\", \"dolt\", \"start\").Run() // then\nRunDoltPerformanceDiagnostics(path, true)","handlingStrategy":"retry","validationCode":"conn, err := net.DialTimeout(\"tcp\", fmt.Sprintf(\"%s:%d\", host, port), 2*time.Second)\nif conn != nil { conn.Close() } // if err != nil, start the server first","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"is not running\") {\n    exec.Command(\"bd\", \"dolt\", \"start\").Run()\n    err = RunDoltPerformanceDiagnostics(path, true) // retry once\n}","preventionTips":["Start 'bd dolt start' before any server-based doctor checks","Health-check the host:port in CI before running diagnostics","Publish/expose the Dolt port when running in containers"],"tags":["beads","dolt","server","network"],"backgroundTag":"connection-refused","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}