{"record":{"id":"2f0c9f338682d031","repo":"t8y2/dbx","slug":"serial-consistency-must-be-serial-or-local-serial","errorCode":null,"errorMessage":"serial consistency must be SERIAL or LOCAL_SERIAL","messagePattern":"serial consistency must be SERIAL or LOCAL_SERIAL","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config_file.go","lineNumber":71,"sourceCode":"\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}\n\tif value, ok, err := hoconString(parsed, javaDriverConfigPrefix+\"basic.request.serial-consistency\"); err != nil {\n\t\treturn err\n\t} else if ok {\n\t\tconsistency, err := gocql.ParseConsistencyWrapper(value)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif consistency != gocql.Serial && consistency != gocql.LocalSerial {\n\t\t\treturn fmt.Errorf(\"serial consistency must be SERIAL or LOCAL_SERIAL\")\n\t\t}\n\t\tconfig.serialConsistency = value\n\t}\n\tif value, ok, err := hoconInt(parsed, javaDriverConfigPrefix+\"basic.request.page-size\"); err != nil {\n\t\treturn err\n\t} else if ok {\n\t\tif value < 1 {\n\t\t\treturn fmt.Errorf(\"page size must be positive\")\n\t\t}\n\t\tconfig.pageSize = value\n\t}\n\tif value, ok, err := hoconString(parsed, javaDriverConfigPrefix+\"basic.load-balancing-policy.local-datacenter\"); err != nil {\n\t\treturn err\n\t} else if ok {\n\t\tconfig.localDatacenter = value\n\t}\n\tif value, ok, err := hoconString(parsed, javaDriverConfigPrefix+\"basic.load-balancing-policy.class\"); err != nil {\n\t\treturn err","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config_file.go#L53-L89","documentation":"The serial-consistency value parsed as a valid gocql consistency but is not one of the two legal serial consistencies (SERIAL or LOCAL_SERIAL). Ordinary consistencies like QUORUM are rejected for serial operations because C* only permits SERIAL/LOCAL_SERIAL there.","triggerScenarios":"Setting datastax-java-driver.basic.request.serial-consistency (via applyJavaDriverHOCON) to a value that ParseConsistencyWrapper accepts but is not Serial/LocalSerial, e.g. 'QUORUM' or 'ONE'.","commonSituations":"Confusing regular consistency with serial consistency in config; copying consistency settings from another driver section; defaults inherited from a template using QUORUM.","solutions":["Set serial-consistency to exactly 'SERIAL' or 'LOCAL_SERIAL'","If you intended regular request consistency, set basic.request.consistency instead","Remove the key to use the driver default (SERIAL)"],"exampleFix":"// before\ndatastax-java-driver { basic { request.serial-consistency = \"QUORUM\" } }\n// after\ndatastax-java-driver { basic { request.serial-consistency = \"LOCAL_SERIAL\" } }","handlingStrategy":"validation","validationCode":"sc := strings.ToUpper(cfg.SerialConsistency)\nif sc != \"\" && sc != \"SERIAL\" && sc != \"LOCAL_SERIAL\" {\n    return fmt.Errorf(\"serial-consistency must be SERIAL or LOCAL_SERIAL, got %q\", cfg.SerialConsistency)\n}","typeGuard":"func isSerialConsistency(v string) bool {\n    switch strings.ToUpper(v) { case \"SERIAL\", \"LOCAL_SERIAL\": return true }\n    return false\n}","tryCatchPattern":"if err := parseCassandraConfig(raw); err != nil {\n    if strings.Contains(err.Error(), \"serial consistency must be SERIAL or LOCAL_SERIAL\") {\n        return fmt.Errorf(\"set basic.request.serial-consistency to SERIAL or LOCAL_SERIAL: %w\", err)\n    }\n    return err\n}","preventionTips":["Only ever configure SERIAL or LOCAL_SERIAL for serial-consistency","Use basic.request.consistency for regular consistencies like QUORUM","Validate consistency values in config linting before deploy"],"tags":["cassandra","config","consistency","validation"],"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-14T05:17:10.506Z"}