conduktor.io ↗

Kafka Exception CommitFailedException

org.apache.kafka.clients.consumer.CommitFailedException
Non-retriable Consumer

This exception is raised when an offset commit with commitSync() fails with an unrecoverable error. This exception is generated on the client side, typically when a group rebalance completes before the commit could be successfully applied. In this case, the commit cannot generally be retried because some of the partitions may have already been assigned to another member in the group.

Common Causes

Solutions

Example Stack Trace

org.apache.kafka.clients.consumer.CommitFailedException: Commit cannot be completed since the group has already rebalanced and assigned the partitions to another member. This means that the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time message processing. at org.apache.kafka.clients.consumer.internals.ConsumerCoordinator.sendOffsetCommitRequest(ConsumerCoordinator.java:1190) at org.apache.kafka.clients.consumer.internals.ConsumerCoordinator.commitOffsetsSync(ConsumerCoordinator.java:1029) at org.apache.kafka.clients.consumer.KafkaConsumer.commitSync(KafkaConsumer.java:1530)

Diagnostic Commands

# Inspect the group: state, members, and per-partition lag kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group <group> --describe --members --verbose

Related

Related Consumer exceptions: CoordinatorLoadInProgressException · CoordinatorNotAvailableException · FencedInstanceIdException · FencedMemberEpochException · GroupMaxSizeReachedException · IllegalGenerationException · InvalidGroupIdException · InvalidOffsetException

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