{"record":{"id":"78b7444e4f480593","repo":"t8y2/dbx","slug":"invalid-s-expected-boolean","errorCode":null,"errorMessage":"invalid %s: expected boolean","messagePattern":"invalid (.+?): expected boolean","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config_file.go","lineNumber":435,"sourceCode":"\treturn value, true, nil\n}\n\nfunc hoconBool(config *hocon.Config, path string) (bool, bool, error) {\n\tvalue := config.Get(path)\n\tif value == nil {\n\t\treturn false, false, nil\n\t}\n\tswitch typed := value.(type) {\n\tcase hocon.Boolean:\n\t\treturn bool(typed), true, nil\n\tcase hocon.String:\n\t\tparsed, err := strconv.ParseBool(string(typed))\n\t\tif err != nil {\n\t\t\treturn false, false, fmt.Errorf(\"invalid %s: %w\", path, err)\n\t\t}\n\t\treturn parsed, true, nil\n\tdefault:\n\t\treturn false, false, fmt.Errorf(\"invalid %s: expected boolean\", path)\n\t}\n}\n\nfunc firstHOCONBool(config *hocon.Config, paths ...string) (bool, bool, error) {\n\tfor _, path := range paths {\n\t\tvalue, ok, err := hoconBool(config, path)\n\t\tif err != nil || ok {\n\t\t\treturn value, ok, err\n\t\t}\n\t}\n\treturn false, false, nil\n}\n\nfunc hoconProtocolVersion(config *hocon.Config, path string) (int, bool, error) {\n\tvalue := config.Get(path)\n\tif value == nil {\n\t\treturn 0, false, nil\n\t}","sourceCodeStart":417,"sourceCodeEnd":453,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config_file.go#L417-L453","documentation":"hoconBool throws this when the value at the config path exists but is neither a hocon.Boolean nor a hocon.String — i.e. it is some other HOCON type such as a number, object, or array. The driver only coerces booleans and boolean-like strings.","triggerScenarios":"applyJavaDriverHOCON, applyHOCONSSL, applyNativeHOCON, or firstHOCONBool encountering a boolean key whose value is a number (e.g. `2`), a nested object, or an array.","commonSituations":"Accidentally nesting config keys so a boolean path resolves to an object, or setting a numeric flag expecting truthiness semantics.","solutions":["Inspect the value at the reported path and replace it with a boolean literal `true`/`false`.","If an object was accidentally nested there, fix the indentation/bracing so the key points at a scalar.","Replace numeric truthy values (`1`) with explicit booleans."],"exampleFix":"// before\nreconnect = {\n  enabled = true\n}\n\n// after\nreconnect = true","handlingStrategy":"validation","validationCode":"func ensureScalarBoolPath(cfg *hocon.Config, path string) error {\n    v := cfg.Get(path)\n    if v == nil {\n        return nil\n    }\n    switch v.(type) {\n    case hocon.Boolean, hocon.String:\n        return nil\n    default:\n        return fmt.Errorf(\"%s resolves to a non-scalar (%T); it must point at a boolean\", path, v)\n    }\n}","typeGuard":"func isBoolOrBoolString(v interface{}) bool {\n    switch t := v.(type) {\n    case hocon.Boolean:\n        return true\n    case hocon.String:\n        _, err := strconv.ParseBool(string(t))\n        return err == nil\n    default:\n        return false\n    }\n}","tryCatchPattern":"if _, ok, err := hoconBool(cfg, path); err != nil {\n    return fmt.Errorf(\"%s must be a boolean scalar; check for accidental nesting: %w\", path, err)\n}","preventionTips":["Check HOCON brace placement so boolean keys are not accidentally nested objects.","Avoid HOCON object merges that replace a scalar with a block.","Keep one key per scalar; do not merge multiple config fragments blindly."],"tags":["configuration","hocon","boolean","type-mismatch"],"backgroundTag":"invalid-config-value","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}