{"record":{"id":"4a9509a9799d545a","repo":"t8y2/dbx","slug":"invalid-s-w","errorCode":null,"errorMessage":"invalid %s: %w","messagePattern":"invalid (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config_file.go","lineNumber":372,"sourceCode":"\t\t}\n\t\tvalue, err = url.PathUnescape(parsed.Path)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif runtime.GOOS == \"windows\" && len(value) >= 3 && value[0] == '/' && value[2] == ':' {\n\t\t\tvalue = value[1:]\n\t\t}\n\t}\n\treturn filepath.Clean(filepath.FromSlash(value)), nil\n}\n\nfunc hoconString(config *hocon.Config, path string) (string, bool, error) {\n\tif config.Get(path) == nil {\n\t\treturn \"\", false, nil\n\t}\n\tvalue, err := config.GetStringE(path)\n\tif err != nil {\n\t\treturn \"\", false, fmt.Errorf(\"invalid %s: %w\", path, err)\n\t}\n\treturn strings.TrimSpace(value), true, nil\n}\n\nfunc firstHOCONString(config *hocon.Config, paths ...string) (string, bool, error) {\n\tfor _, path := range paths {\n\t\tvalue, ok, err := hoconString(config, path)\n\t\tif err != nil || ok {\n\t\t\treturn value, ok, err\n\t\t}\n\t}\n\treturn \"\", false, nil\n}\n\nfunc hoconStringMap(config *hocon.Config, path string) (map[string]string, bool, error) {\n\tif config.Get(path) == nil {\n\t\treturn nil, false, nil\n\t}","sourceCodeStart":354,"sourceCodeEnd":390,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config_file.go#L354-L390","documentation":"hoconString (config_file.go:372) wraps any error from the HOCON library's GetStringE as `invalid <path>: <cause>`. This means the key exists at the given HOCON path but cannot be coerced to a string (e.g. it is an object, array, or a value type the resolver rejects). It is returned by the applyHOCON* functions while reading the Java-driver or native Cassandra config file.","triggerScenarios":"A config file key that applyJavaDriverHOCON/applyHOCONSSL/applyHOCONAuthentication/applyNativeHOCON reads via hoconString (e.g. basic.application.name, advanced.auth-provider.class, tls.ca-cert-path) is set to a non-string HOCON value such as a nested object `foo { bar = 1 }`, an array `[a,b]`, or an unparseable substitution.","commonSituations":"Indentation mistakes turning a scalar into an object (child keys accidentally nested under the option); YAML-style lists pasted into a HOCON string field; unresolved `${...}` substitutions raising errors inside the HOCON resolver.","solutions":["Read the wrapped cause after 'invalid <path>:' to find the underlying HOCON error and line.","Open the config file at the reported path and ensure the value is a quoted or bare scalar string, not an object or array.","Fix indentation so child keys are not nested beneath the string option.","If a `${substitution}` is involved, define the substitution or escape it (`${?var}` optional syntax) so HOCON can resolve it."],"exampleFix":"// before (application.conf)\ndatastax-java-driver {\n  basic.application.name {\n    name = cassandra-client   # object where a string was expected\n  }\n}\n// after\ndatastax-java-driver {\n  basic.application.name = cassandra-client\n}","handlingStrategy":"validation","validationCode":"func preflightHoconStrings(path string, keys []string) error {\n    cfg, err := hocon.ParseFile(path)\n    if err != nil {\n        return err\n    }\n    for _, k := range keys {\n        if cfg.Get(k) == nil {\n            continue\n        }\n        if _, err := cfg.GetStringE(k); err != nil {\n            return fmt.Errorf(\"%s must be a scalar string in %s: %w\", k, path, err)\n        }\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if err := applyCassandraConfigFile(cfgPath); err != nil {\n    if strings.HasPrefix(err.Error(), \"invalid \") {\n        var path, cause string\n        fmt.Sscanf(err.Error(), \"invalid %s\", &path)\n        log.Fatalf(\"key %s in %s is not a string: %v — check nesting, arrays, and ${substitutions}\", path, cfgPath, err)\n    }\n    return err\n}","preventionTips":["Quote string values in HOCON to avoid accidental object/array typing.","Check indentation: child keys under an option turn it into an object.","Resolve or escape ${substitutions} before shipping the config.","Parse the config in CI to catch type errors before deployment."],"tags":["hocon","config-parse","type-mismatch","cassandra"],"backgroundTag":"config-parse-error","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}