{"record":{"id":"f271000f09e3cc86","repo":"gastownhall/beads","slug":"unknown-backend-q-want-one-of-s","errorCode":null,"errorMessage":"unknown backend %q (want one of: %s)","messagePattern":"unknown backend %q \\(want one of: (.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/storage/dbproxy/proxy/backend.go","lineNumber":48,"sourceCode":"\n// Valid reports whether b is one of the recognized constants.\nfunc (b Backend) Valid() bool {\n\tfor _, k := range knownBackends {\n\t\tif b == k {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// Validate returns nil if b is non-empty and recognized; otherwise it\n// returns a descriptive error listing the supported set.\nfunc (b Backend) Validate() error {\n\tif b == \"\" {\n\t\treturn errors.New(\"backend must be set\")\n\t}\n\tif !b.Valid() {\n\t\treturn fmt.Errorf(\"unknown backend %q (want one of: %s)\", string(b), strings.Join(KnownBackendNames(), \", \"))\n\t}\n\treturn nil\n}\n\n// KnownBackendNames returns the recognized backend identifiers as strings,\n// in display order. Useful for CLI help text and validation error messages.\nfunc KnownBackendNames() []string {\n\tout := make([]string, len(knownBackends))\n\tfor i, k := range knownBackends {\n\t\tout[i] = string(k)\n\t}\n\treturn out\n}\n","sourceCodeStart":30,"sourceCodeEnd":62,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/storage/dbproxy/proxy/backend.go#L30-L62","documentation":"Backend.Validate checks that a Backend string is non-empty and one of the recognized constants: external, local-server, local-shared-server. This error is returned when the value is set but not recognized, listing the valid set. The library throws it because the proxy dispatches to a concrete DatabaseServer by backend name and cannot dispatch an unknown value.","triggerScenarios":"Calling Backend.Validate (directly or via NewDoltServerUOWProvider) with a backend string that is not one of external/local-server/local-shared-server — e.g. a misspelled value, wrong casing (Local-Server), a deprecated backend name from an older version, or a --backend flag passed an unsupported value.","commonSituations":"Typo in config file or CLI flag (--backend=dolt instead of local-server), config written for an older beads version using a since-renamed backend name, case-sensitivity mistakes, or hand-edited YAML/JSON with an invalid enum value.","solutions":["Set the backend to one of the listed valid values: external, local-server, or local-shared-server (exact spelling, lowercase)","Check the exact %q value in the error message against your flag/config for typos and casing","Check your beads version's supported backends (bd --help / KnownBackendNames) if upgrading from an older release","Remove stale config keys that override the backend with an old value"],"exampleFix":"// before\nb := proxy.Backend(\"dolt\")\nif err := b.Validate(); err != nil { ... } // unknown backend \"dolt\"\n// after\nb := proxy.Backend(\"local-server\")\nif err := b.Validate(); err != nil { ... }","handlingStrategy":"validation","validationCode":"b := proxy.Backend(cfg.Backend)\nif !b.Valid() {\n    return fmt.Errorf(\"invalid backend %q (want one of: %s)\",\n        string(b), strings.Join(proxy.KnownBackendNames(), \", \"))\n}","typeGuard":"func validBackend(s string) (proxy.Backend, bool) {\n    b := proxy.Backend(s)\n    return b, b.Valid()\n}","tryCatchPattern":"if err := backend.Validate(); err != nil {\n    // list the accepted values in your own message so users can self-correct\n    return fmt.Errorf(\"--backend flag invalid: %w\", err)\n}","preventionTips":["Only assign Backend values from the package constants, never raw strings","Validate the backend string at config-load time, before spawning the proxy","Keep flags/config for backend lowercase-hyphenated exactly as listed","After upgrades, re-check deprecated backend names against KnownBackendNames()"],"tags":["go","configuration","validation","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}