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 1979045

Summary: regression: "foreman-maintain service restart" raises exception with external mongo
Product: Red Hat Satellite Reporter: Pavel Moravec <pmoravec>
Component: Satellite MaintainAssignee: Amit Upadhye <aupadhye>
Status: CLOSED ERRATA QA Contact: Vladimír Sedmík <vsedmik>
Severity: high Docs Contact:
Priority: high    
Version: 6.9.0CC: ahumbe, ajambhul, apatel, aupadhye, dgross, gsulliva, kgaikwad, ktordeur, momran, osousa
Target Milestone: 6.10.0Keywords: PrioBumpGSS, Regression, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: rubygem-foreman_maintain-0.8.9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1985323 (view as bug list) Environment:
Last Closed: 2021-11-16 13:48:19 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 Pavel Moravec 2021-07-04 13:56:39 UTC
Description of problem:
rubygem-foreman_maintain-0.7.10-1.el7sat.noarch has a regression compared to 0.7.8-1 version in the use case when DBs are external and one tries to e.g. restart services:

undefined method `enabled?' for RemoteDB(rh-mongodb34-mongod [5]):ForemanMaintain::Utils::Service::RemoteDB

is raised. With backtrace:

/usr/share/gems/gems/foreman_maintain-0.7.10/definitions/features/service.rb:140:in `select!'
/usr/share/gems/gems/foreman_maintain-0.7.10/definitions/features/service.rb:140:in `filter_disabled_services!'
/usr/share/gems/gems/foreman_maintain-0.7.10/definitions/features/service.rb:133:in `filter_services'
/usr/share/gems/gems/foreman_maintain-0.7.10/definitions/features/service.rb:30:in `filtered_services'
/usr/share/gems/gems/foreman_maintain-0.7.10/definitions/procedures/service/base.rb:19:in `run_service_action'
/usr/share/gems/gems/foreman_maintain-0.7.10/definitions/procedures/service/start.rb:11:in `run'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/executable.rb:139:in `__run__'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/runner/execution.rb:83:in `block (2 levels) in run'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/runner/execution.rb:107:in `capture_errors'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/runner/execution.rb:82:in `block in run'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/runner/execution.rb:101:in `with_metadata_calculation'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/runner/execution.rb:81:in `run'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/runner.rb:131:in `run_step'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/runner.rb:120:in `run_steps'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/runner.rb:113:in `execute_scenario_steps'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/runner.rb:58:in `run_scenario'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/upgrade_runner.rb:129:in `block in run_phase'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/upgrade_runner.rb:177:in `with_non_empty_scenario'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/upgrade_runner.rb:124:in `run_phase'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/upgrade_runner.rb:164:in `block in rollback_pre_migrations'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/upgrade_runner.rb:159:in `each'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/upgrade_runner.rb:159:in `rollback_pre_migrations'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/upgrade_runner.rb:90:in `run_rollback'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/upgrade_runner.rb:66:in `block in run'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/upgrade_runner.rb:65:in `each'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/upgrade_runner.rb:65:in `run'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/cli/upgrade_command.rb:96:in `execute'
/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
/usr/share/gems/gems/foreman_maintain-0.7.10/lib/foreman_maintain/cli.rb:42:in `run'
/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
/usr/share/gems/gems/foreman_maintain-0.7.10/bin/foreman-maintain:15:in `<top (required)>'
/bin/satellite-maintain:23:in `load'
/bin/satellite-maintain:23:in `<main>'

This also affects upgrades of Satellite, as such services commands are part of the upgrade call flow.


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


How reproducible:
100%


Steps to Reproduce:
1. Have Sat6.9 (or any older) with foreman-maintain 0.7.10 AND external DBs
2. foreman-maintain service restart


Actual results:
Running Restart Services
================================================================================
Check if command is run as root user:                                 [OK]
--------------------------------------------------------------------------------
Restart applicable services: 

Stopping the following service(s):                                    [FAIL]
undefined method `enabled?' for RemoteDB(rh-mongodb34-mongod [5]):ForemanMaintain::Utils::Service::RemoteDB
--------------------------------------------------------------------------------
Scenario [Restart Services] failed.

The following steps ended up in failing state:

  [service-restart]

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


foreman-maintain log has the backtrace shown above.



Expected results:
Command works well :)



Additional info:
Seen upstream issue https://projects.theforeman.org/issues/32319 for the same, without details.

Comment 1 Brad Buckingham 2021-07-08 14:34:24 UTC
Reference : https://bugzilla.redhat.com/show_bug.cgi?id=1978764 was also created based upon behavior of 'service status'.

Comment 2 Bryan Kearney 2021-07-16 20:02:22 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32319 has been resolved.

Comment 6 errata-xmlrpc 2021-11-16 13:48:19 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 (Satellite 6.10 Satellite Maintenance Release), 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-2021:4697