I am getting the following issue when I perform the gradle clean deployNodes
command on AWS Ubuntu machine for Corda project:
Error while generating node info files
I am using Corda ENT libs.
And interestingly the same corda project works on the Windows machine but fails on AWS machine.
JDK 1.8.181 and gradle 4.10.2 on AWS and windows machine.
It asks to check logs files but logs show nothing related to any error ...
Can you please help with this issue?
It's giving an exception for:
if (!process.waitFor(3, TimeUnit.MINUTES)) {
process.destroyForcibly()
throw IllegalStateException("Error while generating node info file. Please check the logs in $logsDir.")
}
I figured out that this code block from above mention method is always throwing an exception when time taken by deployNodes task goes beyond 3 minutes.
I am having 8 nodes in my corda network and I am trying to build those nodes using gradle clean deployNodes command.
Can anyone help on this?
Caused by: java.lang.IllegalStateException: Error while generating node info file. Please check the logs in /home/ubuntu/xxx/build/nodes/nodeA/logs. at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion.generateNodeInfo(NetworkBootstrapper.kt:112) at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion.access$generateNodeInfo(NetworkBootstrapper.kt:71) at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion$generateNodeInfos$1$1.invoke(NetworkBootstrapper.kt:95) at net.corda.nodeapi.internal.network.NetworkBootstrapper$Companion$generateNodeInfos$1$1.invoke(NetworkBootstrapper.kt:71) at net.corda.core.internal.concurrent.ValueOrException$DefaultImpls.capture(CordaFutureImpl.kt:140) at net.corda.core.internal.concurrent.OpenFuture$DefaultImpls.capture(CordaFutureImpl.kt) at net.corda.core.internal.concurrent.CordaFutureImpl.capture(CordaFutureImpl.kt:152)
As suggested by Cais and Stefano below is the answer to above question.
Use these steps to configure the JVM to use /dev/urandom :-
Open the $JAVA_HOME/jre/lib/security/java.security file in a text editor.
on my machine it's
/usr/lib/jvm/java-8-oracle/jre/lib/security/java.security
Change the line “securerandom.source=file:/dev/random”
to read: securerandom.source=file:/dev/./urandom
Save your change and exit the text editor.
And because there’s a bug in JDK when you use /dev/urandom you have to set it up as /dev/./urandom
Alternatively you can use :-
You can also set up system property “java.security.egd” which will override the securerandom.source setting. -Djava.security.egd=file:/dev/./urandom
on the command line when you run the bootstrapper pass:
-Djava.security.egd=file:/dev/./urandom
Check below URL for more info.
http://ruleoftech.com/2016/avoiding-jvm-delays-caused-by-random-number-generation