conduktor.io ↗

Kafka Exception StreamsRebalancingException

org.apache.kafka.streams.errors.StreamsRebalancingException
Non-retriable Streams

Indicates that Kafka Streams is in state REBALANCING REBALANCING and thus cannot be queried by default. You can retry to query after the rebalance finished. As an alternative, you can also query (potentially stale) state stores during a rebalance via enableStaleStores().

Common Causes

Solutions

Example Stack Trace

org.apache.kafka.streams.errors.StreamsRebalancingException: Cannot process while rebalancing; the state store is not available until the rebalance completes at org.apache.kafka.streams.KafkaStreams.validateIsRunningOrRebalancing(KafkaStreams.java:1460) at org.apache.kafka.streams.KafkaStreams.store(KafkaStreams.java:1798) at com.example.QueryService.lookup(QueryService.java:41)

Diagnostic Commands

kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-app --state # confirm group is in PreparingRebalance/CompletingRebalance kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-app --members --verbose # spot the member causing repeated rebalances

Related

Related Streams exceptions: BrokerNotFoundException · InternalTopicsAlreadySetupException · InvalidStateStoreException · InvalidStateStorePartitionException · LockException · MisconfiguredInternalTopicException · MissingInternalTopicsException · MissingSourceTopicException

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