conduktor.io ↗

Kafka Exception CorruptRecordException

org.apache.kafka.common.errors.CorruptRecordException
Retriable Broker

This exception indicates a record has failed its internal CRC check, this generally indicates network or disk corruption.

Common Causes

Solutions

Example Stack Trace

org.apache.kafka.common.errors.CorruptRecordException: This message has failed its CRC checksum, exceeds the valid size, has a null key for a compacted topic, or is otherwise corrupt.

Diagnostic Commands

# Scan log segment for corruption or errors kafka-dump-log.sh --files /var/kafka-logs/<topic>-<partition>/00000000000000000000.log --print-data-log 2>&1 | grep -i 'corrupt\|invalid\|error' # Inspect log directories on the broker kafka-log-dirs.sh --bootstrap-server localhost:9092 --topic-list <topic> --describe

Related

Protocol error: CORRUPT_MESSAGE (code 2)

Related Broker exceptions: FencedLeaderEpochException · LeaderNotAvailableException · NetworkException · NotEnoughReplicasAfterAppendException · NotEnoughReplicasException · NotLeaderOrFollowerException · TimeoutException · UnknownLeaderEpochException

Hitting CorruptRecordException in production? Conduktor Console gives you real-time visibility into clients, consumer groups, and broker health. Browse every Kafka exception or protocol error code.