{"record":{"id":"246e8ce8125e0844","repo":"gastownhall/beads","slug":"server-newdoltserver-configpath-is-required","errorCode":null,"errorMessage":"server: NewDoltServer: configPath is required","messagePattern":"server: NewDoltServer: configPath is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/dbproxy/server/doltserver.go","lineNumber":71,"sourceCode":"\n\tlogFile *os.File\n\teg      *errgroup.Group\n\tegCtx   context.Context\n\tcancel  context.CancelFunc\n\tpid     int\n}\n\nvar _ DatabaseServer = (*DoltServer)(nil)\n\nfunc NewDoltServer(doltBinExec, rootDir, configPath, logFilePath string, keepAlivePeriod time.Duration, database string) (*DoltServer, error) {\n\tif doltBinExec == \"\" {\n\t\treturn nil, errors.New(\"server: NewDoltServer: doltBinExec is required\")\n\t}\n\tif rootDir == \"\" {\n\t\treturn nil, errors.New(\"server: NewDoltServer: rootDir is required\")\n\t}\n\tif configPath == \"\" {\n\t\treturn nil, errors.New(\"server: NewDoltServer: configPath is required\")\n\t}\n\tabsDoltBinExec, err := filepath.Abs(doltBinExec)\n\tif err != nil {\n\t\treturn nil, errors.New(\"server: NewDoltServer: failed to determine absolute path of doltBinExec\")\n\t}\n\tabsRootDir, err := filepath.Abs(rootDir)\n\tif err != nil {\n\t\treturn nil, errors.New(\"server: NewDoltServer: failed to determine absolute path of rootDir\")\n\t}\n\tabsConfigPath, err := filepath.Abs(configPath)\n\tif err != nil {\n\t\treturn nil, errors.New(\"server: NewDoltServer: failed to determine absolute path of configPath\")\n\t}\n\tcfg, err := servercfg.YamlConfigFromFile(filesys.LocalFS, configPath)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"server: NewDoltServer: parse config %q: %w\", configPath, err)\n\t}\n\tvar logFile *os.File","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/dbproxy/server/doltserver.go#L53-L89","documentation":"NewDoltServer requires a non-empty configPath pointing at the Dolt server configuration (yaml) file. The backend is launched with this config; without it the server cannot be started, so the constructor rejects empty values up front.","triggerScenarios":"Calling server.NewDoltServer with an empty configPath — config file path never generated or not persisted in the workspace.","commonSituations":"First run where config generation step was skipped; corrupted workspace metadata; callers constructing the server directly without the normal startup pipeline that writes the config file.","solutions":["Generate/write the Dolt server config file in the workspace before constructing the server","Pass the correct path to the existing dolt_server.yaml/config file","Re-initialize the workspace so required metadata files are created"],"exampleFix":"// before\nsrv, err := server.NewDoltServer(bin, root, \"\", logPath, ka, db)\n// after\ncfgPath := filepath.Join(root, \".beads\", \"dolt_server.yaml\")\nif err := ensureDoltServerConfig(cfgPath); err != nil { return err }\nsrv, err := server.NewDoltServer(bin, root, cfgPath, logPath, ka, db)","handlingStrategy":"validation","validationCode":"if configPath == \"\" {\n    configPath = filepath.Join(rootDir, \".beads\", \"dolt_server.yaml\")\n}\nif _, err := os.Stat(configPath); err != nil {\n    return fmt.Errorf(\"server config missing: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"srv, err := server.NewDoltServer(doltBin, rootDir, configPath, logPath, ka, db)\nif err != nil && strings.Contains(err.Error(), \"configPath is required\") {\n    return fmt.Errorf(\"server config file path not set; re-initialize workspace: %w\", err)\n}","preventionTips":["Generate the Dolt server config file during workspace init","Default configPath to the workspace's standard metadata location when empty","Stat the config file before launching the backend"],"tags":["go","config","validation"],"backgroundTag":"missing-config-value","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}