Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1362659 - exit_fail without risk results in needs_inspection
Summary: exit_fail without risk results in needs_inspection
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: preupgrade-assistant
Version: 6.8
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Petr Hracek
QA Contact: Alois Mahdal
URL:
Whiteboard:
Depends On:
Blocks: 1335121
TreeView+ depends on / blocked
 
Reported: 2016-08-02 19:12 UTC by Alois Mahdal
Modified: 2016-11-04 08:58 UTC (History)
6 users (show)

Fixed In Version: preupgrade-assistant-2.1.9-3.el6
Doc Type: Bug Fix
Doc Text:
Cause: Let's say, module finishes with return code exit_fail and does not mention any risk. Consequence: In the report is marked as needs_inspection which is weird. Fix: Module finishes with return value error which means, module is not properly written. Before an report generation user can see on command line list of modules which missed log_risk. Result: Module are not marked as needs_inspection in case using only exit_fail.
Clone Of:
Environment:
Last Closed: 2016-11-04 08:58:00 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2616 normal SHIPPED_LIVE preupgrade-assistant bug fix and enhancement update 2016-11-03 16:23:38 UTC

Description Alois Mahdal 2016-08-02 19:12:24 UTC
Description of problem
======================

If module contains only

    exit_fail

rut no risk is logged, preupg reports result 'needs_inspection'.


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

preupgrade-assistant-2.1.8-2.el6


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

Always


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

 1. create a module with only exit_fail in the code (after auto-header)
 2. verify module result


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

Result is "needs_inspection"


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

Result should be "error"

Comment 3 Alois Mahdal 2016-09-01 00:41:27 UTC
Please, this needs to be clarified:

 *  In original use case (only exit_failed, no risks), p-a now sets 'fail'.

 *  This agrees with table you sent to ML:

        http://post-office.corp.redhat.com/archives/rhel-inplaceupgrades/2016-August/msg00028.html

    but not with comment 0 and @pstodulka's comment in mentioned ML thread.

So, how should p-a behave?  If I respect only the table, I could close this bug as verified, but I would perfer if this got discussed more and we had clear consensus.

(If you need opinion, I'm for 'error': exit_fail without risk means without explanation, which is not useful so I guess it should be invalid.)

Comment 4 Petr Hracek 2016-09-01 12:06:07 UTC
You are right, Fail without risk should return 15 as an error. Current version of P-A reports to user a message like:

[root@rhel6workstation ~]# preupg 
The Preupgrade Assistant is a diagnostics tool 
and does not perform the actual upgrade.
Please ensure you have backed up your system and/or data 
in the event of a failed upgrade that would require 
a full re-install of the system from installation media.
Do you want to continue? [Y/n]

[..snip..]

135/135 ...done    (NIS server config file back-up)
Assessment finished (time 04:36s)
Module xccdf_preupg_rule_backup_bacula_check exits as fail but without risk.
Module xccdf_preupg_rule_services_httpd_check_script exits as fail but without risk.
File '/root/preupgrade/dirtyconf/etc/sysconfig/rhn/up2date' already exists in dirtyconf directory
Result table with checks and their results for 'main contents':
-----------------------------------------------
|Migration of the MySQL data stack |notapplicable     |
|Changes related to moving from MySQL to MariaDB |notapplicable     |
|Checking the system version and variant |fail              |
---------------------------------------
[..snip..]
[root@rhel6workstation ~]#

Comment 5 pstodulk 2016-09-01 12:29:30 UTC
(In reply to Petr Hracek from comment #4)
> 135/135 ...done    (NIS server config file back-up)
> Assessment finished (time 04:36s)
> Module xccdf_preupg_rule_backup_bacula_check exits as fail but without risk.
> Module xccdf_preupg_rule_services_httpd_check_script exits as fail but
> without risk.

I think that message would be different - it looks weird and doesn't provide
information for admin. I guess that something like:
---
 Error: The module <module1> failed without expected risk report.
 Error: The module <module2> failed without expected risk report.
 .....
<end>
Preupgrade Assistant detects errors which could ....... Please contact vendor for remedy.
---
or something like that. Of course, we should catch it before user could see this.

Comment 7 Petr Hracek 2016-09-01 13:28:46 UTC
Yeah, this error can be catched by preupg-xccdf-compose or even by preupg-create-group-xml script. or both. An issue to upstream https://github.com/upgrades-migrations/preupgrade-assistant/issues/131

Comment 10 Alois Mahdal 2016-09-01 14:29:13 UTC
(In reply to Petr Hracek from comment #7)
> Yeah, this error can be catched by preupg-xccdf-compose or even by
> preupg-create-group-xml script. or both.

I'd be curious about how you would do it, I'm not aware of any reliable way.

And even if it was possible, I would not count on tools anyway.  People can use tools and then change their check scripts in-place.

Comment 12 pstodulk 2016-09-01 14:39:10 UTC
According to informations from Petr, he want to do only a basic check,
that scripts contain keywords like: log_high_risk, ...
when RESULT_FAIL, exit_fail, ... will be detected.

It is not intended as replacement of other tests, just mini improvement which I guess will be more like notification than real test.

Comment 13 Alois Mahdal 2016-09-01 15:41:37 UTC
(In reply to pstodulk from comment #12)
> According to informations from Petr, he want to do only a basic check,
> that scripts contain keywords like: log_high_risk, ...
> when RESULT_FAIL, exit_fail, ... will be detected.

This is something I can easily add to test suite (TODO taken).


> It is not intended as replacement of other tests, just mini improvement
> which I guess will be more like notification than real test.

I'd still vote for leaving it out of build tools.  If you want to provide such functionality to users (module developers), then I think some `preupg-lint` tool is way to go.

(We're getting off-topic here, though...)

Comment 14 Alois Mahdal 2016-10-07 04:02:10 UTC
According to discussion with @phracek, the case now should behave as 'fail'.

Test has been updated and now -- as of preupgrade-assistant-2.1.10-5.el6 -- passes.

Comment 17 errata-xmlrpc 2016-11-04 08:58:00 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-2616.html


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