Bug 1446364 - pkispawn returns before tomcat is ready
Summary: pkispawn returns before tomcat is ready
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pki-core
Version: 7.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Christian Heimes
QA Contact: Asha Akkiangady
Marc Muehlfeld
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-27 18:23 UTC by Matthew Harmsen
Modified: 2020-10-04 21:25 UTC (History)
3 users (show)

Fixed In Version: pki-core-10.4.1-4.el7
Doc Type: Bug Fix
Doc Text:
Subsequent PKI installation no longer fails Previously, when installing multiple public key infrastructure (PKI) instances in batch mode, the installation script did not wait until the CA instance was restarted. As a consequence, the installation of subsequent PKI instances could fail. The script has been updated and now waits until the new subsystem is ready to handle requests before it continues.
Clone Of:
Environment:
Last Closed: 2017-08-01 22:50:57 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github dogtagpki pki issues 2764 0 None None None 2020-10-04 21:25:56 UTC
Red Hat Product Errata RHBA-2017:2110 0 normal SHIPPED_LIVE pki-core bug fix and enhancement update 2017-08-01 19:36:59 UTC

Description Matthew Harmsen 2017-04-27 18:23:47 UTC
This bug is created as a clone of upstream ticket:
https://pagure.io/dogtagpki/issue/2644

While I was working on Travis CI tests, I noticed that ```pkispawn -s KRA``` was failing regularly. It looks like ```pkispawn -s CA``` returns before the tomcat instance is ready to serve requests. Travis CI spawn a KRA directly after CA with no delay. Tests are now using a polling loop with curl and sleep. It usually takes 2 to 3 seconds until ```curl http://localhost:8080``` works.

## errors
```
$ pkispawn -f /tmp/workdir/pki/.travis/pki.cfg -s KRA
Log file: /var/log/pki/pki-kra-spawn.20170418062853.log
Loading deployment configuration from /tmp/workdir/pki/.travis/pki.cfg.
ERROR:  Unable to access security domain: HTTPSConnectionPool(host='pki.test', port=8443): Max retries exceeded with url: /ca/rest/securityDomain/domainInfo (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f05cedb3210>: Failed to establish a new connection: [Errno 111] Connection refused',))
```

## suggested solution

pkispawn should use ```wait_for_startup``` to wait until Tomcat is ready before it exits.

Comment 2 Matthew Harmsen 2017-05-08 18:14:58 UTC
cheimes made the following check-in:

commit c0bb0ee8e36a85673e30352a7205414b215196a5
Author: Christian Heimes <cheimes>
Date:   Mon May 8 18:53:26 2017 +0200

    pkispawn: wait after final restart
    
    The finalization scriptlet now waits after service has been restarted.
    
    Change-Id: Id462728386b9d7e6b3364e1651ef6676115dd1de
    Bugzilla: BZ#1446364
    Pagure: 2644
    Signed-off-by: Christian Heimes <cheimes>

Comment 4 Amol K 2017-06-15 13:23:16 UTC
I tested this bug on pki 10.4.1-8.el7 version. 

I did not encounter any problem like "Connection failed".

Verifying this bug.

Comment 6 errata-xmlrpc 2017-08-01 22:50:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2110


Note You need to log in before you can comment on or make changes to this bug.