Support Questions
Find answers, ask questions, and share your expertise

kafka : GetOffsetShell in error

kafka : GetOffsetShell in error

New Contributor

When i try to get the offset of a topic, I get the following error :

GetOffsetShell Exception in thread "main" kafka.common.KafkaException: fetching topic metadata for topics

i'm on SASL_PLAINTEXT mode

here is the complete error message :

bin/kafka-run-class.sh kafka.tools.GetOffsetShell --security-protocol SASL_PLAINTEXT --broker-list yval27w0:6667,yval27y0:6667,yval27x0:6667 --topic log-http-servicesdata --time -1 --offsets 1


{metadata.broker.list=yval27w0:6667,yval27y0:6667,yval27x0:6667, request.timeout.ms=1000, client.id=GetOffsetShell, security.protocol=SASL_PLAINTEXT}
[2018-01-17 15:12:12,861] WARN Fetching topic metadata with correlation id 0 for topics [Set(log-http-servicesdata)] from broker [BrokerEndPoint(1,yval27y0,6667)] failed (kafka.client.ClientUtils$)
java.nio.channels.ClosedChannelException
at kafka.network.BlockingChannel.send(BlockingChannel.scala:122)
at kafka.producer.SyncProducer.liftedTree1$1(SyncProducer.scala:82)
at kafka.producer.SyncProducer.kafka$producer$SyncProducer$$doSend(SyncProducer.scala:81)
at kafka.producer.SyncProducer.send(SyncProducer.scala:126)
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:59)
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:96)
at kafka.tools.GetOffsetShell$.main(GetOffsetShell.scala:98)
at kafka.tools.GetOffsetShell.main(GetOffsetShell.scala)
[2018-01-17 15:12:12,869] WARN Fetching topic metadata with correlation id 0 for topics [Set(log-http-servicesdata)] from broker [BrokerEndPoint(0,yval27w0,6667)] failed (kafka.client.ClientUtils$)
java.nio.channels.ClosedChannelException
at kafka.network.BlockingChannel.send(BlockingChannel.scala:122)
at kafka.producer.SyncProducer.liftedTree1$1(SyncProducer.scala:82)
at kafka.producer.SyncProducer.kafka$producer$SyncProducer$$doSend(SyncProducer.scala:81)
at kafka.producer.SyncProducer.send(SyncProducer.scala:126)
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:59)
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:96)
at kafka.tools.GetOffsetShell$.main(GetOffsetShell.scala:98)
at kafka.tools.GetOffsetShell.main(GetOffsetShell.scala)
[2018-01-17 15:12:12,876] WARN Fetching topic metadata with correlation id 0 for topics [Set(log-http-servicesdata)] from broker [BrokerEndPoint(2,yval27x0,6667)] failed (kafka.client.ClientUtils$)
java.nio.channels.ClosedChannelException
at kafka.network.BlockingChannel.send(BlockingChannel.scala:122)
at kafka.producer.SyncProducer.liftedTree1$1(SyncProducer.scala:82)
at kafka.producer.SyncProducer.kafka$producer$SyncProducer$$doSend(SyncProducer.scala:81)
at kafka.producer.SyncProducer.send(SyncProducer.scala:126)
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:59)
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:96)
at kafka.tools.GetOffsetShell$.main(GetOffsetShell.scala:98)
at kafka.tools.GetOffsetShell.main(GetOffsetShell.scala)
Exception in thread "main" kafka.common.KafkaException: fetching topic metadata for topics [Set(log-http-servicesdata)] from broker [ArrayBuffer(BrokerEndPoint(1,yval27y0,6667), BrokerEndPoint(0,yval27w0,6667), BrokerEndPoint(2,yval27x0,6667))] failed
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:73)
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:96)
at kafka.tools.GetOffsetShell$.main(GetOffsetShell.scala:98)
at kafka.tools.GetOffsetShell.main(GetOffsetShell.scala)
Caused by: java.nio.channels.ClosedChannelException
at kafka.network.BlockingChannel.send(BlockingChannel.scala:122)
at kafka.producer.SyncProducer.liftedTree1$1(SyncProducer.scala:82)
at kafka.producer.SyncProducer.kafka$producer$SyncProducer$$doSend(SyncProducer.scala:81)
at kafka.producer.SyncProducer.send(SyncProducer.scala:126)
at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:59)
... 3 more

I have read that GetOffsetShell command doesn't work with SASL, but i think that very strange...

my kafka version : 0.10.2.1

Any idea for fixing it please ?