{"record":{"id":"75697eec1d6a36ba","repo":"gastownhall/beads","slug":"uow-resolving-dolt-bin-exec-w","errorCode":null,"errorMessage":"uow: resolving dolt bin exec: %w","messagePattern":"uow: resolving dolt bin exec: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/uow/doltserver_provider.go","lineNumber":54,"sourceCode":"\t\treturn nil, fmt.Errorf(\"uow: database name must not be empty (caller should default to %q)\", \"beads\")\n\t}\n\tif err := backend.Validate(); err != nil {\n\t\treturn nil, fmt.Errorf(\"uow: backend: %w\", err)\n\t}\n\tif rootUser == \"\" {\n\t\treturn nil, fmt.Errorf(\"uow: rootUser must not be empty\")\n\t}\n\tif doltBinExec == \"\" {\n\t\treturn nil, fmt.Errorf(\"uow: doltBinExec must not be empty\")\n\t}\n\n\tabsServerRootDir, err := filepath.Abs(serverRootDir)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"uow: resolving server root dir: %w\", err)\n\t}\n\tabsDoltBinExec, err := filepath.Abs(doltBinExec)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"uow: resolving dolt bin exec: %w\", err)\n\t}\n\n\tif err := os.MkdirAll(absServerRootDir, config.BeadsDirPerm); err != nil {\n\t\treturn nil, fmt.Errorf(\"uow: creating server root directory: %w\", err)\n\t}\n\n\tep, err := proxy.GetCreateDatabaseProxyServerEndpoint(absServerRootDir, proxy.OpenOpts{\n\t\tBackend:        backend,\n\t\tConfigFilePath: serverConfigFilePath,\n\t\tLogFilePath:    serverLogFilePath,\n\t\tDoltBinPath:    absDoltBinExec,\n\t\tDatabase:       database,\n\t\tIdleTimeout:    idleTimeout,\n\t\tPort:           proxyPort,\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"uow: get proxy endpoint: %w\", err)\n\t}","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/uow/doltserver_provider.go#L36-L72","documentation":"filepath.Abs failed while converting doltBinExec to an absolute path. As with the server root dir, this only fails when the process cannot determine its current working directory. The binary path is absolutized so the proxy can exec it regardless of later cwd changes.","triggerScenarios":"Calling NewDoltServerUOWProvider with a relative doltBinExec while os.Getwd() fails due to a deleted or unreadable current directory.","commonSituations":"Same as the server-root-dir variant: deleted cwd in long-running daemons, container cleanup, or permission revocation.","solutions":["Pass an absolute path to the dolt binary (e.g. from exec.LookPath resolved against a valid cwd)","Ensure the process starts in an existing directory","Restore permissions on the cwd"],"exampleFix":"// before\nprov, err := NewDoltServerUOWProvider(..., \"./bin/dolt\", ...)\n// after\ndoltBin, err := filepath.Abs(\"./bin/dolt\")\nif err != nil { return err }\nprov, err := NewDoltServerUOWProvider(..., doltBin, ...)","handlingStrategy":"validation","validationCode":"if !filepath.IsAbs(doltBinExec) {\n    abs, err := filepath.Abs(doltBinExec)\n    if err != nil { return fmt.Errorf(\"cannot resolve dolt bin path (cwd unreadable?): %w\", err) }\n    doltBinExec = abs\n}","typeGuard":"func isUsableBinPath(p string) bool {\n    abs, err := filepath.Abs(p)\n    return err == nil && abs != \"\"\n}","tryCatchPattern":"prov, err := NewDoltServerUOWProvider(...)\nif err != nil && strings.Contains(err.Error(), \"resolving dolt bin exec\") {\n    os.Chdir(\"/\")\n    prov, err = NewDoltServerUOWProvider(...)\n}","preventionTips":["Resolve the dolt binary path to absolute at process startup","Store absolute paths in config files","Fail fast if os.Getwd() fails before constructing providers"],"tags":["filesystem","path","dolt"],"backgroundTag":"path-resolution-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}