Yolean/kubernetes-kafka

No entry found for connection 0

vnbx opened this issue · 3 comments

vnbx commented

This is a wonderful project!

I've got all the goodies up and running, however my clients are getting the below error. This seems to indicate some issue with "listeners" but I haven't changed the config from what you have. in 10broker-config.yml

I am only using clusterIP atm and am testing with a port-forward using the kafka command.
./kafka-console-producer.sh --broker-list localhost:9092 --topic test

[2019-02-22 13:08:23,994] ERROR [Producer clientId=console-producer] Uncaught error in kafka producer I/O thread:  (org.apache.kafka.clients.producer.internals.Sender)
java.lang.IllegalStateException: No entry found for connection 0
	at org.apache.kafka.clients.ClusterConnectionStates.nodeState(ClusterConnectionStates.java:330)
	at org.apache.kafka.clients.ClusterConnectionStates.disconnected(ClusterConnectionStates.java:134)
	at org.apache.kafka.clients.NetworkClient.initiateConnect(NetworkClient.java:885)
	at org.apache.kafka.clients.NetworkClient.access$700(NetworkClient.java:65)
	at org.apache.kafka.clients.NetworkClient$DefaultMetadataUpdater.maybeUpdate(NetworkClient.java:1050)
	at org.apache.kafka.clients.NetworkClient$DefaultMetadataUpdater.maybeUpdate(NetworkClient.java:935)
	at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:519)
	at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:309)
	at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:233)
	at java.lang.Thread.run(Thread.java:748)

I am only using clusterIP atm and am testing with a port-forward using the kafka command.

Port-forward is very tricky. You need to be able to use the same names locally that brokers have as DNS names in the cluster. Or have a dedicated listener. In any case you must port-forward all your brokers.

I recommend instead for testing that you exec -ti into a container that has a kafka client. Start a dedicated one, for example with the kafka image or with kafkacat.

vnbx commented

This is actually working fine when I am not using port-forward. Thanks for the help!