{"record":{"id":"205ca2c089f16826","repo":"provectus/kafka-ui","slug":"unknown-group-metadata-message-version-version","errorCode":null,"errorMessage":"Unknown group metadata message version: ${version}","messagePattern":"Unknown group metadata message version: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"kafka-ui-api/src/main/java/com/provectus/kafka/ui/serdes/builtin/ConsumerOffsetsSerde.java","lineNumber":124,"sourceCode":"    final Schema commitKeySchema = new Schema(\n        new Field(\"group\", Type.STRING, \"\"),\n        new Field(\"topic\", Type.STRING, \"\"),\n        new Field(\"partition\", Type.INT32, \"\")\n    );\n\n    final Schema groupMetadataSchema = new Schema(\n        new Field(\"group\", Type.STRING, \"\")\n    );\n\n    return (headers, data) -> {\n      var bb = ByteBuffer.wrap(data);\n      short version = bb.getShort();\n      return new DeserializeResult(\n          toJson(\n              switch (version) {\n                case 0, 1 -> commitKeySchema.read(bb);\n                case 2 -> groupMetadataSchema.read(bb);\n                default -> throw new IllegalStateException(\"Unknown group metadata message version: \" + version);\n              }\n          ),\n          DeserializeResult.Type.JSON,\n          Map.of()\n      );\n    };\n  }\n\n  private Deserializer valueDeserializer() {\n    final Schema commitOffsetSchemaV0 =\n        new Schema(\n            new Field(OFFSET, Type.INT64, \"\"),\n            new Field(METADATA, Type.STRING, \"\"),\n            new Field(COMMIT_TIMESTAMP, Type.INT64, \"\")\n        );\n\n    final Schema commitOffsetSchemaV1 =\n        new Schema(","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/provectus/kafka-ui/blob/83b5a60cc08501b570a0c4d0b4cdfceb1b88d6b7/kafka-ui-api/src/main/java/com/provectus/kafka/ui/serdes/builtin/ConsumerOffsetsSerde.java#L106-L142","documentation":"ConsumerOffsetsSerde decodes Kafka's internal __consumer_offsets records. Keys are versioned binary records; when the leading version short is neither 0, 1 (offset commit keys) nor 2 (group metadata keys), the switch has no branch and IllegalStateException is thrown. This means the record is not a recognized __consumer_offsets key format for this serde.","triggerScenarios":"Calling deserializer -> keyDeserializer on a byte array whose first two bytes (big-endian short) decode to a version outside {0,1,2} for the group metadata/commit key schema.","commonSituations":"Pointing the builtin ConsumerOffsetsSerde at a topic that is not __consumer_offsets; a future Kafka broker writing a new key schema version the UI doesn't support; corrupted/truncated keys.","solutions":["Apply the serde only to the __consumer_offsets topic (check topicKeysPattern/topicValuesPattern config)","Upgrade kafka-ui to a version supporting the new schema version written by your Kafka broker","Verify the message is actually an __consumer_offsets key and not application data"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"ByteBuffer bb = ByteBuffer.wrap(data); short v = bb.getShort(); if (v < 0 || v > 2) return null; // not an __consumer_offsets key","typeGuard":"boolean isKnownKeyVersion(byte[] d) { return d != null && d.length >= 2 && (ByteBuffer.wrap(d).getShort() >= 0 && ByteBuffer.wrap(d).getShort() <= 2); }","tryCatchPattern":"try { result = serde.deserialize(...); } catch (IllegalStateException e) { log.warn(\"unsupported __consumer_offsets key version\"); }","preventionTips":["Bind ConsumerOffsetsSerde only to __consumer_offsets","Keep kafka-ui version in sync with broker version","Preview raw bytes before applying internal-topic serdes"],"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"}