{"record":{"id":"316ff3bf15884ed6","repo":"multica-ai/multica","slug":"s-must-be-true-or-false-got-q","errorCode":null,"errorMessage":"%s must be 'true' or 'false' (got %q)","messagePattern":"(.+?) must be 'true' or 'false' \\(got %q\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_config.go","lineNumber":266,"sourceCode":"\t\tif err := assignBool(&cfg.DisableAutoReload, key, value); err != nil {\n\t\t\treturn err\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown config key %q (supported: %s)\", key, joinKeys(configSetSupportedKeys))\n\t}\n\treturn nil\n}\n\n// assignBool parses value as a strict bool into dst. Shared by the\n// disable_* toggles. Empty string clears the field (false).\nfunc assignBool(dst *bool, key, value string) error {\n\tif value == \"\" {\n\t\t*dst = false\n\t\treturn nil\n\t}\n\tb, err := strconv.ParseBool(value)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"%s must be 'true' or 'false' (got %q)\", key, value)\n\t}\n\t*dst = b\n\treturn nil\n}\n\n// assignPositiveDuration parses value as a strictly-positive Go duration\n// and writes the raw string into dst. Shared by every persisted daemon\n// duration knob except agent_timeout, whose zero value is meaningful.\n// Empty string clears the field.\nfunc assignPositiveDuration(dst *string, key, value string) error {\n\tif value == \"\" {\n\t\t*dst = \"\"\n\t\treturn nil\n\t}\n\tnormalized := strings.TrimSpace(value)\n\td, err := time.ParseDuration(normalized)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"%s must be a Go duration (e.g. 10s, 500ms): %w\", key, err)","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_config.go#L248-L284","documentation":"assignBool, shared by the disable_* toggles (disable_auto_update, disable_auto_reload), parses the value with strconv.ParseBool. It accepts true/false (and 1/0/t/f), but the error message advertises the strict 'true'/'false' contract. Empty string is handled before parsing as 'clear (false)'.","triggerScenarios":"`multica config set disable_auto_update yes`, `... on`, `... True ` with whitespace, or `... enable`.","commonSituations":"YAML/JSON muscle memory ('enable: true'); shells passing unquoted values with spaces; Ansible-style 'yes/no' booleans.","solutions":["Use literal true or false: `multica config set disable_auto_update true`.","Quote the value and strip spaces in scripts: `-- ... \"$(echo \"$VAL\" | tr -d ' ')\"`.","To clear the toggle back to false: pass an empty string."],"exampleFix":"# before\nmultica config set disable_auto_update yes\n# after\nmultica config set disable_auto_update true","handlingStrategy":"validation","validationCode":"# normalize booleans before config set\ncase \"${VAL,,}\" in true|1) VAL=true ;; false|0) VAL=false ;; *) echo \"bool must be true/false\" >&2; exit 2 ;; esac\nmultica config set disable_auto_update \"$VAL\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass literal true/false to disable_* toggles.","If values come from YAML/Ansible, map yes/no/on/off to true/false in a preflight step."],"tags":["cli","config","validation","boolean","go"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}