{"record":{"id":"3078415df3361206","repo":"t8y2/dbx","slug":"apply-cassandra-configfile-s-w","errorCode":null,"errorMessage":"apply Cassandra configfile %s: %w","messagePattern":"apply Cassandra configfile (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config_file.go","lineNumber":44,"sourceCode":"\t\treturn nil\n\t}\n\tinfo, err := os.Stat(path)\n\tif err != nil {\n\t\tif errors.Is(err, os.ErrNotExist) {\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"read Cassandra configfile %s: %w\", path, err)\n\t}\n\tif !info.Mode().IsRegular() {\n\t\treturn fmt.Errorf(\"Cassandra configfile is not a regular file: %s\", path)\n\t}\n\tparsed, err := hocon.ParseResource(path)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"parse Cassandra configfile %s: %w\", path, err)\n\t}\n\tconfig.configFile = path\n\tif err := applyJavaDriverHOCON(config, parsed); err != nil {\n\t\treturn fmt.Errorf(\"apply Cassandra configfile %s: %w\", path, err)\n\t}\n\treturn nil\n}\n\nfunc applyJavaDriverHOCON(config *cassandraConfig, parsed *hocon.Config) error {\n\tif value, ok, err := hoconDuration(parsed, javaDriverConfigPrefix+\"basic.request.timeout\"); err != nil {\n\t\treturn err\n\t} else if ok {\n\t\tconfig.requestTimeout = value\n\t}\n\tif value, ok, err := hoconString(parsed, javaDriverConfigPrefix+\"basic.request.consistency\"); err != nil {\n\t\treturn err\n\t} else if ok {\n\t\tif _, err := gocql.ParseConsistencyWrapper(value); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tconfig.consistency = value\n\t}","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config_file.go#L26-L62","documentation":"The file parsed as HOCON successfully, but applying the datastax-java-driver settings to the internal cassandraConfig failed inside applyJavaDriverHOCON. The wrapped error carries the specific semantic problem (e.g. bad duration/int value, invalid consistency name).","triggerScenarios":"A HOCON key like datastax-java-driver.basic.request.timeout holds a value that cannot be converted (non-numeric duration, invalid consistency string, out-of-range page-size).","commonSituations":"Values written in Java-driver formats this Go wrapper doesn't accept (e.g. '10 seconds' vs '10s'); typo'd consistency names; setting serial-consistency to a non-SERIAL value.","solutions":["Read the wrapped cause to find the exact offending key and value","Correct the value format (durations like '5s', integers without units)","Remove unsupported/optional keys until the config applies cleanly","Test the file with a minimal config first, then add keys back incrementally"],"exampleFix":"// before\ndatastax-java-driver { basic { request.timeout = 10 seconds } }\n// after\ndatastax-java-driver { basic { request.timeout = \"10s\" } }","handlingStrategy":"validation","validationCode":"parsed, err := hocon.ParseResource(cfg.ConfigFile)\nif err == nil {\n    if _, err := parsed.GetDuration(\"datastax-java-driver.basic.request.timeout\"); err != nil {\n        return fmt.Errorf(\"bad request.timeout: %w\", err)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := parseCassandraConfig(raw); err != nil {\n    if strings.Contains(err.Error(), \"apply Cassandra configfile\") {\n        return fmt.Errorf(\"a datastax-java-driver.* value is semantically invalid, fix the wrapped key: %w\", err)\n    }\n    return err\n}","preventionTips":["Use driver-accepted value formats (e.g. \"10s\", plain integers)","Test config files against a minimal agent run before rolling out","Keep a documented example of every supported datastax-java-driver key"],"tags":["cassandra","config","hocon","validation"],"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"}