NullPointerException in tribuo-classification sample
alebaffa opened this issue · comments
Hi,
I am trying to run the tribuo-classification
sample, but I run into this problem:
- When I run the host and I start the client to send the training data (using
./gradlew client:run --args="TRAIN <signer constraint> breast-cancer.data
- which in the README is mentioned in inverted order, but I will send a PR to fix this), in the host this happens after few seconds:
(HOST terminal) $ ./gradlew host:run
.....
.....
Enclave> Training dataset size : 489
Enclave> Testing dataset size : 210
Exception in thread "main" java.net.SocketTimeoutException: Accept timed out
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
at java.net.ServerSocket.implAccept(ServerSocket.java:560)
at java.net.ServerSocket.accept(ServerSocket.java:528)
at com.r3.conclave.sample.host.Host.main(Host.java:44)
> Task :host:run FAILED
- When the step above happened, I start the client with the below command (not mentioned in the README, but I will send a PR to fix this), this happens:
./gradlew client:run --args="EVALUATE <code signer contraint>"
.....
> Task :client:run FAILED
Attempting to connect to localhost:9999
Exception in thread "main" java.io.EOFException
at java.io.DataInputStream.readInt(DataInputStream.java:392)
at com.r3.conclave.sample.client.Client.main(Client.java:116)
FAILURE: Build failed with an exception.
checking in the host I can see that this has happened:
Exception in thread "main" java.lang.NullPointerException
at org.tribuo.common.sgd.AbstractSGDTrainer.train(AbstractSGDTrainer.java:137)
at org.tribuo.common.sgd.AbstractSGDTrainer.train(AbstractSGDTrainer.java:132)
at com.r3.conclave.sample.enclave.MlEnclave.trainAndEvaluateModel(MlEnclave.java:69)
at com.r3.conclave.sample.enclave.MlEnclave.receiveMail(MlEnclave.java:57)
at com.r3.conclave.enclave.Enclave$EnclaveMessageHandler.onReceive(Enclave.kt:398)
at com.r3.conclave.enclave.Enclave$EnclaveMessageHandler.onReceive(Enclave.kt:281)
at com.r3.conclave.common.internal.handler.HandlerConnected.onReceive(HandlerConnected.kt:13)
at com.r3.conclave.common.internal.handler.MuxingHandler.onReceive(MuxingHandler.kt:18)
at com.r3.conclave.common.internal.handler.SimpleMuxingHandler.onReceive(SimpleMuxingHandler.kt:13)
at com.r3.conclave.common.internal.handler.SimpleMuxingHandler.onReceive(SimpleMuxingHandler.kt:9)
at com.r3.conclave.common.internal.handler.HandlerConnected.onReceive(HandlerConnected.kt:13)
at com.r3.conclave.common.internal.handler.ExceptionSendingHandler.onReceive(ExceptionSendingHandler.kt:21)
at com.r3.conclave.common.internal.handler.ExceptionSendingHandler.onReceive(ExceptionSendingHandler.kt:15)
at com.r3.conclave.common.internal.handler.HandlerConnected.onReceive(HandlerConnected.kt:13)
at com.r3.conclave.enclave.internal.NativeEnclaveEnvironment.enclaveEntry(NativeEnclaveEnvironment.kt:47)
at com.r3.conclave.enclave.internal.substratevm.EntryPoint.entryPoint(EntryPoint.java:17)
> Task :host:run FAILED
Is the above NullPointerException caused because the model has not been created?
Thank you!
Hi, the host times out after 60 seconds. That is why you can see the SocketTimeOut on host side. After this if you try to run the client it should give you something like this
% ./gradlew client:run --args="EVALUATE 0000000000000000000000000000000000000000000000000000000000000000"
Task :client:run
Attempting to connect to localhost:9999
Retrying: Connection refused (Connection refused)
Attempting to connect to localhost:9999
Retrying: Connection refused (Connection refused)
Attempting to connect to localhost:9999
I am trying to reproduce your error.
I managed to run this sample.
I will just send a PR to fix some unclear details in the README.
Sorry, @snedamle . Thank you for your kind support!
I am closing this issue.