Open danielpetisme opened 4 years ago
Hello @danielpetisme
Thanks for sharing this. In a future version, I will handle it on KafkaHQ in order to not crash on this case. I already have report like just need a big refactor to handle it correctly !
Great !
I propose to close the issue
Reopen it to make HQ more resilient to this
Note: I thought the following troubleshooting worth to be shared. Hope it help more people! Thank you for your work its awesome!
Context I had KafkaHQ running pretty well, I had a cluster issue which required some not-recommended actions (like removing topics directly from the FS) after the restart, KafkaHQ was not working anymore with the following error:
Troubleshoot I started to instrument the code to try to understand what was happening. First, just as the stack strace indicates, I looked at the topic description https://github.com/tchiotludo/kafkahq/blob/dev/src/main/java/org/kafkahq/modules/AbstractKafkaWrapper.java#L65
I replace the stream by a dumb loop just to be able to invoke
describeTopics
for each topic in the collection in order to find the problematic topic.Once I found the guilty topic I tried to have more details directly on the cluster with
kafka-topics --zookeeper ZK --describe TOPIC
but it wasn't listed....I took a step back to try to find how this missing topic could have be included place to the
AbstractKafkaWrapper#describeTopics
arguments in the first.After some researchs, I found the method was used here https://github.com/tchiotludo/kafkahq/blob/dev/src/main/java/org/kafkahq/repositories/ConsumerGroupRepository.java#L74
Which means the topic has been provided because a ConsumerGroup has an active subscription to it. Back to the cluster, I run the command
kafka-consumer-groups --bootstrap-server BROKERS --describe --all-groups
and one consumer group was indeed generating the same errorFix In my case the solution was easy, the consumer group was not used anymore so I decided to simply delete it with the command
kafka-consumer-groups --bootstrap-server BROKERS --delete --group MY_GROUP_ID