{"record":{"id":"f179b6996b2261fc","repo":"gastownhall/beads","slug":"no-beads-configuration-found-in-s","errorCode":null,"errorMessage":"no beads configuration found in %s","messagePattern":"no beads configuration found in (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/doctor/dolt.go","lineNumber":27,"sourceCode":"\n\t// MySQL driver for connecting to dolt sql-server\n\t_ \"github.com/go-sql-driver/mysql\"\n\n\t\"github.com/steveyegge/beads/internal/configfile\"\n\t\"github.com/steveyegge/beads/internal/doltserver\"\n\n\t\"github.com/steveyegge/beads/internal/storage/dolt\"\n\t\"github.com/steveyegge/beads/internal/storage/doltutil\"\n)\n\n// openDoltDB opens a connection to the Dolt SQL server via MySQL protocol.\nfunc openDoltDB(beadsDir string) (*sql.DB, *configfile.Config, error) {\n\tcfg, err := configfile.Load(beadsDir)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to load config: %w\", err)\n\t}\n\tif cfg == nil {\n\t\treturn nil, nil, fmt.Errorf(\"no beads configuration found in %s\", beadsDir)\n\t}\n\n\thost := cfg.GetDoltServerHost()\n\tuser := cfg.GetDoltServerUser()\n\tdatabase := cfg.GetDoltDatabase()\n\n\t// Use doltserver.DefaultConfig for port resolution (env > port file > config.yaml).\n\t// Port 0 means no server running yet.\n\tdsCfg := doltserver.DefaultConfig(beadsDir)\n\tport := dsCfg.Port\n\tif port == 0 {\n\t\treturn nil, nil, fmt.Errorf(\"no Dolt server port configured and no server running; run any bd command to auto-start\")\n\t}\n\n\t// Resolve the password using the credentials file fallback keyed by the\n\t// resolved runtime port — matching the CRUD path. Env var BEADS_DOLT_PASSWORD\n\t// still takes precedence inside GetDoltServerPasswordForPort. Without this,\n\t// externally-hosted Dolt servers that keep credentials in","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/doctor/dolt.go#L9-L45","documentation":"openDoltDB in cmd/bd/doctor/dolt.go loads the beads config file from the given beadsDir before connecting to the Dolt server. If configfile.Load succeeds but returns a nil config, it means the directory contains no beads configuration file (.beads/config.yaml), so there is nothing to drive a Dolt connection from (host/user/database). bd doctor throws this to signal the target directory is not an initialized beads workspace.","triggerScenarios":"Calling openDoltDB (via openDoltConn or querySQLRemotes during `bd doctor` dolt checks) with a beadsDir where configfile.Load returns (nil, nil) — i.e., no .beads/config.yaml (or equivalent config file) exists in that directory.","commonSituations":"Running `bd doctor` in a directory that was never `bd init`ed; pointing BEADS_DIR or cwd at the wrong path (repo root instead of the .beads dir or vice versa); a deleted or renamed config.yaml; running doctor before first sync/setup in a fresh clone.","solutions":["Initialize the workspace: run `bd init` (or the equivalent bd command that writes .beads/config.yaml) in the directory you are running doctor against.","Verify you are pointing at the correct beadsDir — check env vars like BEADS_DIR and your cwd; the config lives in the .beads directory.","If the config file was deleted or renamed, restore it from git history or recreate it with the dolt server host/user/database settings."],"exampleFix":"// before\nbd doctor   # run in an uninitialized directory\n// after\nbd init && bd doctor","handlingStrategy":"validation","validationCode":"if _, statErr := os.Stat(filepath.Join(beadsDir, \"config.yaml\")); os.IsNotExist(statErr) {\n    return fmt.Errorf(\"not a beads workspace: %s has no config.yaml\", beadsDir)\n}","typeGuard":"cfg, err := configfile.Load(beadsDir)\nif err != nil {\n    return err\n}\nif cfg == nil {\n    return fmt.Errorf(\"no beads configuration in %s; run bd init\", beadsDir)\n}","tryCatchPattern":null,"preventionTips":["Always run `bd init` before any other bd command in a new clone.","Verify cwd / BEADS_DIR points at the workspace root that contains .beads/config.yaml.","Keep .beads/config.yaml committed to git so fresh clones always have it."],"tags":["beads","dolt","configuration","missing-file"],"backgroundTag":"missing-config-file","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}