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

kafka-topics.sh exits with 0 status on failures

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.8.2.1
    • 0.9.0.0
    • admin
    • None

    Description

      In the two failure cases below, kafka-topics.sh exits with status 0. You shouldn't need to parse output from the command to know if it failed or not.

      Case 1: Forgetting to add Kafka zookeeper chroot path to zookeeper spec

      $ kafka-topics.sh --alter --topic foo --config min.insync.replicas=2 --zookeeper 10.0.0.1 && echo succeeded
      succeeded

      Case 2: Bad config option. (Also, do we really need the java backtrace? It's a lot of noise most of the time.)

      $ kafka-topics.sh --alter --topic foo --config min.insync.replicasTYPO=2 --zookeeper 10.0.0.1/kafka && echo succeeded
      Error while executing topic command requirement failed: Unknown configuration "min.insync.replicasTYPO".
      java.lang.IllegalArgumentException: requirement failed: Unknown configuration "min.insync.replicasTYPO".
      at scala.Predef$.require(Predef.scala:233)
      at kafka.log.LogConfig$$anonfun$validateNames$1.apply(LogConfig.scala:183)
      at kafka.log.LogConfig$$anonfun$validateNames$1.apply(LogConfig.scala:182)
      at scala.collection.Iterator$class.foreach(Iterator.scala:727)
      at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
      at kafka.log.LogConfig$.validateNames(LogConfig.scala:182)
      at kafka.log.LogConfig$.validate(LogConfig.scala:190)
      at kafka.admin.TopicCommand$.parseTopicConfigsToBeAdded(TopicCommand.scala:205)
      at kafka.admin.TopicCommand$$anonfun$alterTopic$1.apply(TopicCommand.scala:103)
      at kafka.admin.TopicCommand$$anonfun$alterTopic$1.apply(TopicCommand.scala:100)
      at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
      at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
      at kafka.admin.TopicCommand$.alterTopic(TopicCommand.scala:100)
      at kafka.admin.TopicCommand$.main(TopicCommand.scala:57)
      at kafka.admin.TopicCommand.main(TopicCommand.scala)

      succeeded

      Attachments

        1. KAFKA-2198_2015-07-13_19:24:46.patch
          3 kB
          Manikumar
        2. KAFKA-2198_2015-07-10_23:11:23.patch
          3 kB
          Manikumar
        3. KAFKA-2198_2015-07-10_22:02:02.patch
          2 kB
          Manikumar
        4. KAFKA-2198_2015-05-19_18:41:25.patch
          2 kB
          Manikumar
        5. KAFKA-2198_2015-05-19_18:27:01.patch
          2 kB
          Manikumar
        6. KAFKA-2198.patch
          1 kB
          Manikumar

        Issue Links

          Activity

            People

              omkreddy Manikumar
              rthalley Bob Halley
              Gwen Shapira Gwen Shapira
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: