conduktor.io ↗

Kafka Exception StateStoreMigratedException

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

Indicates that the state store being queried is closed although the Kafka Streams state is RUNNING RUNNING or REBALANCING REBALANCING. This could happen because the store moved to some other instance during a rebalance so rediscovery of the state store is required before retrying.

Common Causes

Solutions

Example Stack Trace

org.apache.kafka.streams.errors.StateStoreMigratedException: The state store, word-counts-store, may have migrated to another instance. at org.apache.kafka.streams.state.internals.StreamThreadStateStoreProvider.stores(StreamThreadStateStoreProvider.java:80) at org.apache.kafka.streams.state.internals.QueryableStoreProvider.getStore(QueryableStoreProvider.java:75) at org.apache.kafka.streams.KafkaStreams.store(KafkaStreams.java:1804) at com.example.QueryService.lookup(QueryService.java:42)

Diagnostic Commands

kafka-streams-application-reset.sh --application-id my-app --bootstrap-server localhost:9092 --to-earliest # only if state is genuinely corrupt; not needed for a normal migration kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-app # check rebalance churn / partition reassignment that triggered the migration

Related

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

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