Bug 1523957

Summary: While running foreman-maintain (for 6.1 to 6.2) upgrade, it fails while stopping services due to incorrect option
Product: Red Hat Satellite Reporter: Gauravi <gapatil>
Component: Satellite MaintainAssignee: Kavita <kgaikwad>
Status: CLOSED ERRATA QA Contact: Nikhil Kathole <nkathole>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.3.0CC: ahumbe, apatel, bbuckingham, inecas, kgaikwad, mmccune, nkathole, sabnave
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
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:23:44 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:
Bug Depends On:    
Bug Blocks: 1496794    

Description Gauravi 2017-12-09 12:12:42 UTC
Description of problem:
While running foreman-maintain upgrade fails at stopping services due to incorrect option

# foreman-maintain upgrade run --target-version 6.2
Running preparation steps required to run the next scenarios
================================================================================
Procedures::Packages::Install: 
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Package hdparm-9.43-5.el7.x86_64 already installed and latest version
No package fio available.
Nothing to do
                                                                      [OK]
--------------------------------------------------------------------------------


Running Checks before upgrading to Satellite 6.2
================================================================================
Check for paused tasks:                                               [OK]
--------------------------------------------------------------------------------
Check whether all services are running using hammer ping:             [FAIL]
Error: Connection refused - connect(2)
--------------------------------------------------------------------------------
Continue with step [katello-service restart]?, [y(yes), n(no), q(quit)] y
katello-service restart:                                                        
/ All services are running.                                           [OK]      
--------------------------------------------------------------------------------
Rerunning the check after fix procedure
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                                                            [OK]      
--------------------------------------------------------------------------------


The pre-upgrade checks indicate that the system is ready for upgrade.
It's recommended to perform a backup at this stage.
Confirm to continue with the the modification part of the upgrade, [y(yes), n(no), q(quit)] y
Running Procedures before migrating to Satellite 6.2                            
================================================================================
Turn on maintenance mode:                                             [OK]
--------------------------------------------------------------------------------
disable active sync plans: 
/ Total 0 sync plans are now disabled.                                [OK]      
--------------------------------------------------------------------------------
katello-service stop: 
/ Stopping katello running services..                                 [FAIL]    
Failed executing katello-service stop --only foreman-proxy,foreman-tasks,httpd,mongod,pulp_celerybeat,pulp_resource_manager,qdrouterd,qpidd,tomcat, exit status 1:
 /usr/bin/katello-service:31:in `block in <main>': invalid option: --only (OptionParser::InvalidOption)
	from /usr/bin/katello-service:24:in `new'
	from /usr/bin/katello-service:24:in `<main>'
--------------------------------------------------------------------------------
Scenario [Procedures before migrating to Satellite 6.2] failed.

The following steps ended up in failing state:

  [katello-service-stop]

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

Version-Release number of selected component (if applicable):
rubygem-foreman_maintain-0.0.11-1.el7sat.noarch

How reproducible:
Always on Satellite 6.1.12

Steps to Reproduce:
1. Run below command on Satellite 6.1.12 :
   #foreman-maintain upgrade run --target-version 6.2


Actual results:
Failed to stop katello services

Expected results:
katello services should be stopped

Additional info:
--only option is invalid in Satellite 6.1.12, the expected option is --exclude .

Comment 2 Nikhil Kathole 2017-12-12 09:18:09 UTC
# foreman-maintain advanced  procedure run katello-service-stop
Running ForemanMaintain::Scenario
================================================================================
katello-service stop:
/ Stopping katello running services..                                 [FAIL]
Failed executing katello-service stop --only foreman-proxy,foreman-tasks,httpd,mongod,pulp_celerybeat,pulp_resource_manager,qdrouterd,qpidd,tomcat, exit status 1:
 /usr/bin/katello-service:31:in `block in <main>': invalid option: --only (OptionParser::InvalidOption)
        from /usr/bin/katello-service:24:in `new'
        from /usr/bin/katello-service:24:in `<main>'
--------------------------------------------------------------------------------
Scenario [ForemanMaintain::Scenario] failed.

The following steps ended up in failing state:

  [katello-service-stop]

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

Comment 3 Satellite Program 2018-01-11 15:16:16 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/22149 has been resolved.

Comment 5 Mike McCune 2018-02-01 21:29:41 UTC
VERIFIED

# foreman-maintain upgrade run --target-version 6.2
...

\ Total 0 sync plans are now disabled.                                [OK]      
--------------------------------------------------------------------------------
katello-service stop: 
- Stopping katello running services..                                 [OK]      
--------------------------------------------------------------------------------


....

it completed the 6.1 > 6.2 upgrade without error.

Comment 8 errata-xmlrpc 2018-02-19 17:23:44 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