You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Kishore N C <ki...@gmail.com> on 2015/11/03 13:23:15 UTC

Unable to create a topic from console producer even though topic creation is enabled

Hi all,

I have a 3-node Kafka cluster. I'm running into the following error when I
try to use the console producer to write to a topic that does *not* yet
exist. I have ensured that "auto.create.topics.enable=true" in
server.properties.

The error:

ubuntu@ip-XX-X-XXX-XX:/usr/local/kafka$ bin/kafka-console-producer.sh
--topic sampletopic --broker-list localhost:9082
[2015-11-03 12:00:01,011] WARN Property topic is not valid
(kafka.utils.VerifiableProperties)
Hey
[2015-11-03 12:00:04,304] WARN Error while fetching metadata
[{TopicMetadata for topic sampletopic ->
No partition metadata for topic sampletopic due to
kafka.common.UnknownTopicOrPartitionException}] for topic [sampletopic]:
class kafka.common.UnknownTopicOrPartitionException
(kafka.producer.BrokerPartitionInfo)
[2015-11-03 12:00:04,312] WARN Error while fetching metadata
[{TopicMetadata for topic sampletopic ->
No partition metadata for topic sampletopic due to
kafka.common.UnknownTopicOrPartitionException}] for topic [sampletopic]:
class kafka.common.UnknownTopicOrPartitionException
(kafka.producer.BrokerPartitionInfo)
[2015-11-03 12:00:04,313] ERROR Failed to collate messages by topic,
partition due to: Failed to fetch topic metadata for topic: sampletopic
(kafka.producer.async.DefaultEventHandler)
...

Once I create the topic, I am able to write to it:

ubuntu@ip-XX-X-XXX-XX:/usr/local/kafka$ bin/kafka-topics.sh --create
--zookeeper localhost:2181 --replication-factor 2 --partitions 2 --topic
sampletopic
Created topic "sampletopic".
ubuntu@ip-10-1-100-75:/usr/local/kafka$ bin/kafka-console-producer.sh
--topic sampletopic --broker-list localhost:9082
[2015-11-03 12:09:01,940] WARN Property topic is not valid
(kafka.utils.VerifiableProperties)
Hey
Hello
^Cubuntu@ip-10-1-100-75:/usr/local/kafka$ bin/kafka-console-consumer.sh
--zookeeper localhost:2181 --from-beginning --topic sampletopic
Hey
Hello
^CConsumed 2 messages

Any idea what I am doing wrong or how I should troubleshoot this issue?

Regards,

KN.

Re: Unable to create a topic from console producer even though topic creation is enabled

Posted by Kishore N C <ki...@gmail.com>.
It turns out that "auto.create.topics.enable=true"  was actually getting
overridden to false somewhere else, and ended up causing this issue.

On Tue, Nov 3, 2015 at 8:19 PM, Artem Ervits <ar...@gmail.com> wrote:

