Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Failed to collate messages by topic (LeaderNotAvailableException) #53

Closed
mjgpy3 opened this issue Aug 25, 2016 · 2 comments
Closed

Failed to collate messages by topic (LeaderNotAvailableException) #53

mjgpy3 opened this issue Aug 25, 2016 · 2 comments

Comments

@mjgpy3
Copy link

mjgpy3 commented Aug 25, 2016

First off let me say thank you for this great image!

A few days ago I was running the image and it was working well.

Lately, though, I've been trying to follow the most basic steps (as listed in the Run section at dockerhub) and it's been erroring with

root@2995acf13535:/opt/kafka_2.11-0.8.2.1/bin# ./kafka-console-producer.sh --broker-list localhost:9092 --topic test
[2016-08-25 12:06:33,784] WARN Property topic is not valid (kafka.utils.VerifiableProperties)
Hi There
[2016-08-25 12:06:36,183] WARN Error while fetching metadata [{TopicMetadata for topic test ->
No partition metadata for topic test due to kafka.common.LeaderNotAvailableException}] for topic [test]: class kafka.common.LeaderNotAvailableException (kafka.producer.BrokerPartitionInfo)
[2016-08-25 12:06:36,214] WARN Error while fetching metadata [{TopicMetadata for topic test ->
No partition metadata for topic test due to kafka.common.LeaderNotAvailableException}] for topic [test]: class kafka.common.LeaderNotAvailableException (kafka.producer.BrokerPartitionInfo)
[2016-08-25 12:06:36,217] ERROR Failed to collate messages by topic, partition due to: Failed to fetch topic metadata for topic: test (kafka.producer.async.DefaultEventHandler)

Just to verify that I'm not doing anything ultra dumb, in linux I'm,

  • Running the image (using localhost because I'm in linux): docker run -p 2181:2181 -p 9092:9092 --env ADVERTISED_HOST=localhost --env ADVERTISED_PORT=9092 spotify/kafka
  • Exec-ing into the image: docker exec -it stupefied_wing bash
  • Navigating to the kafka tools: cd /opt/kafka_2.11-0.8.2.1/bin/
  • Starting the console producer: ./kafka-console-producer.sh --broker-list localhost:9092 --topic test
    • I get a warning here [2016-08-25 12:12:35,959] WARN Property topic is not valid (kafka.utils.VerifiableProperties)
  • Type in some message... and see above :)

Thanks again, any help would be greatly appreciated.

@mjgpy3
Copy link
Author

mjgpy3 commented Aug 25, 2016

I also tried setting the hostname, but still no success

docker run -p 2181:2181 -p 9092:9092 --hostname foobar --env ADVERTISED_HOST=foobar --env ADVERTISED_PORT=9092 spotify/kafka

@mjgpy3 mjgpy3 changed the title Failed to collate messages by topic Failed to collate messages by topic (LeaderNotAvailableException) Aug 25, 2016
@mjgpy3
Copy link
Author

mjgpy3 commented Aug 25, 2016

Got it! It looks like using the console producer does not correctly create the topic. So ./kafka-topics.sh --create ... should be used before producing/consuming.

@mjgpy3 mjgpy3 closed this as completed Aug 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant