---
title: "Kafka troubleshooting: errors and symptoms, reproduced"
description: "Common Apache Kafka errors and symptoms, what causes them and how to fix them, each reproduced step by step in the Kafka Simulator."
url: https://monedula.dev/kafka/troubleshooting/
---

# 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](https://monedula.dev/kafka-simulator/scenarios/) at the exact moment it happens, so you can watch it before it happens in production. Every page is also served as Markdown at the same path with a .md suffix.

## 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.

- Producers (a send fails, times out or is rejected): [TimeoutException](https://monedula.dev/kafka/troubleshooting/producer-timeout-exception/), [NotEnoughReplicasException](https://monedula.dev/kafka/troubleshooting/not-enough-replicas/), [NotLeaderOrFollowerException](https://monedula.dev/kafka/troubleshooting/not-leader-or-follower/), [OutOfOrderSequenceException](https://monedula.dev/kafka/troubleshooting/out-of-order-sequence/), [KafkaStorageException](https://monedula.dev/kafka/troubleshooting/kafka-storage-exception/), [InvalidRequestException](https://monedula.dev/kafka/troubleshooting/invalid-request-exception/)
- Consumers (they fall behind, rebalance, read twice or skip): [Consumer lag keeps growing](https://monedula.dev/kafka/troubleshooting/consumer-lag-keeps-growing/), [The consumer group keeps rebalancing](https://monedula.dev/kafka/troubleshooting/consumer-group-keeps-rebalancing/), [The consumer reprocesses messages after a restart](https://monedula.dev/kafka/troubleshooting/consumer-reprocesses-messages-after-restart/), [Consumers see duplicate messages](https://monedula.dev/kafka/troubleshooting/duplicate-messages/), [Messages arrive out of order](https://monedula.dev/kafka/troubleshooting/messages-out-of-order/), [CoordinatorNotAvailableException](https://monedula.dev/kafka/troubleshooting/coordinator-not-available/), [OffsetOutOfRangeException](https://monedula.dev/kafka/troubleshooting/offset-out-of-range/), [OffsetNotAvailableException](https://monedula.dev/kafka/troubleshooting/offset-not-available/)
- Brokers and partitions (replicas fall out of sync, partitions go offline, records go missing): [Kafka partitions are under-replicated](https://monedula.dev/kafka/troubleshooting/under-replicated-partitions/), [Partitions are offline with no leader](https://monedula.dev/kafka/troubleshooting/offline-partitions-no-leader/), [Messages are lost after a broker failure](https://monedula.dev/kafka/troubleshooting/messages-lost-after-broker-failure/), [NotEnoughReplicasException](https://monedula.dev/kafka/troubleshooting/not-enough-replicas/), [KafkaStorageException](https://monedula.dev/kafka/troubleshooting/kafka-storage-exception/)
- Transactions (a transactional producer is fenced, times out or is denied): [ProducerFencedException](https://monedula.dev/kafka/troubleshooting/producer-fenced/), [Kafka transaction timed out](https://monedula.dev/kafka/troubleshooting/transaction-timed-out/), [TransactionalIdAuthorizationException](https://monedula.dev/kafka/troubleshooting/transactional-id-authorization-failed/)
- Schema Registry (serializing or deserializing a record fails): [SerializationException: Schema being registered is incompatible with an earlier schema](https://monedula.dev/kafka/troubleshooting/schema-incompatible/), [SerializationException: Schema not found](https://monedula.dev/kafka/troubleshooting/schema-not-found/), [SerializationException: Schema Registry unreachable](https://monedula.dev/kafka/troubleshooting/schema-registry-unavailable/), [SerializationException: Schema Registry has no leader](https://monedula.dev/kafka/troubleshooting/schema-registry-no-leader/), [RecordDeserializationException: Error deserializing VALUE](https://monedula.dev/kafka/troubleshooting/record-deserialization-exception/)
- Topic and config changes (an admin request is rejected): [InvalidConfigurationException](https://monedula.dev/kafka/troubleshooting/invalid-configuration-exception/), [InvalidRequestException](https://monedula.dev/kafka/troubleshooting/invalid-request-exception/)
- Authorization (a client is denied access to a topic or a transactional ID): [TopicAuthorizationException](https://monedula.dev/kafka/troubleshooting/topic-authorization-failed/), [TransactionalIdAuthorizationException](https://monedula.dev/kafka/troubleshooting/transactional-id-authorization-failed/)

## Errors

- [NotEnoughReplicasException in Kafka: causes and fixes](https://monedula.dev/kafka/troubleshooting/not-enough-replicas/): 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.
- [OffsetOutOfRangeException in Kafka: causes and fixes](https://monedula.dev/kafka/troubleshooting/offset-out-of-range/): 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.
- [OFFSET_NOT_AVAILABLE in Kafka: follower fetch and elections](https://monedula.dev/kafka/troubleshooting/offset-not-available/): 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.
- [ProducerFencedException in Kafka: causes and fixes](https://monedula.dev/kafka/troubleshooting/producer-fenced/): Why a Kafka transactional producer gets PRODUCER_FENCED when another instance takes over its transactional.id, what INVALID_PRODUCER_EPOCH adds, and the fix.
- [TimeoutException in Kafka producers: causes and fixes](https://monedula.dev/kafka/troubleshooting/producer-timeout-exception/): 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.
- [OutOfOrderSequenceException in Kafka: causes and fixes](https://monedula.dev/kafka/troubleshooting/out-of-order-sequence/): 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.
- [Kafka transaction timed out (transaction.timeout.ms)](https://monedula.dev/kafka/troubleshooting/transaction-timed-out/): What a Kafka producer sees after the coordinator aborts a transaction past transaction.timeout.ms: InvalidProducerEpochException or fencing, and the fix.
- [TopicAuthorizationException in Kafka: causes and fixes](https://monedula.dev/kafka/troubleshooting/topic-authorization-failed/): 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.
- [TransactionalIdAuthorizationException in Kafka](https://monedula.dev/kafka/troubleshooting/transactional-id-authorization-failed/): Why a Kafka producer with a transactional.id fails with TRANSACTIONAL_ID_AUTHORIZATION_FAILED, usually at initTransactions(), and how to grant the missing ACL.
- [Kafka SerializationException: Schema Registry unreachable](https://monedula.dev/kafka/troubleshooting/schema-registry-unavailable/): Why a Kafka producer or consumer throws SerializationException when no Schema Registry instance answers, why warm clients keep working, and how to stay up.
- [Schema Registry no leader: new schemas fail in Kafka](https://monedula.dev/kafka/troubleshooting/schema-registry-no-leader/): 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](https://monedula.dev/kafka/troubleshooting/schema-not-found/): 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](https://monedula.dev/kafka/troubleshooting/schema-incompatible/): 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](https://monedula.dev/kafka/troubleshooting/record-deserialization-exception/): 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](https://monedula.dev/kafka/troubleshooting/kafka-storage-exception/): 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.
- [NOT_LEADER_OR_FOLLOWER in Kafka: causes and fixes](https://monedula.dev/kafka/troubleshooting/not-leader-or-follower/): 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.
- [COORDINATOR_NOT_AVAILABLE in Kafka: causes and fixes](https://monedula.dev/kafka/troubleshooting/coordinator-not-available/): 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.
- [InvalidConfigurationException in Kafka: INVALID_CONFIG](https://monedula.dev/kafka/troubleshooting/invalid-configuration-exception/): 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.
- [InvalidRequestException in Kafka: INVALID_REQUEST](https://monedula.dev/kafka/troubleshooting/invalid-request-exception/): Why Kafka answers INVALID_REQUEST: a request that breaks the protocol rules, from a client library bug, an incompatible broker, or fields that contradict.

## Symptoms

- [Kafka under-replicated partitions: causes and fixes](https://monedula.dev/kafka/troubleshooting/under-replicated-partitions/): 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](https://monedula.dev/kafka/troubleshooting/consumer-group-keeps-rebalancing/): 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](https://monedula.dev/kafka/troubleshooting/consumer-lag-keeps-growing/): 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](https://monedula.dev/kafka/troubleshooting/duplicate-messages/): 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](https://monedula.dev/kafka/troubleshooting/messages-lost-after-broker-failure/): 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](https://monedula.dev/kafka/troubleshooting/offline-partitions-no-leader/): 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](https://monedula.dev/kafka/troubleshooting/messages-out-of-order/): 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?](https://monedula.dev/kafka/troubleshooting/consumer-reprocesses-messages-after-restart/): 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.
