multica-ai/multica · error
value is not a valid bool (expected true or false)
Error message
value %q is not a valid bool (expected true or false)
What it means
Strict boolean validation in parseMetadataValue when --type bool is forced: the raw text is not exactly the literal "true" or "false" (case-sensitive), so values like "True", "1", or "yes" are rejected. Like the number branch, this guards against emitting invalid JSON since the text is passed through verbatim as the JSON payload.
Solutions
- Pass true or false for the value.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at server/cmd/multica/cmd_issue_metadata.go:143 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15).
Data as JSON: /api/errors/0e73728a2ac9ca25.
Report an issue: GitHub.
Appendix: source
Thrown at server/cmd/multica/cmd_issue_metadata.go:143
// forcedType non-empty overrides sniffing: "string" wraps verbatim as a
// JSON string; "number" parses strictly as a number; "bool" requires the
// literal text "true" or "false".
func parseMetadataValue(raw, forcedType string) (json.RawMessage, error) {
switch forcedType {
case "string":
buf, err := json.Marshal(raw)
if err != nil {
return nil, fmt.Errorf("encode string value: %w", err)
}
return buf, nil
case "number":
if _, err := strconv.ParseFloat(raw, 64); err != nil {
return nil, fmt.Errorf("value %q is not a valid number", raw)
}
return json.RawMessage(raw), nil
case "bool":
if raw != "true" && raw != "false" {
return nil, fmt.Errorf("value %q is not a valid bool (expected true or false)", raw)
}
return json.RawMessage(raw), nil
case "":
// auto-infer below
default:
return nil, fmt.Errorf("unknown --type %q (expected string, number, or bool)", forcedType)
}
// Auto-infer: try JSON parse, fall back to string.
var v any
if err := json.Unmarshal([]byte(raw), &v); err == nil {
switch v.(type) {
case string, bool, float64:
return json.RawMessage(raw), nil
}
}
buf, err := json.Marshal(raw)
if err != nil {View on GitHub (pinned to 2c0912b6ec)