I recently attempted to consume messages from a Kafka topic and was greeted with the following error message:
[2016-08-15 17:56:05,025] INFO Closing socket connection to /192.168.34.11. (kafka.network.Processor)
[2016-08-15 17:56:05,050] ERROR Closing socket for /127.0.0.1 because of error (kafka.network.Processor)
kafka.common.KafkaException: Wrong request type 18
at kafka.api.RequestKeys$.deserializerForKey(RequestKeys.scala:64)
at kafka.network.RequestChannel$Request.<init>(RequestChannel.scala:50)
at kafka.network.Processor.read(SocketServer.scala:450)
at kafka.network.Processor.run(SocketServer.scala:340)
at java.lang.Thread.run(Thread.java:745)
[2016-08-15 17:56:05,154] ERROR Closing socket for /127.0.0.1 because of error (kafka.network.Processor)
kafka.common.KafkaException: Wrong request type 16
at kafka.api.RequestKeys$.deserializerForKey(RequestKeys.scala:64)
at kafka.network.RequestChannel$Request.<init>(RequestChannel.scala:50)
at kafka.network.Processor.read(SocketServer.scala:450)
at kafka.network.Processor.run(SocketServer.scala:340)
at java.lang.Thread.run(Thread.java:745)
[2016-08-15 17:56:10,476] ERROR Closing socket for /127.0.0.1 because of error (kafka.network.Processor)
java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
at sun.nio.ch.IOUtil.write(IOUtil.java:65)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)
at kafka.api.TopicDataSend.writeTo(FetchResponse.scala:123)
at kafka.network.MultiSend.writeTo(Transmission.scala:101)
at kafka.api.FetchResponseSend.writeTo(FetchResponse.scala:231)
at kafka.network.Processor.write(SocketServer.scala:472)
at kafka.network.Processor.run(SocketServer.scala:342)
at java.lang.Thread.run(Thread.java:745)
As you can perhaps tell from the error message, the kafka broker is mapped to localhost - but beyond that, I can't really parse it, and it's been hard to find details on the error message "Wrong request type 18".
Anyone else have this issue?
This error tells you the client sent a request that the broker could not understand. In your particular case, the client sent a ListGroupsRequest (request code 16) and ApiVersionsRequest (request code 18).
You can get the latest list of request codes here. This list is also available here but it looks a bit outdated, as the newest version contains more API keys.
To solve this issue you need to either upgrade your brokers or use an older client.
The error seems to have gone away, but I don't think I made any changes; I'm not sure what happened exactly. Sorry for the useless question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With