Bug 1304772

Summary: report generation is broken (openscap rebased)
Product: Red Hat Enterprise Linux 6 Reporter: Alois Mahdal <amahdal>
Component: preupgrade-assistantAssignee: Petr Hracek <phracek>
Status: CLOSED ERRATA QA Contact: Tereza Cerna <tcerna>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 6.8CC: fkluknav, jreznik, mflitter, mhaicman, openscap-maint, ovasik, phracek, pstodulk, slukasik, ttomecek
Target Milestone: rcKeywords: Extras, Rebase, TestBlocker
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: preupgrade-assistant-2.1.6-2.el6 Doc Type: Bug Fix
Doc Text:
Updated OpenSCAP XSLT Entries To keep pace with the latest RHEL version of OpenSCAP, preupgrade-assistant has been updated to reflect the newer XSLT files in use.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-11 08:26:47 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:
Embargoed:
Attachments:
Description Flags
"broken" result.xml
none
output from preupg none

Description Alois Mahdal 2016-02-04 15:04:22 UTC
Description of problem
======================

Due to changes in openscap (rebased openscap-1.0.10 to openscap-1.2.8),
report generation stopped working:

 *  result.html is not generated at all,

 *  some strings are not translated in result.xml

and probably also other problems.


Version-Release number of selected component
============================================

    openscap-1.2.8-1.el6.x86_64
    openscap-engine-sce-1.2.8-1.el6.x86_64
    openscap-scanner-1.2.8-1.el6.x86_64
    openscap-utils-1.2.8-1.el6.x86_64
    preupgrade-assistant-2.1.4-6.el6.noarch
    preupgrade-assistant-contents-0.6.43-1.el6.noarch
    preupgrade-assistant-contents-67-0.6.43-1.el6.noarch
    preupgrade-assistant-staticdata-0.1.0-5.el6.noarch
    preupgrade-assistant-staticdata-67-0.1.0-5.el6.noarch


How reproducible
================

Always


Steps to Reproduce
==================

 1. run preupg
 2. see /root/preupgrade/result.html
    and /root/preupgrade/result.xml


Actual results
==============

No html file and the xml file is broken.


Expected results
================

All reports should be OK


Additional info
===============

This completely breaks at least the assessment phase, hence the urgent
severity.

Comment 2 Alois Mahdal 2016-02-04 15:22:02 UTC
Created attachment 1121129 [details]
"broken" result.xml

Comment 3 Alois Mahdal 2016-02-04 15:22:42 UTC
Created attachment 1121130 [details]
output from preupg

Comment 4 Šimon Lukašík 2016-02-04 15:43:12 UTC
Ah, I see what happened. Preupgrade branched from our main XSLT and created preup.xsl. That preup.xsl, however, included stock XSLT from OpenSCAP that went unmodified for preupgrade purpose.

We have started work on new OpenSCAP XSLT almost two years ago, and we have notified preupgrade crew. We finish the work and OpenSCAP reports are now way better. However, we forgot to notify you guys, that we want to put this in RHEL. Sorry, it just didn't came to us.

Here is an easy fix however: You can pick the missing XSLTs from the old openscap package and put it to yours. Once you correct the paths in `preup.xsl` it should work just fine.

In the long term guys, I suggest you take a look at the new OpenSCAP's XSLT. We have imprpved user experience tremulously. You just need to rebase your preup.xsl on our latest.

Comment 5 Petr Hracek 2016-02-08 11:08:45 UTC
The bug is fixed by upstream commit https://github.com/phracek/preupgrade-assistant/commit/06c81b146f24357d95c01c9c443ed945c97c4759

Comment 8 Petr Stodulka 2016-03-01 20:04:28 UTC
See bug #1312702. Actual result is still broken. Just in different way.

Comment 9 Petr Stodulka 2016-03-02 10:40:31 UTC
*** Bug 1312702 has been marked as a duplicate of this bug. ***

Comment 10 Petr Stodulka 2016-03-02 10:46:04 UTC
Fixed now just in downstream. Upstream solution will be created in future.

Used old xsl files from OpenSCAP v1.0.8 according to Simon's advice.
Thanks to jcerny for help with another modification of preup.xsl file. See bug #1312702

Comment 11 Tereza Cerna 2016-03-08 12:51:54 UTC
--------------------------------------------------------------
Verified in:
    preupgrade-assistant-2.1.5-2.el6.noarch
    preupgrade-assistant-el6toel7-0.6.45-1.el6.noarch
    preupgrade-assistant-el6toel7-data-0.20160125-1.el6.noarch
    openscap-1.2.8-2.el6.ppc64
