anyone have any clues about this deserialisation p...
# troubleshooting
f
anyone have any clues about this deserialisation problem in flink? i've omitted some details to make the logs more concise:
Copy code
2023-08-25 16:14:17
java.io.IOException: Failed to deserialize consumer record due to
Caused by: org.apache.flink.streaming.runtime.tasks.ExceptionInChainedOperatorException: Could not forward element to next operator
...
Caused by: org.apache.flink.streaming.runtime.tasks.ExceptionInChainedOperatorException: Could not forward element to next operator
...
Caused by: com.esotericsoftware.kryo.KryoException: java.lang.UnsupportedOperationException
...
Serialization trace:
links_ (xxxxxxxxxxx.messages.common.CommonOuter$MessageMetadata)
Caused by: java.lang.UnsupportedOperationException
	at java.base/java.util.Collections$UnmodifiableCollection.add(Collections.java:1060)
	at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:109)
	at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:22)
	at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:679)
	at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:106)
	... 35 more
...
not entirely sure what operator this happens in but i think it's the first op. where i consume a message from kafka and try to serialize from bytes into a protobuf object.
lots of link on SO seem to mention i need a kyro dependency or something or other but this is typically for avro based Serde which isn't relevant in this case
i am trying to pass the GeneratedMessageV3 around in operators which i think is the problem. i have a map function to take byte[] -> GeneratedMessageV3 (the child of GeneratedMessageV3 protobuf msg not literally GeneratedMessageV3)
so i either need to configure some kind of custom serializer for this? or potentially pass around everything as bytes 😬
f
will give this a look! cheers Ari
πŸ‘ 1
not too sure where to go from here πŸ€” i think the problem seems to be passing around grpc/protobuf messages to operators and the serialisation is incompatible with Kyro
my deserializer is super simple for reading kafka records.
KafkaRecordEmitter.emitRecord(KafkaRecordEmitter.java:56)
looks like this is invoked on reading a kafka record i.e. on my KafkaSource? i have something that basically passes the message as byte[]
.setValueOnlyDeserializer(new KafkaBytesDeserializer())
which is
implements DeserializationSchema<byte[]>
. so just outputs the raw byte[] message
i've added a kyro serializer for protobuf using twitters' 'chill-protobuf' dep. no dice though so far.