Hi Tim,
sorry for the long delay. I worked around the problem by either working without network or by not using runAll. I've collected some further insides and the problem might be related to macos adding the network's domain to the hostname and kafka not being able to startup the broker properly.
I've seen the exact same issue on a colleagues MacBook.
Here's what I've found:
- Unplug network, disable wifi, sbt clean, sbt runAll --> everything is working fine
- With network, sbt clean:
I'm getting the following errors in kafka's controller.log in /target/lagom-dynamic-projects/lagom-internal-meta-project-kafka/target/log4j_output
[2018-03-23 09:19:58,610] WARN [Controller-0-to-broker-0-send-thread]: Controller 0's connection to broker thomass-mbp.fritz.box:9092 (id: 0 rack: null) was unsuccessful (kafka.controller.RequestSendThread)
java.io.IOException: Connection to thomass-mbp.fritz.box:9092 (id: 0 rack: null) failed.
at org.apache.kafka.clients.NetworkClientUtils.awaitReady(NetworkClientUtils.java:68)
at kafka.controller.RequestSendThread.brokerReady(ControllerChannelManager.scala:264)
at kafka.controller.RequestSendThread.doWork(ControllerChannelManager.scala:218)
at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:64)
[2018-03-23 09:19:58,713] WARN [Controller-0-to-broker-0-send-thread]: Controller 0's connection to broker thomass-mbp.fritz.box:9092 (id: 0 rack: null) was unsuccessful (kafka.controller.RequestSendThread)
java.io.IOException: Connection to thomass-mbp.fritz.box:9092 (id: 0 rack: null) failed.
at org.apache.kafka.clients.NetworkClientUtils.awaitReady(NetworkClientUtils.java:68)
at kafka.controller.RequestSendThread.brokerReady(ControllerChannelManager.scala:264)
at kafka.controller.RequestSendThread.doWork(ControllerChannelManager.scala:218)
at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:64)
And in kafka's server.log:
[2018-03-23 09:20:29,902] ERROR [KafkaApi-0] Number of alive brokers '0' does not meet the required replication factor '1' for the offsets topic (configured via 'offsets.topic.replication.factor'). This error can be ignored if the cluster is starting up and not all brokers are up yet. (kafka.server.KafkaApis)
[2018-03-23 09:20:29,953] ERROR [KafkaApi-0] Number of alive brokers '0' does not meet the required replication factor '1' for the offsets topic (configured via 'offsets.topic.replication.factor'). This error can be ignored if the cluster is starting up and not all brokers are up yet. (kafka.server.KafkaApis)
[2018-03-23 09:20:30,110] ERROR [KafkaApi-0] Number of alive brokers '0' does not meet the required replication factor '1' for the offsets topic (configured via 'offsets.topic.replication.factor'). This error can be ignored if the cluster is starting up and not all brokers are up yet. (kafka.server.KafkaApis)
Both errors repeat for a while and eventually after a couple of minutes they stop and kafka seems to be up and running fine. Without network it's just a matter of seconds. However then I've got all sorts of errors as mentioned earlier in the sbt runAll console. It's a bit difficult to isolate the problems as the behaviour is not always exactly the same. Adding my hostname with the domain to /etc/hosts didn't help. netcat shows that connecting thomass-mbp.fritz.box:9092 works just fine. And after a while kafka seems to be able to connect, too. Sometimes the microservices work as expected then. Sometimes they don't.
Adding: lagomKafkaAddress in ThisBuild := "localhost:9092"
to build.sbt also didn't help and kafka still seems to use the hostname + domain internally.
I'd love to provide you more consistent information, but as the behaviour changes (probably depending on timing) it's tough. If you like to have a look yourself am happy to do a screenshare.
Cheers,
Thomas