On this page
Kafka guide · 19 errors, 8 symptoms
Kafka troubleshooting: errors and symptoms, reproduced
Each page explains a Kafka error or symptom, what usually causes it and how to fix it, then opens a simulator scenario at the exact moment it happens, so you can watch it before it happens in production.
By where it shows up
Start from where the problem shows up. Error pages are named after the exception the client throws, with the protocol error code it carries; symptom pages after what you see in metrics or in the data. A page can sit in more than one row.
| Where it shows up | What you see | Pages |
|---|---|---|
| Producers | A send fails, times out or is rejected | |
| Consumers | They fall behind, rebalance, read twice or skip | |
| Brokers and partitions | Replicas fall out of sync, partitions go offline, records go missing | |
| Transactions | A transactional producer is fenced, times out or is denied | |
| Schema Registry | Serializing or deserializing a record fails | |
| Topic and config changes | An admin request is rejected | |
| Authorization | A client is denied access to a topic or a transactional ID |
27 pages
Errors 19
- NotEnoughReplicasException in Kafka: causes and fixes ·
NOT_· 8 scenarios Why a Kafka producer with acks=all gets NOT_ENOUGH_REPLICAS when the ISR shrinks below min.insync.replicas, and how to fix it without giving up durability.ENOUGH_ REPLICAS - OffsetOutOfRangeException in Kafka: causes and fixes ·
OFFSET_· 3 scenarios Why a Kafka consumer fetch gets OFFSET_OUT_OF_RANGE after retention deletes its position, what auto.offset.reset does then, and how to recover a stuck group.OUT_ OF_ RANGE - OFFSET_NOT_AVAILABLE in Kafka: follower fetch and elections ·
OFFSET_· 1 scenario Why a Kafka fetch or offset lookup gets OFFSET_NOT_AVAILABLE when a follower or a new leader is behind on the high watermark, and why the consumer just retries.NOT_ AVAILABLE - ProducerFencedException in Kafka: causes and fixes ·
PRODUCER_· 2 scenarios Why a Kafka transactional producer gets PRODUCER_FENCED when another instance takes over its transactional.id, what INVALID_PRODUCER_EPOCH adds, and the fix.FENCED - TimeoutException in Kafka producers: causes and fixes ·
REQUEST_· 17 scenarios Expiring N record(s), topic not present in metadata, buffer full: which Kafka producer limit is behind a TimeoutException and how to fix the cause.TIMED_ OUT - OutOfOrderSequenceException in Kafka: causes and fixes ·
OUT_· 1 scenario What OUT_OF_ORDER_SEQUENCE_NUMBER means for a Kafka idempotent or transactional producer, the data loss it usually points to, and when to recreate the producer.OF_ ORDER_ SEQUENCE_ NUMBER - Kafka transaction timed out (transaction.timeout.ms) ·
INVALID_· 1 scenario What a Kafka producer sees after the coordinator aborts a transaction past transaction.timeout.ms: InvalidProducerEpochException or fencing, and the fix.PRODUCER_ EPOCH - TopicAuthorizationException in Kafka: causes and fixes ·
TOPIC_· 2 scenarios Not authorized to access topics: why Kafka returns TOPIC_AUTHORIZATION_FAILED when no ACL allows the operation, and how to find and add the missing ACL.AUTHORIZATION_ FAILED - TransactionalIdAuthorizationException in Kafka ·
TRANSACTIONAL_· 1 scenario Why a Kafka producer with a transactional.id fails with TRANSACTIONAL_ID_AUTHORIZATION_FAILED, usually at initTransactions(), and how to grant the missing ACL.ID_ AUTHORIZATION_ FAILED - Kafka SerializationException: Schema Registry unreachable ·
Connect· 2 scenarios Why a Kafka producer or consumer throws SerializationException when no Schema Registry instance answers, why warm clients keep working, and how to stay up.Exception / no Schema Registry instance - Schema Registry no leader: new schemas fail in Kafka ·
50004 / 50003 / 50002 / 50001· 2 scenarios Why registering a new schema fails with 50004, 50003, 50002 or 50001 when Schema Registry has no leader or cannot write the Kafka _schemas topic. - Schema not found (40403) in Kafka: causes and fixes ·
40403· 2 scenarios Why a Kafka consumer or producer gets Schema Registry error 40403, schema not found: unregistered versions, independent registries and mirrored ids. - Schema being registered is incompatible (409) in Kafka ·
409· 1 scenario Why a Kafka producer fails with Schema Registry error 409, schema being registered is incompatible with an earlier schema, and how to fix the schema. - RecordDeserializationException in Kafka: causes and fixes ·
Avro schema resolution· 1 scenario Why a Kafka consumer stops with RecordDeserializationException after a schema change the registry accepted, and how to upgrade readers in the right order. - KAFKA_STORAGE_ERROR in Kafka: disk failures and Inkless ·
KAFKA_· 6 scenarios Why Kafka answers KAFKA_STORAGE_ERROR when a broker log directory fails, why Aiven Inkless returns it while PostgreSQL is down, and why clients retry.STORAGE_ ERROR - NOT_LEADER_OR_FOLLOWER in Kafka: causes and fixes ·
NOT_· 4 scenarios Why a Kafka broker answers NOT_LEADER_OR_FOLLOWER after leadership moves, and why KafScale returns it while a crashed broker still holds the partition lease.LEADER_ OR_ FOLLOWER - COORDINATOR_NOT_AVAILABLE in Kafka: causes and fixes ·
COORDINATOR_· 3 scenarios Why a Kafka consumer group gets COORDINATOR_NOT_AVAILABLE: __consumer_offsets missing, leaderless or not taking writes, and how to get the group going again.NOT_ AVAILABLE - InvalidConfigurationException in Kafka: INVALID_CONFIG ·
INVALID_· 1 scenario Why Kafka rejects a topic config change with INVALID_CONFIG: an unknown config name, a value the config does not accept, or settings that contradict each other.CONFIG - InvalidRequestException in Kafka: INVALID_REQUEST ·
INVALID_· 3 scenarios Why Kafka answers INVALID_REQUEST: a request that breaks the protocol rules, from a client library bug, an incompatible broker, or fields that contradict.REQUEST
Symptoms 8
- Kafka under-replicated partitions: causes and fixes · 4 scenarios Why Kafka reports under-replicated partitions when a broker is down or a follower drops out of the ISR, how to find the missing replica, and what to fix first.
- Kafka consumer group keeps rebalancing: causes and fixes · 4 scenarios Kafka consumer group keeps rebalancing, with CommitFailedException or "consumer poll timeout has expired": slow processing, missed heartbeats, restarts.
- Kafka consumer lag keeps growing: causes and fixes · 3 scenarios Kafka consumer lag that only goes up means the group reads slower than producers write, a member is stuck, or commits stopped. How to tell which.
- Kafka duplicate messages: causes and fixes · 5 scenarios Where duplicate Kafka messages come from: producer retries without idempotence, resends from application code, and consumer redelivery after a crash.
- Kafka messages lost after broker failure: causes and fixes · 3 scenarios Why acknowledged Kafka records vanish when a broker dies: acks=1, unclean leader election, an ISR of one, ignored send errors, and the settings that prevent it.
- Kafka offline partitions with no leader: causes and fixes · 3 scenarios A Kafka partition goes offline when no replica can be elected leader. Why that happens in KRaft, how to find the partitions, and how to recover safely.
- Kafka messages out of order: causes and fixes · 1 scenario Kafka orders records only within a partition. Why messages arrive out of order: keys, partition count changes, retries without idempotence, parallel consumers.
- Why does a Kafka consumer reprocess messages after restart? · 2 scenarios A restarted Kafka consumer resumes from its committed offset, not its last processed record. Why that replays records, when it replays all of them, and the fix.