Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1626651

Summary: Unable to restart service once service are down
Product: Red Hat Satellite Reporter: Nikhil Kathole <nkathole>
Component: Satellite MaintainAssignee: Martin Bacovsky <mbacovsk>
Status: CLOSED ERRATA QA Contact: Nikhil Kathole <nkathole>
Severity: high Docs Contact:
Priority: high    
Version: 6.4CC: apatel, cmarinea, inecas, kgaikwad, mbacovsk, mmccune, pcreech
Target Milestone: 6.4.0Keywords: Reopened, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman_maintain-0.2.10-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-16 15:16:57 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:

Description Nikhil Kathole 2018-09-07 20:08:46 UTC
Description of problem:
foreman-maintain service wont work once service are down on satellite.

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

Satellite 6.4 snap 21

# rpm -qa | grep maintain
rubygem-foreman_maintain-0.2.9-1.el7sat.noarch


How reproducible:


Steps to Reproduce:
1. foreman-maintain service stop
2. foreman-maintain service restart


Actual results:

# foreman-maintain service restart
Running preparation steps required to run the next scenarios
================================================================================
Setup hammer: 
Hammer admin password: 
                                                                      [FAIL]
Hammer configuration failed: Is the admin password correct? (it was stored in /etc/foreman-maintain/foreman-maintain-hammer.yml)Is the server down?
--------------------------------------------------------------------------------
Scenario [preparation steps required to run the next scenarios] failed.

The following steps ended up in failing state:

  [hammer-setup]

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



Expected results: foreman-maintain service restart should work.


Additional info: workaround is to use foreman-maintain service start instead of restart.
also --whitelist "hammer-setup" option wont work with services

upstream issue https://projects.theforeman.org/issues/24796 for whitelist option

Comment 2 Ivan Necas 2018-09-19 14:27:32 UTC
Connecting redmine issue https://projects.theforeman.org/issues/24795 from this bug

Comment 4 Martin Bacovsky 2018-09-20 22:55:11 UTC
It seems this bug was improperly closed as a duplicity of bug 1625169 which has a different root cause.
This bug is about configuring Hammer when the server services are down and foreman-maintain can not perform the connection check.
The other bug is about Hammer trying to fetch admin password form installer answers on a box where Foreman was not installed and the foreman related answers are missing.

I'm setting this bug back to assigned and linking the correct error.
The PR covering this bug is [1] 

[1] https://github.com/theforeman/foreman_maintain/pull/217

Comment 5 Satellite Program 2018-09-21 10:08:22 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/24784 has been resolved.

Comment 7 Nikhil Kathole 2018-09-24 09:22:21 UTC
VERIFIED

Version tested:
# rpm -qa | grep maintain
rubygem-foreman_maintain-0.2.10-1.el7sat.noarch


# foreman-maintain service restart
Running preparation steps required to run the next scenarios
================================================================================
Setup hammer:                                                         [SKIPPED]
Satellite server is not running. Hammer can't be setup now.
--------------------------------------------------------------------------------


Running Restart Services
================================================================================
Check if command is run as root user:                                 [OK]
--------------------------------------------------------------------------------
Restart applicable services: 
Stopping the following service(s):

rh-mongodb34-mongod, postgresql, qdrouterd, qpidd, squid, pulp_celerybeat, pulp_resource_manager, pulp_streamer, pulp_workers, smart_proxy_dynflow_core, tomcat, dynflowd, httpd, puppetserver, foreman-proxy
| stopping foreman-proxy                                                        

| stopping puppetserver                                                         

| stopping httpd                                                                

| stopping dynflowd                                                             

| stopping tomcat                                                               

| stopping smart_proxy_dynflow_core                                             

| stopping pulp_workers                                                         

| stopping pulp_streamer                                                        

| stopping pulp_resource_manager                                                

| stopping pulp_celerybeat                                                      

/ stopping squid                                                                

/ stopping qpidd                                                                

/ stopping qdrouterd                                                            

/ stopping postgresql                                                           

/ stopping rh-mongodb34-mongod                                                  

/ All services stopped                                                          
Starting the following service(s):

rh-mongodb34-mongod, postgresql, qdrouterd, qpidd, squid, pulp_celerybeat, pulp_resource_manager, pulp_streamer, pulp_workers, smart_proxy_dynflow_core, tomcat, dynflowd, httpd, puppetserver, foreman-proxy
- starting rh-mongodb34-mongod                                                  

| starting postgresql                                                           

/ starting qdrouterd                                                            

- starting qpidd                                                                

- starting squid                                                                

- starting pulp_celerybeat                                                      

- starting pulp_resource_manager                                                

- starting pulp_streamer                                                        

\ starting pulp_workers                                                         

| starting smart_proxy_dynflow_core                                             

/ starting tomcat                                                               

/ starting dynflowd                                                             

\ starting httpd                                                                

| starting puppetserver                                                         

/ starting foreman-proxy                                                        

- All services started                                                [OK]      
--------------------------------------------------------------------------------

Comment 9 errata-xmlrpc 2018-10-16 15:16:57 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:2926