{"record":{"id":"ad35723d2047b1b8","repo":"gastownhall/beads","slug":"dolt-shared-server-must-be-true-or-false-got","errorCode":null,"errorMessage":"dolt.shared-server must be \"true\" or \"false\", got %q","messagePattern":"dolt\\.shared-server must be \"true\" or \"false\", got %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/config/yaml_config.go","lineNumber":891,"sourceCode":"}\n\n// validateYamlConfigValue validates a configuration value before setting.\n// Returns an error if the value is invalid for the given key.\nfunc validateYamlConfigValue(key, value string) error {\n\tswitch key {\n\tcase \"hierarchy.max-depth\":\n\t\t// Must be a positive integer >= 1 (GH#995)\n\t\tdepth, err := strconv.Atoi(value)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"hierarchy.max-depth must be a positive integer, got %q\", value)\n\t\t}\n\t\tif depth < 1 {\n\t\t\treturn fmt.Errorf(\"hierarchy.max-depth must be at least 1, got %d\", depth)\n\t\t}\n\tcase \"dolt.shared-server\":\n\t\tlower := strings.ToLower(value)\n\t\tif lower != \"true\" && lower != \"false\" {\n\t\t\treturn fmt.Errorf(\"dolt.shared-server must be \\\"true\\\" or \\\"false\\\", got %q\", value)\n\t\t}\n\tcase \"dolt.debug\":\n\t\tlower := strings.ToLower(value)\n\t\tif lower != \"true\" && lower != \"false\" {\n\t\t\treturn fmt.Errorf(\"dolt.debug must be \\\"true\\\" or \\\"false\\\", got %q\", value)\n\t\t}\n\tcase \"dolt.mode\":\n\t\tlower := strings.ToLower(value)\n\t\tif lower != \"server\" && lower != \"embedded\" {\n\t\t\treturn fmt.Errorf(\"dolt.mode must be \\\"server\\\" or \\\"embedded\\\", got %q\", value)\n\t\t}\n\tcase \"prime.max-memories\":\n\t\tn, err := strconv.Atoi(value)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"prime.max-memories must be a non-negative integer (0 = unlimited), got %q\", value)\n\t\t}\n\t\tif n < 0 {\n\t\t\treturn fmt.Errorf(\"prime.max-memories must be a non-negative integer (0 = unlimited), got %q\", value)","sourceCodeStart":873,"sourceCodeEnd":909,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/config/yaml_config.go#L873-L909","documentation":"validateYamlConfigValue rejects a dolt.shared-server value that is not \"true\" or \"false\" (case-insensitive). The %q shows the rejected string. bd throws it because the key is stored as a string and later read as a strict boolean; anything else would silently misbehave.","triggerScenarios":"SetYamlConfig / SetYamlConfigInDir / SetUserYamlConfig with key \"dolt.shared-server\" and values like \"yes\", \"1\", \"on\", \"TRUE \" (trailing space), or empty string.","commonSituations":"Using YAML-style 'yes'/'no'; shell scripts passing 1/0; copy-pasting values with trailing whitespace or quotes from docs.","solutions":["Set an explicit boolean string: bd config set dolt.shared-server true (or false)","Normalize yes/no and 1/0 to true/false in scripts before calling","Trim whitespace and surrounding quotes from the value","Note case-insensitivity: True/FALSE are accepted; 'yes'/'on' are not"],"exampleFix":"// before\nSetYamlConfig(\"dolt.shared-server\", \"yes\") // error\n// after\nSetYamlConfig(\"dolt.shared-server\", \"true\")","handlingStrategy":"validation","validationCode":"l := strings.ToLower(strings.TrimSpace(v))\nif l != \"true\" && l != \"false\" {\n    return fmt.Errorf(\"dolt.shared-server must be true or false, got %q\", v)\n}","typeGuard":"func isBoolString(s string) bool {\n    switch strings.ToLower(strings.TrimSpace(s)) {\n    case \"true\", \"false\":\n        return true\n    }\n    return false\n}","tryCatchPattern":"if err := SetYamlConfig(\"dolt.shared-server\", v); err != nil {\n    if strings.Contains(err.Error(), \"dolt.shared-server must be\") {\n        // normalize yes/1/on -> true, no/0/off -> false, retry\n    }\n    return err\n}","preventionTips":["Normalize yes/no and 1/0 inputs to true/false before setting","Trim whitespace and quotes from values coming from flags or env vars","Prefer boolean-typed CLI flags that serialize to true/false"],"tags":["config","validation","boolean","go"],"backgroundTag":"config-value-validation-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}