Low Entropy Error Stops Daml Start

My system is not executing daml start consistently and now, seems to be failing it more than not. Error trace below:

quid@rvnmn02 ~/Projects/daml/code/fruitshop daml start
Compiling fruitshop to a DAR.
Created .daml/dist/fruitshop-0.0.1.dar
Waiting for sandbox to start: 
17:01:15.690 [sandbox-akka.actor.default-dispatcher-4] INFO  akka.event.slf4j.Slf4jLogger - Slf4jLogger started
17:01:21.297 [Timer-0] WARN  c.d.platform.apiserver.SeedService$ - Trying to gather entropy from the underlying operating system to initialized the contract ID seeding, but the entropy pool seems empty.
17:01:21.298 [Timer-0] WARN  c.d.platform.apiserver.SeedService$ - In CI environments environment consider using the "testing-weak" mode, that may produce insecure contract IDs but does not block on startup.
Port file was not written to in time.
17:03:24.877 [Thread-1] ERROR com.daml.resources.ProgramResource - Failed to stop successfully.
java.util.concurrent.TimeoutException: Future timed out after [10 seconds]
	at scala.concurrent.impl.Promise$DefaultPromise.tryAwait0(Promise.scala:212)
	at scala.concurrent.impl.Promise$DefaultPromise.result(Promise.scala:225)
	at scala.concurrent.Await$.$anonfun$result$1(package.scala:201)
	at scala.concurrent.BlockContext$DefaultBlockContext$.blockOn(BlockContext.scala:62)
	at scala.concurrent.Await$.result(package.scala:124)
	at com.daml.resources.ProgramResource.stop$1(ProgramResource.scala:39)
	at com.daml.resources.ProgramResource.$anonfun$run$5(ProgramResource.scala:47)
	at java.base/java.lang.Thread.run(Thread.java:829)

I have even killed all Daml/Java processes and rebooted.

No difference.

2 Likes

The warning about no “entropy” available may be the culprit, as you timeout on initialization. Check your system’s random number generator config or use the recommended testing-weak option for the sandbox. (in daml.yaml, define sandbox-options: testing-weak)

1 Like

Thank you. I modified the app/daml.yaml and

sandbox-options:
  - --wall-clock-time
  - --testing-weak

Still fails:

Error: Unknown option --testing-weak
Try --help for more information.

According to config-file-daml-yaml that should be the correct format.

" * sandbox-options : a list of options that will be passed to Sandbox in daml start ."

daml sandbox --help | less | grep weak
Set the seeding mode of contract IDs. Possible values are strong, \
testing-weak, testing-static. "strong" mode is not compatible with \
development mode. Default is "strong".

Unless I am reading this incorrectly?

I fail to see how the two are related. If they are not, can you please create a question for each? Tracking two problems in a single thread is bound to confuse anybody wishing to help (or read the solution afterwards).

1 Like

Sorry the correct format for the option is:

sandbox-options:
  - --contract-id-seeding=testing-weak
2 Likes

Thank you for the reminder :+1:t2:

I removed the Contract issue from this thread,
will post it seperately.

Hey @Mate_Varga After booting this morning, I applied that edit to daml.yaml and it worked immediately, so thank you :+1:t2:

That said, I will need to address the core system issue: low Entropy pool, however I do have a solution after reading last night.

Just out of curiosity what kind of system are you using here? I’m interested in the CPU designation as the TRNGs nowadays are usually integrated.

What is the output of running the following command (I assume you are using GNU/Linux)?
cat /proc/sys/kernel/random/entropy_avail

1 Like

Haha, currently only 1650.

I will run the app a few times and see if/how that changes. It seems that this was a known issue with older Linux Kernels than 5.01.

  • OS: Ubuntu 18.04 LTS 64-bit
  • Kernel: 4.15.0-159-generic

Will do some reading to see if it is worth the effort of installing a newer Kernel ← it is not.

UPDATE: I upgraded Ubuntu 16.04 LTS > 18.04 LTS > 20.04 LTS, the issue seems to have gone away but a better solution is to hos any Daml app I create on my local Canton Ledger.

1 Like