java.lang.IllegalArgumentException: Path length must be > 0

Apache's JIRA Issue Tracker | Ricky Saltzer | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    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* {code} [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) {code} *Working* {code} [root@hodor-001 bin]# ./kafka-console-consumer.sh --zookeeper baelish-001.edh.cloudera.com:2181/kafka --topic test-topic {code}

    Apache's JIRA Issue Tracker | 2 years ago | Ricky Saltzer
    java.lang.IllegalArgumentException: Path length must be > 0
  2. 0

    When starting Kafka 0.7.0 using zkclient-0.1.jar, I get this error: INFO 2012-03-06 02:39:04,072 main kafka.server.KafkaZooKeeper Registering broker /brokers/ids/1 FATAL 2012-03-06 02:39:04,111 main kafka.server.KafkaServer Fatal error during startup. 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:620) 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 kafka.utils.ZkUtils$.createParentPath(ZkUtils.scala:48) at kafka.utils.ZkUtils$.createEphemeralPath(ZkUtils.scala:60) at kafka.utils.ZkUtils$.createEphemeralPathExpectConflict(ZkUtils.scala:72) at kafka.server.KafkaZooKeeper.registerBrokerInZk(KafkaZooKeeper.scala:57) at kafka.log.LogManager.startup(LogManager.scala:124) at kafka.server.KafkaServer.startup(KafkaServer.scala:80) at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:47) at kafka.Kafka$.main(Kafka.scala:60) at kafka.Kafka.main(Kafka.scala) The problem seems to be this code in ZkClient's createPersistent method: String parentDir = path.substring(0, path.lastIndexOf('/')); createPersistent(parentDir, createParents); createPersistent(path, createParents); which doesn't check for whether parentDir is an empty string, which it will become for /brokers/ids/1 after two recursions.

    Apache's JIRA Issue Tracker | 5 years ago | Thomas Dudziak
    java.lang.IllegalArgumentException: Path length must be > 0
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Why is the Kafka Messaging Modular Input not working on a Splunk 6.2.3 Universal Forwarder? - Question | Splunk Answers

    splunk.com | 2 years ago
    java.lang.IllegalArgumentException: Invalid path string "/consumers//ids/_kafka-dev-290687-1433235975245-76b9eb2e" caused by empty node name specified @11
  5. 0

    Why is the Kafka Messaging Modular Input not working on a Splunk 6.2.3 Universal Forwarder? - Question | Splunk Answers

    splunk.com | 2 years ago
    java.lang.IllegalArgumentException: Invalid path string "/consumers//ids/_kafka-dev-290687-1433235975245-76b9eb2e" caused by empty node name specified @11

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Path length must be > 0

      at org.apache.zookeeper.common.PathUtils.validatePath()
    2. Zookeeper
      ZooKeeper.create
      1. org.apache.zookeeper.common.PathUtils.validatePath(PathUtils.java:48)
      2. org.apache.zookeeper.common.PathUtils.validatePath(PathUtils.java:35)
      3. org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:766)
      3 frames
    3. ZooKeeper Client
      ZkClient.createPersistent
      1. org.I0Itec.zkclient.ZkConnection.create(ZkConnection.java:87)
      2. org.I0Itec.zkclient.ZkClient$1.call(ZkClient.java:308)
      3. org.I0Itec.zkclient.ZkClient$1.call(ZkClient.java:304)
      4. org.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:675)
      5. org.I0Itec.zkclient.ZkClient.create(ZkClient.java:304)
      6. org.I0Itec.zkclient.ZkClient.createPersistent(ZkClient.java:213)
      7. org.I0Itec.zkclient.ZkClient.createPersistent(ZkClient.java:223)
      8. org.I0Itec.zkclient.ZkClient.createPersistent(ZkClient.java:223)
      9. org.I0Itec.zkclient.ZkClient.createPersistent(ZkClient.java:223)
      9 frames
    4. Apache Kafka
      ConsoleConsumer.main
      1. kafka.utils.ZkUtils$.createParentPath(ZkUtils.scala:245)
      2. kafka.utils.ZkUtils$.createEphemeralPath(ZkUtils.scala:256)
      3. kafka.utils.ZkUtils$.createEphemeralPathExpectConflict(ZkUtils.scala:268)
      4. kafka.utils.ZkUtils$.createEphemeralPathExpectConflictHandleZKBug(ZkUtils.scala:306)
      5. kafka.consumer.ZookeeperConsumerConnector.kafka$consumer$ZookeeperConsumerConnector$$registerConsumerInZK(ZookeeperConsumerConnector.scala:226)
      6. kafka.consumer.ZookeeperConsumerConnector$WildcardStreamsHandler.<init>(ZookeeperConsumerConnector.scala:755)
      7. kafka.consumer.ZookeeperConsumerConnector.createMessageStreamsByFilter(ZookeeperConsumerConnector.scala:145)
      8. kafka.consumer.ConsoleConsumer$.main(ConsoleConsumer.scala:196)
      9. kafka.consumer.ConsoleConsumer.main(ConsoleConsumer.scala)
      9 frames