> change the order of your commands
>
>  *bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test*
>
>
> On Tue, Nov 3, 2015 at 7:23 AM, Kishore N C <ki...@gmail.com> wrote:
>
> > Hi all,
> >
> > I have a 3-node Kafka cluster. I'm running into the following error when
> I
> > try to use the console producer to write to a topic that does *not* yet
> > exist. I have ensured that "auto.create.topics.enable=true" in
> > server.properties.
> >
> > The error:
> >
> > ubuntu@ip-XX-X-XXX-XX:/usr/local/kafka$ bin/kafka-console-producer.sh
> > --topic sampletopic --broker-list localhost:9082
> > [2015-11-03 12:00:01,011] WARN Property topic is not valid
> > (kafka.utils.VerifiableProperties)
> > Hey
> > [2015-11-03 12:00:04,304] WARN Error while fetching metadata
> > [{TopicMetadata for topic sampletopic ->
> > No partition metadata for topic sampletopic due to
> > kafka.common.UnknownTopicOrPartitionException}] for topic [sampletopic]:
> > class kafka.common.UnknownTopicOrPartitionException
> > (kafka.producer.BrokerPartitionInfo)
> > [2015-11-03 12:00:04,312] WARN Error while fetching metadata
> > [{TopicMetadata for topic sampletopic ->
> > No partition metadata for topic sampletopic due to
> > kafka.common.UnknownTopicOrPartitionException}] for topic [sampletopic]:
> > class kafka.common.UnknownTopicOrPartitionException
> > (kafka.producer.BrokerPartitionInfo)
> > [2015-11-03 12:00:04,313] ERROR Failed to collate messages by topic,
> > partition due to: Failed to fetch topic metadata for topic: sampletopic
> > (kafka.producer.async.DefaultEventHandler)
> > ...
> >
> > Once I create the topic, I am able to write to it:
> >
> > ubuntu@ip-XX-X-XXX-XX:/usr/local/kafka$ bin/kafka-topics.sh --create
> > --zookeeper localhost:2181 --replication-factor 2 --partitions 2 --topic
> > sampletopic
> > Created topic "sampletopic".
> > ubuntu@ip-10-1-100-75:/usr/local/kafka$ bin/kafka-console-producer.sh
> > --topic sampletopic --broker-list localhost:9082
> > [2015-11-03 12:09:01,940] WARN Property topic is not valid
> > (kafka.utils.VerifiableProperties)
> > Hey
> > Hello
> > ^Cubuntu@ip-10-1-100-75:/usr/local/kafka$ bin/kafka-console-consumer.sh
> > --zookeeper localhost:2181 --from-beginning --topic sampletopic
> > Hey
> > Hello
> > ^CConsumed 2 messages
> >
> > Any idea what I am doing wrong or how I should troubleshoot this issue?
> >
> > Regards,
> >
> > KN.
> >
>



-- 
It is our choices that show what we truly are,
far more than our abilities.

Re: Unable to create a topic from console producer even though topic creation is enabled

Posted by Artem Ervits <ar...@gmail.com>.
change the order of your commands

 *bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test*


On Tue, Nov 3, 2015 at 7:23 AM, Kishore N C <ki...@gmail.com> wrote:

> Hi all,
>
> I have a 3-node Kafka cluster. I'm running into the following error when I
> try to use the console producer to write to a topic that does *not* yet
> exist. I have ensured that "auto.create.topics.enable=true" in
> server.properties.
>
> The error:
>
> ubuntu@ip-XX-X-XXX-XX:/usr/local/kafka$ bin/kafka-console-producer.sh
> --topic sampletopic --broker-list localhost:9082
> [2015-11-03 12:00:01,011] WARN Property topic is not valid
> (kafka.utils.VerifiableProperties)
> Hey
> [2015-11-03 12:00:04,304] WARN Error while fetching metadata
> [{TopicMetadata for topic sampletopic ->
> No partition metadata for topic sampletopic due to
> kafka.common.UnknownTopicOrPartitionException}] for topic [sampletopic]:
> class kafka.common.UnknownTopicOrPartitionException
> (kafka.producer.BrokerPartitionInfo)
> [2015-11-03 12:00:04,312] WARN Error while fetching metadata
> [{TopicMetadata for topic sampletopic ->
> No partition metadata for topic sampletopic due to
> kafka.common.UnknownTopicOrPartitionException}] for topic [sampletopic]:
> class kafka.common.UnknownTopicOrPartitionException
> (kafka.producer.BrokerPartitionInfo)
> [2015-11-03 12:00:04,313] ERROR Failed to collate messages by topic,
> partition due to: Failed to fetch topic metadata for topic: sampletopic
> (kafka.producer.async.DefaultEventHandler)
> ...
>
> Once I create the topic, I am able to write to it:
>
> ubuntu@ip-XX-X-XXX-XX:/usr/local/kafka$ bin/kafka-topics.sh --create
> --zookeeper localhost:2181 --replication-factor 2 --partitions 2 --topic
> sampletopic
> Created topic "sampletopic".
> ubuntu@ip-10-1-100-75:/usr/local/kafka$ bin/kafka-console-producer.sh
> --topic sampletopic --broker-list localhost:9082
> [2015-11-03 12:09:01,940] WARN Property topic is not valid
> (kafka.utils.VerifiableProperties)
> Hey
> Hello
> ^Cubuntu@ip-10-1-100-75:/usr/local/kafka$ bin/kafka-console-consumer.sh
> --zookeeper localhost:2181 --from-beginning --topic sampletopic
> Hey
> Hello
> ^CConsumed 2 messages
>
> Any idea what I am doing wrong or how I should troubleshoot this issue?
>
> Regards,
>
> KN.
>