You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Phil (JIRA)" <ji...@apache.org> on 2013/03/11 15:55:12 UTC
[jira] [Updated] (KAFKA-686) 0.8 Kafka broker should give a better
error message when running against 0.7 zookeeper
[ https://issues.apache.org/jira/browse/KAFKA-686?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Phil updated KAFKA-686:
-----------------------
Labels: newbie patch (was: )
Affects Version/s: 0.8
Status: Patch Available (was: Open)
While this doesn't produce a message clarifying the error, it does prevent the error in the first place. I am a novice at Scala, but I think there is a bug in ZkClient that was wrapping a null value in a Some instance--which caused the Json.parseFull to fail, as it received a null string to parse.
This patch attempts to detect the null from Zookeeper and return a tuple with None instead of Some(null).
> 0.8 Kafka broker should give a better error message when running against 0.7 zookeeper
> --------------------------------------------------------------------------------------
>
> Key: KAFKA-686
> URL: https://issues.apache.org/jira/browse/KAFKA-686
> Project: Kafka
> Issue Type: Bug
> Affects Versions: 0.8
> Reporter: Jay Kreps
> Labels: patch, newbie
> Fix For: 0.8
>
>
> People will not know that the zookeeper paths are not compatible. When you try to start the 0.8 broker pointed at a 0.7 zookeeper you get a NullPointerException. We should detect this and give a more sane error.
> Error:
> kafka.common.KafkaException: Can't parse json string: null
> at kafka.utils.Json$.liftedTree1$1(Json.scala:20)
> at kafka.utils.Json$.parseFull(Json.scala:16)
> at kafka.utils.ZkUtils$$anonfun$getReplicaAssignmentForTopics$2.apply(ZkUtils.scala:498)
> at kafka.utils.ZkUtils$$anonfun$getReplicaAssignmentForTopics$2.apply(ZkUtils.scala:494)
> at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
> at scala.collection.immutable.List.foreach(List.scala:45)
> at kafka.utils.ZkUtils$.getReplicaAssignmentForTopics(ZkUtils.scala:494)
> at kafka.controller.KafkaController.initializeControllerContext(KafkaController.scala:446)
> at kafka.controller.KafkaController.onControllerFailover(KafkaController.scala:220)
> at kafka.controller.KafkaController$$anonfun$1.apply$mcV$sp(KafkaController.scala:85)
> at kafka.server.ZookeeperLeaderElector.elect(ZookeeperLeaderElector.scala:53)
> at kafka.server.ZookeeperLeaderElector.startup(ZookeeperLeaderElector.scala:43)
> at kafka.controller.KafkaController.startup(KafkaController.scala:381)
> at kafka.server.KafkaServer.startup(KafkaServer.scala:90)
> at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:34)
> at kafka.Kafka$.main(Kafka.scala:46)
> at kafka.Kafka.main(Kafka.scala)
> Caused by: java.lang.NullPointerException
> at scala.util.parsing.combinator.lexical.Scanners$Scanner.<init>(Scanners.scala:52)
> at scala.util.parsing.json.JSON$.parseRaw(JSON.scala:71)
> at scala.util.parsing.json.JSON$.parseFull(JSON.scala:85)
> at kafka.utils.Json$.liftedTree1$1(Json.scala:17)
> ... 16 more
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira