Getting Invalid version for API key when writing a ProducerInterceptor.

2,606 views
Skip to first unread message

Sagar Rao

unread,
Oct 20, 2016, 4:27:59 AM10/20/16
to Confluent Platform
Hi,

I have written a ProducerIntercpetor for kafka-connect which basically tries to set some keys to each message that is sent to kafka. Currently, kafka-connect-jdbc sends nulls as keys and this is one of the workarounds that we found.

Right now, I have used the 3.2.0-SNAPSHOT because we needed some customizations to the jar. However, once I enable the Intercpetor in the connect properties, I keep getting the folloiwng error in the kafka logs
kafka.network.InvalidRequestException: Error getting request for apiKey: 3 and apiVersion: 2
at kafka.network.RequestChannel$Request.liftedTree2$1(RequestChannel.scala:95)
at kafka.network.RequestChannel$Request.<init>(RequestChannel.scala:87)
at kafka.network.Processor$$anonfun$processCompletedReceives$1.apply(SocketServer.scala:488)
at kafka.network.Processor$$anonfun$processCompletedReceives$1.apply(SocketServer.scala:483)
at scala.collection.Iterator$class.foreach(Iterator.scala:893)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
at kafka.network.Processor.processCompletedReceives(SocketServer.scala:483)
at kafka.network.Processor.run(SocketServer.scala:413)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: Invalid version for API key 3: 2
at org.apache.kafka.common.protocol.ProtoUtils.schemaFor(ProtoUtils.java:31)
at org.apache.kafka.common.protocol.ProtoUtils.requestSchema(ProtoUtils.java:44)
at org.apache.kafka.common.protocol.ProtoUtils.parseRequest(ProtoUtils.java:60)
at org.apache.kafka.common.requests.MetadataRequest.parse(MetadataRequest.java:96)
at org.apache.kafka.common.requests.AbstractRequest.getRequest(AbstractRequest.java:48)
at kafka.network.RequestChannel$Request.liftedTree2$1(RequestChannel.scala:92)
If I remove the interceptor then things work properly. .. 

Sagar Rao

unread,
Oct 21, 2016, 10:51:34 AM10/21/16
to Confluent Platform
Hi any suggestions on this? It would be helpful for us.

Ewen Cheslack-Postava

unread,
Oct 25, 2016, 2:06:11 AM10/25/16
to Confluent Platform
Newer versions of clients aren't guaranteed to be compatible with older versions of the broker, so this type of error should be expected if your broker isn't also on a 3.2.0-SNAPSHOT version.

Are you using a modified version of Kafka Connect JDBC that is causing the issue? When packaged properly it should not pull in any Kafka libraries (it only needs its own jar and the JDBC drivers). It looks like you may have also pulled in SNAPSHOT versions of the Kafka clients (and maybe Connect).

-Ewen

--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/a2f7471d-831d-4021-9839-13a590f229b9%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Thanks,
Ewen
Reply all
Reply to author
Forward
0 new messages