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

Kafka does not properly parse multiple ZK nodes with non-root chroot

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: clients
    • Labels:

      Description

      When using a non-root ZK directory for Kafka, if you specify multiple ZK servers, Kafka does not seem to properly parse the connection string.

      Error

      [root@hodor-001 bin]# ./kafka-console-consumer.sh --zookeeper baelish-001.edh.cloudera.com:2181/kafka,baelish-002.edh.cloudera.com:2181/kafka,baelish-003.edh.cloudera.com:2181/kafka --topic test-topic
      [2014-10-01 15:31:04,629] ERROR Error processing message, stopping consumer:  (kafka.consumer.ConsoleConsumer$)
      java.lang.IllegalArgumentException: Path length must be > 0
      	at org.apache.zookeeper.common.PathUtils.validatePath(PathUtils.java:48)
      	at org.apache.zookeeper.common.PathUtils.validatePath(PathUtils.java:35)
      	at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:766)
      	at org.I0Itec.zkclient.ZkConnection.create(ZkConnection.java:87)
      	at org.I0Itec.zkclient.ZkClient$1.call(ZkClient.java:308)
      	at org.I0Itec.zkclient.ZkClient$1.call(ZkClient.java:304)
      	at org.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:675)
      	at org.I0Itec.zkclient.ZkClient.create(ZkClient.java:304)
      	at org.I0Itec.zkclient.ZkClient.createPersistent(ZkClient.java:213)
      	at org.I0Itec.zkclient.ZkClient.createPersistent(ZkClient.java:223)
      	at org.I0Itec.zkclient.ZkClient.createPersistent(ZkClient.java:223)
      	at org.I0Itec.zkclient.ZkClient.createPersistent(ZkClient.java:223)
      	at kafka.utils.ZkUtils$.createParentPath(ZkUtils.scala:245)
      	at kafka.utils.ZkUtils$.createEphemeralPath(ZkUtils.scala:256)
      	at kafka.utils.ZkUtils$.createEphemeralPathExpectConflict(ZkUtils.scala:268)
      	at kafka.utils.ZkUtils$.createEphemeralPathExpectConflictHandleZKBug(ZkUtils.scala:306)
      	at kafka.consumer.ZookeeperConsumerConnector.kafka$consumer$ZookeeperConsumerConnector$$registerConsumerInZK(ZookeeperConsumerConnector.scala:226)
      	at kafka.consumer.ZookeeperConsumerConnector$WildcardStreamsHandler.<init>(ZookeeperConsumerConnector.scala:755)
      	at kafka.consumer.ZookeeperConsumerConnector.createMessageStreamsByFilter(ZookeeperConsumerConnector.scala:145)
      	at kafka.consumer.ConsoleConsumer$.main(ConsoleConsumer.scala:196)
      	at kafka.consumer.ConsoleConsumer.main(ConsoleConsumer.scala)
      

      Working

      [root@hodor-001 bin]# ./kafka-console-consumer.sh --zookeeper baelish-001.edh.cloudera.com:2181/kafka --topic test-topic
      

        Attachments

        1. KAFKA-1664_2015-02-24_11:02:23.patch
          11 kB
          Ashish Singh
        2. KAFKA-1664_2015-01-29_10:26:20.patch
          11 kB
          Ashish Singh
        3. KAFKA-1664.2.patch
          10 kB
          Ashish Singh
        4. KAFKA-1664.1.patch
          4 kB
          Ashish Singh
        5. KAFKA-1664.patch
          1 kB
          Ashish Singh

          Activity

            People

            • Assignee:
              singhashish Ashish Singh
              Reporter:
              rickysaltzer Ricky Saltzer
              Reviewer:
              Neha Narkhede
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: