Bug 1384006

Summary: ....SessionIdGeneratorBase.createSecureRandom takes ages to execute, making installer fail waiting on Tomcat
Product: [Community] Spacewalk Reporter: Jan Hutař <jhutar>
Component: InstallationAssignee: Jan Dobes <jdobes>
Status: CLOSED EOL QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.5CC: mmraka
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-06 13:50:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
catalina.out none

Description Jan Hutař 2016-10-12 10:49:25 UTC
Description of problem:
SWnightly installation fails with "Tomcat failed to start properly or the installer ran out of tries.  Please check /var/log/tomcat*/catalina.out for errors." It takes 131 seconds to tomcat to start. Problem is in org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom taking too long.


Version-Release number of selected component (if applicable):
tomcat-8.0.36 at F24


How reproducible:
sometimes


Steps to Reproduce:
1. Install Spacewalk


Actual results:
Sometimes spacewalk-setup fails with:
# spacewalk-setup --non-interactive --answer-file=answer-file --clear-db --external-postgresql
[...]
* Restarting services.
Tomcat failed to start properly or the installer ran out of tries.  Please check /var/log/tomcat*/catalina.out for errors.
# tail -n 5 /var/log/rhn/rhn?installation.log'
Shutting down spacewalk services...
Done.
Starting spacewalk services...
Job for spacewalk.target canceled.
Done.


Expected results:
Either it should work or installer should have an option to use /dev/urandom instead, or documentation .../HowToInstall should mention what is the workaround and/or how to check if your system has enough entropy or default timeout for spacewalk.target should be increased (90 seconds by default if I understand it [1] correctly).

[1] Wait for Tomcat is performed by "/usr/lib/systemd/system/spacewalk-wait-for-tomcat.service" and that has "type=oneshot", so according to `man systemd.service`, "TimeoutSec=" is not relevant here. Where I believe it is relevant is for "/usr/lib/systemd/system/spacewalk.target" where default "DefaultTimeoutStartSec=90s" from `man systemd-system.conf` probably causes the cancel.


Additional info:
I have no idea on what would be right solution here. I'm just trying to make sure we are not bitten by this from time to time in our automation.

jdobes pointed me to explanation on https://wiki.apache.org/tomcat/HowTo/FasterStartUp - there is something about it in Entropy Source section

Comment 1 Jan Hutař 2016-10-12 10:50:20 UTC
Created attachment 1209530 [details]
catalina.out

Comment 2 Michael Mráka 2020-03-06 13:50:38 UTC
Spacewalk 2.8 (and older) has already reached it's End Of Life.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before end of life. If you would still like
to see this bug fixed and are able to reproduce it against current version
of Spacewalk 2.9, you are encouraged change the 'version' and re-open it.