java.lang.RuntimeException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • GitHub comment 569#275227478
    via GitHub by hyperlink
    ,
  • GitHub comment 72#180098171
    via GitHub by wurstmeister
    ,
  • broker is already registered - fatal on startup
    via by Hisham Mardam-Bey,
  • Re: broker is already registered - fatal on startup
    via by Hisham Mardam-Bey,
  • Sometimes, broker startup fails with the following exception [2011-10-03 15:33:22,193] INFO Awaiting connections on port 9092 (kafka.network.Acceptor) [2011-10-03 15:33:22,193] INFO Registering broker /brokers/ids/0 (kafka.server.KafkaZooKeeper) [2011-10-03 15:33:22,229] INFO conflict in /brokers/ids/0 data: 10.98.20.109-1317681202194:10.98.20.109:9092 stored data: 10.98.20.109-1317268078266:10.98.20.109:9092 (kafka.utils.ZkUtils$) [2011-10-03 15:33:22,230] FATAL org.I0Itec.zkclient.exception.ZkNodeExistsException: org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists for /brokers/ids/0 (kafka.server.KafkaServer) [2011-10-03 15:33:22,231] FATAL org.I0Itec.zkclient.exception.ZkNodeExistsException: org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists for /brokers/ids/0 at org.I0Itec.zkclient.exception.ZkException.create(ZkException.java:55) at org.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:685) at org.I0Itec.zkclient.ZkClient.create(ZkClient.java:304) at org.I0Itec.zkclient.ZkClient.createEphemeral(ZkClient.java:328) at kafka.utils.ZkUtils$.createEphemeralPath(ZkUtils.scala:55) at kafka.utils.ZkUtils$.createEphemeralPathExpectConflict(ZkUtils.scala:71) at kafka.server.KafkaZooKeeper.registerBrokerInZk(KafkaZooKeeper.scala:54) at kafka.log.LogManager.startup(LogManager.scala:122) at kafka.server.KafkaServer.startup(KafkaServer.scala:77) at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:40) at kafka.Kafka$.main(Kafka.scala:56) at kafka.Kafka.main(Kafka.scala) Caused by: org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists for /brokers/ids/0 at org.apache.zookeeper.KeeperException.create(KeeperException.java:110) at org.apache.zookeeper.KeeperException.create(KeeperException.java:42) at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:637) 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) ... 10 more (kafka.server.KafkaServer) [2011-10-03 15:33:22,231] INFO Shutting down... (kafka.server.KafkaServer) [2011-10-03 15:33:22,232] INFO shutdown scheduler kafka-logcleaner- (kafka.utils.KafkaScheduler) [2011-10-03 15:33:22,239] INFO shutdown scheduler kafka-logflusher- (kafka.utils.KafkaScheduler) [2011-10-03 15:33:22,481] INFO zkActor stopped (kafka.log.LogManager) [2011-10-03 15:33:22,482] INFO Closing zookeeper client... (kafka.server.KafkaZooKeeper) [2011-10-03 15:33:22,482] INFO Terminate ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread) There could be 3 things that might have happened (1) you restarted kafka within the zk timeout, in which case as far as zk is concerned your old broker still exists...this is weird but actually correct behavior, (2) you have two brokers with the same id, (3) zk has a bug and is not deleting ephemeral nodes. Instead of just throwing the ZK NodeExistsException, we should include the above information in a well-named Kafka exception, for clarity.
    via by Neha Narkhede,
  • 1. Install Ambari with 3 nodes, example hostname01, hostname02, hostname03 2. Install Kafka service on hostname03. Kafka starts successfully 3. Go to hostname02 and add Kafka Broker. Start kafka broker and it will fail with below error: {code} [2015-08-05 17:13:51,306] FATAL Fatal error during KafkaServerStartable startup. Prepare to shutdown (kafka.server.KafkaServerStartable) java.lang.RuntimeException: A broker is already registered on the path /brokers/ids/0. This probably indicates that you either have configured a brokerid that is already in use, or else you have shutdown this broker and restarted it faster than the zookeeper timeout so it appears to be re-registering. at kafka.utils.ZkUtils$.registerBrokerInZk(ZkUtils.scala:174) at kafka.server.KafkaHealthcheck.register(KafkaHealthcheck.scala:58) at kafka.server.KafkaHealthcheck.startup(KafkaHealthcheck.scala:45) at kafka.server.KafkaServer.startup(KafkaServer.scala:124) at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:29) at kafka.Kafka$.main(Kafka.scala:46) at kafka.Kafka.main(Kafka.scala) {code} The 2nd broker added on hostname02 failed to start because it was assigned the same brokerid as the broker installed on hostname03. The brokerid is assigned to a broker in kafka.py: {code} brokerid = str(sorted(params.kafka_hosts).index(params.hostname)) kafka_server_config['broker.id'] = brokerid {code} params.py gets the kafka_hosts from clusterHostInfo: {code} kafka_hosts = config['clusterHostInfo']['kafka_broker_hosts'] {code} clusterHostInfo maintains the list of kafka brokers in order: {code} "kafka_broker_hosts": [ "hostname02", "hostname03" ], {code} Since the brokerid is the index of the hostname, and the broker on hostname03 was added first, it was at index 0. After adding a new broker on hostname02, it was inserted to the list at index 0 and hostname03 was moved to index 1. Because the broker on hostname03 was not restarted, it was still running with brokerid 0, so the broker on hostname02 with brokerid 0 was unable to start. Workaround: Restart all brokers
    via by Carita Ou,
  • error while starting kafka broker
    via Stack Overflow by brain storm
    ,
    • java.lang.RuntimeException: A broker is already registered on the path /brokers/ids/1001. This probably indicates that you either have configured a brokerid that is already in use, or else you have shutdown this broker and restarted it faster than the zookeeper timeout so it appears to be re-registering. at kafka.utils.ZkUtils.registerBrokerInZk(ZkUtils.scala:295) at kafka.utils.ZkUtils.registerBrokerInZk(ZkUtils.scala:281) at kafka.server.KafkaHealthcheck.register(KafkaHealthcheck.scala:64) at kafka.server.KafkaHealthcheck.startup(KafkaHealthcheck.scala:45) at kafka.server.KafkaServer.startup(KafkaServer.scala:231) at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:37) at kafka.Kafka$.main(Kafka.scala:67) at kafka.Kafka.main(Kafka.scala)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,