{"record":{"id":"7cc7474808f5b0d4","repo":"t8y2/dbx","slug":"serialconsistency-must-be-serial-or-local-serial","errorCode":null,"errorMessage":"serialconsistency must be SERIAL or LOCAL_SERIAL","messagePattern":"serialconsistency must be SERIAL or LOCAL_SERIAL","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/cassandra-go/config.go","lineNumber":198,"sourceCode":"\t\t\tconfig.connectTimeout = duration\n\t\tcase \"protocolversion\", \"protoversion\":\n\t\t\tversion, err := strconv.Atoi(value)\n\t\t\tif err != nil || version < 3 || version > 5 {\n\t\t\t\treturn fmt.Errorf(\"protocolversion must be between 3 and 5\")\n\t\t\t}\n\t\t\tconfig.protocolVersion = version\n\t\tcase \"consistency\":\n\t\t\tif _, err := gocql.ParseConsistencyWrapper(value); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tconfig.consistency = value\n\t\tcase \"serialconsistency\":\n\t\t\tconsistency, err := gocql.ParseConsistencyWrapper(value)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif consistency != gocql.Serial && consistency != gocql.LocalSerial {\n\t\t\t\treturn fmt.Errorf(\"serialconsistency must be SERIAL or LOCAL_SERIAL\")\n\t\t\t}\n\t\t\tconfig.serialConsistency = value\n\t\tcase \"numconns\", \"connectionsperhost\":\n\t\t\tcount, err := strconv.Atoi(value)\n\t\t\tif err != nil || count < 1 || count > 32 {\n\t\t\t\treturn fmt.Errorf(\"numconns must be between 1 and 32\")\n\t\t\t}\n\t\t\tconfig.numConnections = count\n\t\tcase \"pagesize\", \"fetchsize\":\n\t\t\tsize, err := strconv.Atoi(value)\n\t\t\tif err != nil || size < 1 {\n\t\t\t\treturn fmt.Errorf(\"pagesize must be positive\")\n\t\t\t}\n\t\t\tconfig.pageSize = size\n\t\tcase \"cqlversion\":\n\t\t\tconfig.cqlVersion = value\n\t\tcase \"ssl\", \"enablessl\":\n\t\t\tenabled, err := strconv.ParseBool(value)","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/cassandra-go/config.go#L180-L216","documentation":"The 'serialconsistency' URL parameter is parsed with gocql.ParseConsistencyWrapper and must resolve to gocql.Serial or gocql.LocalSerial. Any other consistency level (e.g. QUORUM) or unparseable name yields this error, because serial consistency only accepts those two levels.","triggerScenarios":"serialconsistency=QUORUM, serialconsistency=serial (lowercase if the parser is case-sensitive), serialconsistency=ONE, or any invalid token in a cassandra:// URL.","commonSituations":"Confusing regular consistency with serial consistency (LWT/lightweight transactions), copying a normal consistency setting into the serialconsistency key, or case/whitespace mistakes like ' local_serial'.","solutions":["Set serialconsistency=SERIAL or serialconsistency=LOCAL_SERIAL exactly.","If you meant ordinary query consistency, use the consistency parameter instead.","Trim whitespace and fix casing in the URL query value."],"exampleFix":"// before\ncassandra://host:9042?serialconsistency=QUORUM\n// after\ncassandra://host:9042?serialconsistency=LOCAL_SERIAL","handlingStrategy":"validation","validationCode":"switch strings.ToUpper(serialCons) {\ncase \"SERIAL\", \"LOCAL_SERIAL\":\ndefault:\n\treturn fmt.Errorf(\"serialconsistency must be SERIAL or LOCAL_SERIAL, got %q\", serialCons)\n}","typeGuard":null,"tryCatchPattern":"cfg, err := parseCassandraConfig(dsn)\nif err != nil {\n\tif strings.Contains(err.Error(), \"serialconsistency must be SERIAL or LOCAL_SERIAL\") {\n\t\treturn fmt.Errorf(\"serialconsistency only accepts SERIAL/LOCAL_SERIAL; use 'consistency' for regular levels: %w\", err)\n\t}\n\treturn err\n}","preventionTips":["Only set serialconsistency for lightweight-transaction workloads","Use the 'consistency' parameter for normal consistency levels","Uppercase-normalize the value before embedding it in the DSN"],"tags":["cassandra","config","consistency","validation"],"backgroundTag":"invalid-consistency-level","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"}