{"record":{"id":"949455aa14b10dd8","repo":"provectus/kafka-ui","slug":"unrecognized-version-version","errorCode":null,"errorMessage":"Unrecognized version: ${version}","messagePattern":"Unrecognized version: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"kafka-ui-api/src/main/java/com/provectus/kafka/ui/serdes/builtin/ConsumerOffsetsSerde.java","lineNumber":278,"sourceCode":"            Field.TaggedFieldsSection.of()\n        );\n\n    return (headers, data) -> {\n      String result;\n      var bb = ByteBuffer.wrap(data);\n      short version = bb.getShort();\n      // ideally, we should distinguish if value is commit or metadata\n      // by checking record's key, but our current serde structure doesn't allow that.\n      // so, we are trying to parse into metadata first and after into commit msg\n      try {\n        result = toJson(\n            switch (version) {\n              case 0 -> metadataSchema0.read(bb);\n              case 1 -> metadataSchema1.read(bb);\n              case 2 -> metadataSchema2.read(bb);\n              case 3 -> metadataSchema3.read(bb);\n              case 4 -> metadataSchema4.read(bb);\n              default -> throw new IllegalArgumentException(\"Unrecognized version: \" + version);\n            }\n        );\n      } catch (Throwable e) {\n        bb = bb.rewind();\n        bb.getShort(); // skipping version\n        result = toJson(\n            switch (version) {\n              case 0 -> commitOffsetSchemaV0.read(bb);\n              case 1 -> commitOffsetSchemaV1.read(bb);\n              case 2 -> commitOffsetSchemaV2.read(bb);\n              case 3 -> commitOffsetSchemaV3.read(bb);\n              case 4 -> commitOffsetSchemaV4.read(bb);\n              default -> throw new IllegalArgumentException(\"Unrecognized version: \" + version);\n            }\n        );\n      }\n\n      if (bb.remaining() != 0) {","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/provectus/kafka-ui/blob/83b5a60cc08501b570a0c4d0b4cdfceb1b88d6b7/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serdes/builtin/ConsumerOffsetsSerde.java#L260-L296","documentation":"ConsumerOffsetsSerde's valueDeserializer parses the version short at the start of __consumer_offsets value records and dispatches to schema readers for versions 0-4. An unrecognized version has no matching metadata schema branch, so IllegalArgumentException is thrown before falling back to a plain JSON render. The catch block then retries deserialization treating the payload generically.","triggerScenarios":"valueDeserializer receives a value whose version short is >4 for the offset-metadata branch of the switch (after the first short is read).","commonSituations":"Newer Kafka brokers writing __consumer_offsets metadata values with a version kafka-ui predates; decoding a wrong topic's records with this serde; malformed messages whose second short is misread as a version.","solutions":["Upgrade kafka-ui so its metadata schemas cover your broker's __consumer_offsets version","Ensure the serde is bound only to __consumer_offsets","Inspect the record; if it is truly v5+, extend the switch with a new metadataSchema"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"short v = ByteBuffer.wrap(data).getShort(); if (v > 4) { /* unsupported metadata version */ }","typeGuard":"boolean supportedValueVersion(byte[] d) { return d != null && d.length >= 2 && ByteBuffer.wrap(d).getShort() <= 4; }","tryCatchPattern":"try { result = serde.deserialize(...); } catch (IllegalArgumentException e) { log.warn(\"unsupported value version: {}\", e.getMessage()); }","preventionTips":["Match kafka-ui release to your Kafka broker version","Apply the serde only to __consumer_offsets","Handle the fallback generic-JSON path rather than assuming schema decode"],"tags":["kafka","serde","binary-protocol"],"backgroundTag":"invalid-enum-value","analyzedSha":"83b5a60cc08501b570a0c4d0b4cdfceb1b88d6b7","analyzedAt":"2026-09-08T04:35:39.002Z","contentChangedAt":"2026-09-08T04:35:39.002Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}