java – Kafka Error: SerializationException: Error retrieving Avro value schema for id 2 – ONLY some records in Partition
I’m running a kafka consumer that experienced the issue below with a few records within a a Topic partition. The problem persisted until manually changed the offset to keep consuming from. The rest of the records before and after a few offsets are properly consumed. The code/schema has not changed and the error shows in the Kafka SMM when I try to visualize the records using avro.
I’m trying to figure out what could be the root cause of this error.
time=2025-04-23T09:03:59.700+0000, level=ERROR, thread=Default Executor-thread-1295, caller=ServiceX, service=, txid=, correlation=, message=Error occurred while retrieveing messages from kafka
org.apache.kafka.common.errors.RecordDeserializationException: Error deserializing key/value for partition TopicName-1 at offset 1284542. If needed, please seek past the record to continue consumption.
at org.apache.kafka.clients.consumer.internals.CompletedFetch.parseRecord(CompletedFetch.java:309) ~[org.apache.kafka-kafka-clients-7.6.0-ccs.jar:?]
… 20 lines omitted …
Caused by: org.apache.kafka.common.errors.SerializationException: Error retrieving Avro value schema for id 2
… 7 lines omitted …
Caused by: io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: null; error code: 0
Read more here: Source link
