0
votes

I installed latest confluent platform Kafka on Ubuntu server. Now when I try to get consume from topic I get an error for all the topics that were working last friday and any new ones I create.

kafka-topics --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic distance2

topic created distance2

   kafka-console-consumer --bootstrap-server localhost:9092 --topic  distance2  --from-beginning

[2020-06-01 08:00:27,746] WARN [Consumer clientId=consumer-console-consumer-56224-1, groupId=console-consumer-56224] Error while fetching metadata with correlation id 2 : {distance2 =INVALID_TOPIC_EXCEPTION} (org.apache.kafka.clients.NetworkClient) [2020-06-01 08:00:27,747] ERROR [Consumer clientId=consumer-console-consumer-56224-1, groupId=console-consumer-56224] Metadata response reported invalid topics [distance2 ] (org.apache.kafka.clients.Metadata) [2020-06-01 08:00:27,748] ERROR Error processing message, terminating consumer process: (kafka.tools.ConsoleConsumer$)

  org.apache.kafka.common.errors.InvalidTopicException: Invalid topics: [distance2 ]
Processed a total of 0 messages

As a matter of principal it seems that the reason why something is invalid should be available. How do i find the reason?

2
There seems to be a whitespace at the end of the topic name in the Exception? - mike
Ok, thats an interesting observation let me see .. - Average Bear
Yeah that seems to be it. - Average Bear
Yep thats it. Thanks - Average Bear
Unfortunately I have reached my question limit. I have installed Kafka on Ubuntu and start with systemctl. Right now I cannot get logs for connectors except by tail syslog at /var/log and I dont see the log for connectors anywhere. I did find the log4j and it seems to be configured to me to write to file but cannot see that it wrote to a file anywhere. Nor how I would listen to it in standard out. Only tail of whole syslog seems to work but its not that good for debugging. - Average Bear

2 Answers

1
votes

To provide additional information besides that in the comment section (from documentation):

The client has attempted to perform an operation on an invalid topic. For example the topic name is too long, contains invalid characters etc. This exception is not retriable because the operation won't suddenly become valid.

Valid characters are '-', '.', '_'.

0
votes

I got the same error

[WARN ] 2021-01-13 19:24:44.516 [tx.id=] [kafka-producer-network-thread | producer-1] NetworkClient - 
[Producer clientId=producer-1] Error while fetching metadata with correlation id 574 : {publish.data.dev =INVALID_TOPIC_EXCEPTION}

The error occurred due to space after the topic name in the property file i.e "publish.data.dev " Fixed after removing the space