{"record":{"id":"968317fad350265f","repo":"apache/cassandra","slug":"unhandled-record-type-type","errorCode":null,"errorMessage":"Unhandled record type: ${type}","messagePattern":"Unhandled record type: (.+?)","errorType":"exception","errorClass":"IORuntimeException","httpStatus":null,"severity":"error","filePath":"tools/fqltool/src/org/apache/cassandra/fqltool/FQLQueryReader.java","lineNumber":116,"sourceCode":"                    int numSubValues = in.int32();\n                    for (int zz = 0; zz < numSubValues; zz++)\n                    {\n                        byte[] valueBytes = in.bytes();\n                        subValues.add(valueBytes == null ? null : ByteBuffer.wrap(valueBytes));\n                    }\n                }\n                query = new FQLQuery.Batch(keyspace,\n                                           protocolVersion,\n                                           queryOptions,\n                                           queryStartTime,\n                                           generatedTimestamp,\n                                           generatedNowInSeconds,\n                                           batchType,\n                                           queries,\n                                           values);\n                break;\n            default:\n                throw new IORuntimeException(\"Unhandled record type: \" + type);\n        }\n    }\n\n    private void verifyVersion(WireIn wireIn)\n    {\n        int version = wireIn.read(VERSION).int16();\n\n        if (version > CURRENT_VERSION)\n        {\n            throw new IORuntimeException(\"Unsupported record version [\" + version\n                                         + \"] - highest supported version is [\" + CURRENT_VERSION + ']');\n        }\n    }\n\n    private String readType(WireIn wireIn) throws IORuntimeException\n    {\n        String type = wireIn.read(TYPE).text();\n        if (!SINGLE_QUERY.equals(type) && !BATCH.equals(type))","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/tools/fqltool/src/org/apache/cassandra/fqltool/FQLQueryReader.java#L98-L134","documentation":"FQLQueryReader.readMarshallable deserializes a full-query-log record from a Chronicle Wire binary log. After reading the record's type field it switches on a numeric record type code; if the code matches none of the known cases it throws this IORuntimeException. This guards the reader against log records written in a format it does not understand.","triggerScenarios":"Calling readMarshallable (directly or via Chronicle Wire when reading a binlog file) on a record whose numeric type code does not match any handled case in the switch.","commonSituations":"Replaying a log file produced by a newer Cassandra version that introduced a new record type; corrupt or truncated log data misaligning the type field; pointing the replayer at a file that is not a full query log.","solutions":["Upgrade the fqltool / Cassandra version to one matching the version that wrote the log file","Verify the file is a genuine full-query-log produced by BinLog/FullQueryLogger","Check for file corruption or truncation and re-capture the query log"],"exampleFix":"// before: replaying a log from a newer Cassandra\nfqltool replay --log_path /var/log/cassandra/dump.bin ...\n// after: upgrade fqltool to match the writer version, or re-capture with the current version","handlingStrategy":"try-catch","validationCode":"File logFile = new File(path);\nif (!logFile.isFile() || logFile.length() == 0) throw new IllegalArgumentException(\"not a FQL log: \" + path);","typeGuard":null,"tryCatchPattern":"try { reader.readMarshallable(wireIn); } catch (IORuntimeException e) { if (e.getMessage().startsWith(\"Unhandled record type\")) { skipRecord(); } else throw e; }","preventionTips":["Keep fqltool and Cassandra versions in lockstep","Only feed FQL binlog files to the reader","Detect corruption early with checksums on stored logs"],"tags":["serialization","deserialization","compatibility"],"backgroundTag":"invalid-enum-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}