PASS
--------------------------------------------------------------

# preupg --select-rules=xccdf_preupg_rule_databases_mysql_configuration_changes_configuration --force
Assessment of the system, running checks / SCE scripts:
001/001 ...done    (MySQL configuration)
Assessment finished (time 00:01s)
Result table with checks and their results for main contents:
------------------------------------------
|MySQL configuration      |needs_action  |
------------------------------------------
Tarball with results is stored here /root/preupgrade-results/preupg_results-160308040306.tar.gz .
The latest assessment is stored in directory /root/preupgrade .
Summary information:
We found some potential in-place upgrade risks.
Read the full report file /root/preupgrade/result.html for more details.
Read the admin report file /root/preupgrade/result-admin.html for more details.
Upload results to UI by command:
e.g. preupg -u http://127.0.0.1:8099/submit/ -r /root/preupgrade-results/preupg_results-160308040306.tar.gz .

# ls /root/preupgrade | grep result
preupg_results-160308040306.tar.gz
result-admin.html
result-admin.xml
result.html
result.xml

--->>> We can see result.html and result.xml files. All files are OK.

--------------------------------------------------------------
Reproduced in:
    preupgrade-assistant-2.1.4-6.el6.noarch
    preupgrade-assistant-contents-0.6.43-1.el6.noarch
    preupgrade-assistant-staticdata-0.1.0-5.el6.noarch
    openscap-1.2.8-1.el6.x86_64
FAIL
--------------------------------------------------------------

# preupg --select-rules=xccdf_preupg_rule_databases_mysql_configuration_changes_configuration --force
Assessment of the system, running checks / SCE scripts:
001/001 ...done    (MySQL configuration)
Assessment finished (time 00:00s)
I/O warning : failed to load external entity "/usr/share/openscap/xsl/security-guide.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 40 element import
xsl:import : unable to load /usr/share/openscap/xsl/security-guide.xsl
I/O warning : failed to load external entity "/usr/share/openscap/xsl/oval-report.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 41 element import
xsl:import : unable to load /usr/share/openscap/xsl/oval-report.xsl
I/O warning : failed to load external entity "/usr/share/openscap/xsl/sce-report.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 42 element import
xsl:import : unable to load /usr/share/openscap/xsl/sce-report.xsl
OpenSCAP Error:: Could not parse XSLT file '/usr/share/preupgrade/xsl/preup.xsl' [xslt.c:146]
I/O warning : failed to load external entity "/usr/share/openscap/xsl/security-guide.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 40 element import
xsl:import : unable to load /usr/share/openscap/xsl/security-guide.xsl
I/O warning : failed to load external entity "/usr/share/openscap/xsl/oval-report.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 41 element import
xsl:import : unable to load /usr/share/openscap/xsl/oval-report.xsl
I/O warning : failed to load external entity "/usr/share/openscap/xsl/sce-report.xsl"
compilation error: file /usr/share/preupgrade/xsl/preup.xsl line 42 element import
xsl:import : unable to load /usr/share/openscap/xsl/sce-report.xsl
OpenSCAP Error:: Could not parse XSLT file '/usr/share/preupgrade/xsl/preup.xsl' [xslt.c:146]
Usage: preupg [options]

preupg: error: [Errno 2] No such file or directory: u'/root/preupgrade/result.html'

--->>> File result.html was not generated and result.xml contains mistakes in some strings.

Comment 12 Petr Stodulka 2016-04-22 15:21:54 UTC
After last rebuild (2.1.6-1) it is broken again: are used new XSL files for generation of html report instead of old and these are not modified, so remediation instructions are not part of report. Moved back to assigned.

Comment 14 Alois Mahdal 2016-04-28 16:22:55 UTC
Terko, /CoreOS/preupgrade-assistant/6to7/assistant/result-files included in ipu-tier1 now checks for validity of generated HTML and XML files; hopefully it should be enough to catch this, even in future.

You can schedule ipu tier1 as:

    ipu tier -B 1 | bash

(brew based) or

    ipu tier -e @pa 1 | bash

(errata based).

Comment 15 Alois Mahdal 2016-04-28 20:29:27 UTC
(In reply to Alois Mahdal from comment #14)
[...]
> 
>     ipu tier -B 1 | bash

throw in -A to schedule on all "our" archs.

Comment 17 errata-xmlrpc 2016-05-11 08:26:47 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://rhn.redhat.com/errata/RHBA-2016-1022.html