Hub hangs up on start

Sometimes, while running Hub on a dedicated server (including virtual machines, hosted servers, etc.) you might face a problem when Hub seems to hang up on start. Booting Hub might take up to 10 minutes or so.

We have discovered that the problem might occur when the server's entropy has been drained. Entropy is the measure of the random numbers available from /dev/urandom

Draining of the server entropy might happen on any machine without hardware sources of the entropy (for example, mouse, keyboard or a video card); that is: any dedicated server.

How to check the entropy status? For example, on a Linux machine, you can do it by running the following command:

# cat /proc/sys/kernel/random/entropy_avail

If the result is anything less than 100-200, your server has a problem with the random bits, which in its turn causes the significant delay on application start.

You can work around this problem in two ways:

1. Either use a programmatic PRNG instead of default RNG supplied by the OS. To do so, use the Java start parameter
 -Djava.security.egd=/dev/zrandom



2. Or install rng-tools package and configure it to supply /dev/urandomCheck this article describing the solution. This workaround is preferable to the first option, but, unfortunately, it is applicable only to the *nix systems.

 


In this article we have used materials from the following sources:

"Check available entropy in Linux" by Major Hayden

"Helping The Random Number Generator To Gain Enough Entropy With rng-tools (Debian Lenny)" by Falko Timme

2 comments

On my server entrpy is 1344:

$ cat /proc/sys/kernel/random/entropy_avail
1344

and yet YouTrack fails to start with: 

[YouTrack Error] Failed to start JetBrains YouTrack 2018.1 due to unexpected exception: Native random generator does not seem to have enough entropy for JetBrains YouTrack 2018.1 to start.
[YouTrack Error] You can fix it by switching to PRNG (with -Djava.security.egd=/dev/zrandom) or by reconfiguring your operation system to provide more random bits.
YouTrack process finished
Launcher is exiting
YouTrack failed to start

Thoughts?

Thanks, Kirill

Edited by Kirill Karpelson
0

i run JAR installation as a service on ubuntu, to fix this issue I had to change systemd service file this way:

  ExecStart=/usr/bin/java -Djava.security.egd=/dev/zrandom -jar /home/youtrack/youtrack.jar --J-Xmx512M 8080

0

Please sign in to leave a comment.

Have more questions?

Submit a request