Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-8053

kafka-topics.sh gives confusing error message when the topic doesn't exist

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.4.0, 2.3.1
    • None
    • None

    Description

      The kafka-topics.sh utility gives a confusing message when the topic it is called with doesn't exist or when no topics exist at all:

      bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic xxx
      Error while executing topic command : Topics in [] does not exist
      [2019-03-06 13:26:33,982] ERROR java.lang.IllegalArgumentException: Topics in [] does not exist
      at kafka.admin.TopicCommand$.kafka$admin$TopicCommand$$ensureTopicExists(TopicCommand.scala:416)
      at kafka.admin.TopicCommand$ZookeeperTopicService.describeTopic(TopicCommand.scala:332)
      at kafka.admin.TopicCommand$.main(TopicCommand.scala:66)
      at kafka.admin.TopicCommand.main(TopicCommand.scala)
      (kafka.admin.TopicCommand$)
      

      It tries to list the topics, but because list of topics is always empty, it always prints just `[]`. The error message should be more useful and instead list the topic passed by the user as the parameter or not try to list anything at all.

       

       

       

      Attachments

        Issue Links

          Activity

            People

              wyuka Tirtha Chatterjee
              scholzj Jakub Scholz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: