I have a Java backend which uses Spring Boot Actuator but it won\'t start on Digitalocean Ubuntu VPS. The same application runs well on my Mac and on an other Ubuntu PC.
The accepted answer didn't work for me. So I found this answer which did:
Spring-boot application wont boot at startup inside docker
apt-get install haveged -y
localhost-startStop-1
is trying to create a new instance of SecureRandom
and it's stuck trying to read data from an entropy source. This typically occurs because the source has been depleted. The default entropy source is /dev/random
. It's known as a blocking source as it will block when an attempt is made to read random data and none is available. Another source on Linux is /dev/urandom
. Its main benefit over /dev/random
is that it's non-blocking. There's some debate over whether or not using /dev/urandom
will make things less secure. This article may be of interest.
In summary, using /dev/urandom
will avoid the problem you're seeing, at the possible cost of decreased security. You can configure Spring Boot's embedded Tomcat instance to use /dev/urandom
via a system property:
-Djava.security.egd=file:/dev/./urandom