{"record":{"id":"01a31743b4a566b0","repo":"gastownhall/beads","slug":"uow-backend-w","errorCode":null,"errorMessage":"uow: backend: %w","messagePattern":"uow: backend: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/uow/doltserver_provider.go","lineNumber":39,"sourceCode":"\tserverConfigFilePath string,\n\tbackend proxy.Backend,\n\trootUser string,\n\trootPassword string,\n\tdoltBinExec string,\n\tproxyPort int,\n\tidleTimeout time.Duration,\n\tteamServer bool,\n\texpectedProjectID string,\n\topts ...ProviderOption,\n) (UnitOfWorkProvider, error) {\n\tif idleTimeout == 0 {\n\t\tidleTimeout = defaultProxyIdleTimeout\n\t}\n\tif database == \"\" {\n\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 {","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/uow/doltserver_provider.go#L21-L57","documentation":"The proxy.Backend value passed to NewDoltServerUOWProvider failed its own Validate() check. The backend describes which Dolt server backend mode to use (e.g. how the server is launched); an invalid or zero-value backend cannot be used to build the proxy endpoint. The underlying Validate error is wrapped for detail.","triggerScenarios":"Calling NewDoltServerUOWProvider with a zero-value proxy.Backend, a backend constructed from an unsupported string/enum, or a Backend whose Validate() rejects the combination of fields.","commonSituations":"Config parsing produced an unknown backend name; a struct literal Backend{} was passed without setting the kind; switching backend types after a version change left the old value invalid.","solutions":["Inspect the wrapped message after 'uow: backend:' for the exact validation failure","Use a recognized backend constant/constructor from the proxy package instead of a raw literal","Fix the config source so it emits a supported backend name","Upgrade/downgrade consistently so backend enum values match the library version"],"exampleFix":"// before\nbackend := proxy.Backend{} // zero value, fails Validate\n// after\nbackend, err := proxy.BackendFromString(\"embedded\")\nif err != nil { return err }","handlingStrategy":"validation","validationCode":"func validateBackend(b proxy.Backend) error {\n    if err := b.Validate(); err != nil {\n        return fmt.Errorf(\"backend invalid before provider call: %w\", err)\n    }\n    return nil\n}","typeGuard":"func backendIsValid(b proxy.Backend) bool { return b.Validate() == nil }","tryCatchPattern":"if err := backend.Validate(); err != nil { return fmt.Errorf(\"config: %w\", err) }\nprov, err := NewDoltServerUOWProvider(...)\nif err != nil && strings.Contains(err.Error(), \"uow: backend:\") {\n    return fmt.Errorf(\"unsupported backend: %w\", err)\n}","preventionTips":["Construct backends only via the proxy package's constructors/constants","Validate config enum fields at load time","Add a config schema check that whitelists supported backend names"],"tags":["validation","config","backend"],"backgroundTag":"invalid-config-value","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}