Bug 1487546

Summary: Failed check/procedure/upgrade should exit with non-zero error code
Product: Red Hat Satellite Reporter: Ivan Necas <inecas>
Component: Satellite MaintainAssignee: Swapnil Abnave <sabnave>
Status: CLOSED ERRATA QA Contact: Nikhil Kathole <nkathole>
Severity: medium Docs Contact:
Priority: high    
Version: UnspecifiedCC: bbuckingham, ehelms, inecas, mmccune, nkathole
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
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: 2018-02-19 17:22:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ivan Necas 2017-09-01 08:51:53 UTC
1. run check/upgrade check/upgrade run that ends with failed state
2. echo $?

It is 0

It should not be 0

Comment 1 Ivan Necas 2017-09-01 08:51:59 UTC
Created from redmine issue http://projects.theforeman.org/issues/20623

Comment 2 Ivan Necas 2017-09-01 08:52:05 UTC
Upstream bug assigned to None

Comment 4 Satellite Program 2017-09-05 12:18:19 UTC
Upstream bug assigned to sabnave

Comment 8 Satellite Program 2017-09-13 12:17:55 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20623 has been resolved.

Comment 9 Nikhil Kathole 2017-12-20 07:15:54 UTC
VERIFIED

Version tested:
# rpm -q rubygem-foreman_maintain
rubygem-foreman_maintain-0.1.1-1.el7sat.noarch


foreman-maintain health/upgrade/advanced returned 1 (exits with non-zero error) if completed with failed state.

# foreman-maintain upgrade check
--target-version not specified
Possible target versions are:
6.3.z
# echo $?
1

# foreman-maintain upgrade check --target-version 6.3.z
Running preparation steps required to run the next scenarios
================================================================================
Procedures::Packages::Install:
Package hdparm-9.43-5.el7.x86_64 already installed and latest version
                                                                      [OK]
--------------------------------------------------------------------------------


Running Checks before upgrading to Satellite 6.3.z
================================================================================
Check for verifying syntax for ISP DHCP configurations:               [OK]
--------------------------------------------------------------------------------
Check for paused tasks:                                               [OK]
--------------------------------------------------------------------------------
Check whether all services are running using hammer ping:             [OK]
--------------------------------------------------------------------------------
Check for running tasks:                                              [OK]
--------------------------------------------------------------------------------
Check for old tasks in paused/stopped state:                          [OK]
--------------------------------------------------------------------------------
Check for pending tasks which are safe to delete:                     [OK]
--------------------------------------------------------------------------------
Check for tasks in planning state:                                    [OK]
--------------------------------------------------------------------------------
Check for recommended disk speed of pulp, mongodb, pgsql dir.:
/ Finished                                                            [FAIL]
Slow disk detected /var/lib/pulp mounted on /dev/mapper/rhel-root.
             Actual disk speed: 63 MB/sec
             Expected disk speed: 80 MB/sec.
--------------------------------------------------------------------------------
Scenario [Checks before upgrading to Satellite 6.3.z] failed.

The following steps ended up in failing state:

  [disk-io]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist="disk-io"

# echo $?
1

# foreman-maintain health check
Running ForemanMaintain::Scenario::FilteredScenario
================================================================================
Check for verifying syntax for ISP DHCP configurations:               [OK]
--------------------------------------------------------------------------------
Check for paused tasks:                                               [OK]
--------------------------------------------------------------------------------
Check whether all services are running using hammer ping:             [FAIL]
pulp, pulp_auth resource(s) are failing.
--------------------------------------------------------------------------------
Continue with step [katello-service restart--only pulp_resource_manager,pulp_workers,pulp_celerybeat,pulp_resource_manager,pulp_workers,pulp_celerybeat]?, [y(yes), n(no), q(quit)] q
Scenario [ForemanMaintain::Scenario::FilteredScenario] failed.

The following steps ended up in failing state:

  [hammer-ping]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist="hammer-ping"

# echo $?
1

Comment 12 errata-xmlrpc 2018-02-19 17:22:26 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-2018:0330