#2789 FixDeploymentDescriptor upgrade scriptlet can fail
Closed: fixed Opened by ftweedal.

Description of problem:

When upgrading from RHEL 7.1, pki-server-upgrade fails.

Contents of /var/log/pki/pki-server-upgrade-10.4.1.log:

Upgrading PKI server configuration at Thu Aug  3 03:46:16 EDT 2017.
Upgrading from version 10.1.2 to 10.1.99:
1. Add TLS Range Support
Upgrading from version 10.1.99 to 10.2.0:
1. Move web application context file
2. Replace Jettison with Jackson
3. Added RESTEasy client
4. Replace RESTEasy application class
5. Remove config path from web.xml
Upgrading from version 10.2.0 to 10.2.1:
No upgrade scriptlets.
Tracker has been set to version 10.2.1.
Upgrading from version 10.2.1 to 10.2.2:
1. Add TLS Range Support
Upgrading from version 10.2.2 to 10.2.3:
1. Move Web application deployment locations
2. Enabled Web application auto deploy
3. Remove dependency on Jackson 2
Upgrading from version 10.2.3 to 10.2.4:
1. Fix instance work folder ownership
2. Fix bindPWPrompt for internalDB
Upgrading from version 10.2.4 to 10.2.5:
1. Add missing OCSP Get Servlet Mapping to upgraded Dogtag 9 instances
2. Fix nuxwdog listener class
Upgrading from version 10.2.5 to 10.2.6:
1. Add new KRA audit events
Upgrading from version 10.2.6 to 10.3.0:
1. Remove inaccessable URLs from server.xml
2. Add Phone Home URLs to TPS section of server.xml.
Upgrading from version 10.3.0 to 10.3.1:
1. Enable Tomcat ALLOW_ENCODED_SLASH parameter
2. Add authz realm constraint and default to registry
Upgrading from version 10.3.1 to 10.3.2:
No upgrade scriptlets.
Tracker has been set to version 10.3.2.
Upgrading from version 10.3.2 to 10.3.3:
No upgrade scriptlets.
Tracker has been set to version 10.3.3.
Upgrading from version 10.3.3 to 10.4.0:
1. Fix JAVA_HOME path
2. Fix server library
3. Fix deployment descriptor
ERROR: [Errno 2] No such file or directory: '/usr/share/pki/server/conf/Catalina/localhost/pki#admin.xml'
Failed upgrading pki-tomcat instance.
Upgrade failed in pki-tomcat: [Errno 2] No such file or directory: '/usr/share/pki/server/conf/Catalina/localhost/pki#admin.xml'

Version-Release number of selected component (if applicable):

pki-server-10.4.1-11.el7.noarch

How reproducible: always

Steps to Reproduce:
1. Deploy pki (e.g. as part of IPA) on RHEL 7.1
2. Upgrade to 7.4

Actual results:

Upgrade, including pki-server-upgrade, completes without error.

Expected results:

Additional info: seems to be related to an upgrade script looking for
a file that does not exist. Possibly it existed in a version in between
7.1 and 7.4, but no longer does. The upgrade scriptlet affected is:

/usr/share/pki/server/upgrade/10.3.3/03-FixDeploymentDescriptor

In Fedora, the version number and index are different, but the code of the
scriptlet is the same. The script should be updated to handle the case
where the source file does not exist, e.g. add the fragment to the fix_webapp
method:

    if not os.path.exists(source_xml):
        return

Metadata Update from @ftweedal:
- Custom field component adjusted to None
- Custom field feature adjusted to None
- Custom field origin adjusted to None
- Custom field proposedmilestone adjusted to None
- Custom field proposedpriority adjusted to None
- Custom field reviewer adjusted to None
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1479663
- Custom field type adjusted to None
- Custom field version adjusted to None

Metadata Update from @ftweedal:
- Issue assigned to ftweedal

Metadata Update from @mharmsen:
- Issue set to the milestone: 0.0 NEEDS_TRIAGE

This should be fixed in 10.4.z since otherwise upgrade will fail.

Metadata Update from @edewata:
- Issue set to the milestone: None (was: 0.0 NEEDS_TRIAGE)

Gerrit review: https://review.gerrithub.io/#/c/373880/

Pushed to master (d0a861923a27672d8633c87e21fb8596080e84af)

Metadata Update from @mharmsen:
- Issue set to the milestone: 0.0 NEEDS_TRIAGE

Metadata Update from @mharmsen:
- Issue priority set to: major
- Issue set to the milestone: 10.5 (was: 0.0 NEEDS_TRIAGE)

Metadata Update from @ftweedal:
- Issue close_status updated to: fixed

Metadata Update from @mharmsen:
- Issue set to the milestone: 10.4.10 (was: 10.5)

Metadata Update from @mharmsen:
- Custom field fixedinversion adjusted to pki-core-10.4.8-6.fc27

Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new
issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.

This issue has been cloned to GitHub and is available here:
https://github.com/dogtagpki/pki/issues/2909

If you want to receive further updates on the issue, please navigate to the
GitHub issue and click on Subscribe button.

Thank you for understanding, and we apologize for any inconvenience.

Metadata