1

Hello Corda team/Roger,

I have implemented custom schema based on the example of Yo schema, however i am getting Kyro exception with message Buffer underflow.

I have added @cordaseriliazation annotation in Schema class as well as entity class which extends PersistentStateRef

In Plugin Registry class, I have overriden this method:

@Override
public boolean customizeSerialization(SerializationCustomization kryo) {
        kryo.addToWhitelist(PersistentStateRef.class);
      return true;
}

Here is the stacktrace:

[ERROR] 2017-07-21T14:52:51,407 [Thread-0 (ActiveMQ-client-global-threads)] core.client.run - AMQ214000: Failed to call onMessage
com.esotericsoftware.kryo.KryoException: Buffer underflow.
    at com.esotericsoftware.kryo.io.Input.require(Input.java:199) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.io.Input.readVarInt(Input.java:373) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:127) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:693) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.DefaultArraySerializers$ObjectArraySerializer.read(DefaultArraySerializers.java:389) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.DefaultArraySerializers$ObjectArraySerializer.read(DefaultArraySerializers.java:303) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:134) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:40) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813) ~[kryo-4.0.0.jar:?]
    at net.corda.core.serialization.KryoKt$deserialize$1$1.execute(Kryo.kt:109) ~[corda-core-0.13.0.jar:?]
    at com.esotericsoftware.kryo.pool.KryoPoolQueueImpl.run(KryoPoolQueueImpl.java:61) ~[kryo-4.0.0.jar:?]
    at net.corda.core.serialization.KryoKt.deserialize(Kryo.kt:109) ~[corda-core-0.13.0.jar:?]
    at net.corda.nodeapi.RPCApi$ClientToServer$Companion.fromClientMessage(RPCApi.kt:124) ~[corda-node-api-0.13.0.jar:?]
    at net.corda.node.services.messaging.RPCServer.clientArtemisMessageHandler(RPCServer.kt:264) ~[corda-node-0.13.0.jar:?]
    at net.corda.node.services.messaging.RPCServer.access$clientArtemisMessageHandler(RPCServer.kt:76) ~[corda-node-0.13.0.jar:?]
    at net.corda.node.services.messaging.RPCServer$createConsumerSessions$1.invoke(RPCServer.kt:190) ~[corda-node-0.13.0.jar:?]
    at net.corda.node.services.messaging.RPCServer$createConsumerSessions$1.invoke(RPCServer.kt:76) ~[corda-node-0.13.0.jar:?]
    at net.corda.node.services.messaging.RPCServerKt$sam$MessageHandler$086628f7.onMessage(RPCServer.kt) ~[corda-node-0.13.0.jar:?]
    at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:997) ~[artemis-core-client-2.1.0.jar:2.1.0]
    at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.access$400(ClientConsumerImpl.java:49) ~[artemis-core-client-2.1.0.jar:2.1.0]
    at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1120) [artemis-core-client-2.1.0.jar:2.1.0]
    at org.apache.activemq.artemis.utils.OrderedExecutorFactory$OrderedExecutor$ExecutorTask.run(OrderedExecutorFactory.java:101) [artemis-commons-2.1.0.jar:2.1.0]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_131]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_131]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
Joel
  • 22,762
  • 5
  • 26
  • 41
  • A few questions: 1. Could you tell us which version of Corda you are running (e.g. by running `git branch` from the root of the project)? 2. Can you confirm this error disappears if you comment out the schema? 3. What are you doing when this error occurs? – Joel Jul 25 '17 at 11:25
  • 1. Corda M13 2. yes 3. Node is raising exception on execution of flow, and REST API is not giving any result. it's just hanging. same case when i ran junit. junit is just hang for indefinite time. – Chintan Kansara Jul 25 '17 at 14:06
  • Does this happen if you run the flow directly via RPC instead of the API? It appears it may be related to https://stackoverflow.com/questions/24484022/kryo-deserialization-fails-with-kryoexception-buffer-underflow. Try running it via the node shell using `flow start myFlowName`. – Joel Jul 25 '17 at 15:45
  • 1) i haven't tried with RPC. i have tried with Junit and running actual node. 2) that stack post is very different 3) same error while running node shell – Chintan Kansara Jul 26 '17 at 09:09
  • Same error message here when trying to connect the ExampleClientRPC.java to the node of PartyC in the IOU example cordapp. Corda V3.2. – thorstenhirsch Aug 15 '18 at 23:34

1 Answers1

0

This definitely seems like it was an issue in the corda flow processing given it was presenting AMQP errors.

I'd take another look at what's happening when you run flows that use this schema in the latest version of corda and see if they give similar issues.

If you continue to face it it's probably a Corda bug and not you, you can report issues to corda on here: https://github.com/corda/corda/issues

davidawad
  • 1,023
  • 11
  • 20