Error: partition 0 does not have a leader. Skip getting offsets - but describe shows leader is present
I've got the same problem then Error: partition 0 does not have a leader. Skip getting offsets but --describe says that leader is present, do you have any solution please? Thanks
Kafka broker state-change log says:
[timestamp] ERROR [Controller id=**** epoch=**] Controller **** epoch ** failed to change state for partition ********* from OfflinePartition to OnlinePartition (state.change.logger)
kafka.common.StateChangeFailedException: Failed to elect leader for partition ********** under strategy OfflinePartitionLeaderElectionStrategy
Thanks again, total broker count is 4 partitioncount is 3 and replicationfactor is 4.
Note that consumer is not writing offsets on zookeeper
./kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list broker1:6667,broker2:6667 --topic topic1 --time -1
Error: partition 2 does not have a leader. Skip getting offsets
Error: partition 1 does not have a leader. Skip getting offsets
Error: partition 0 does not have a leader. Skip getting offsets
./kafka-topics.sh --describe --zookeeper zookeepernode01:2181 --topic topic1
Topic: topic1 PartitionCount:3 ReplicationFactor:4 Configs: Topic: topic1
Partition: 0 Leader: 2 Replicas: 2,4,6,7 Isr: 2,4,6 Topic: topic1
Partition: 1 Leader: 3 Replicas: 3,6,7,8 Isr: 3,7,8 Topic: topic1
Partition: 2 Leader: 4 Replicas: 4,7,8,1001 Isr: 4,7 Topic: topic1