Bug #32386
closedforeman-maintain restore failing for stopping tomcat service on capsule
Description
This issue is present for foreman-maintain restore on a Capsule system. It seems the restore wants to stop the tomcat service, which is not present on the capsule (see https://bugzilla.redhat.com/show_bug.cgi?id=1859705#c3).
Version-Release number of selected component (if applicable):
Capsule 6.9.0 Snap 19.1 and Capsule 6.9.1 Snap 2
version: rubygem-foreman_maintain-0.7.8-1.el7sat.noarch
How reproducible:
100%
Steps to Reproduce:
1. # foreman-maintain backup online /tmp
<snip>
Done with backup: 2021-04-20 10:15:58 -0400
BACKUP Complete, contents can be found in: /tmp/capsule-backup-2021-04-20-10-15-50
</snip>
2. # foreman-maintain restore /tmp/capsule-backup-2021-04-20-10-15-50/
Running preparation steps required to run the next scenarios
================================================================================
Make sure Mongo DB is up:
| Checking connection to the Mongo DB [OK]
--------------------------------------------------------------------------------
Checks whether the tools for Mongo DB are installed: [OK]
--------------------------------------------------------------------------------
Running Restore backup
================================================================================
Check if command is run as root user: [OK]
--------------------------------------------------------------------------------
Validate backup has appropriate files: [OK]
--------------------------------------------------------------------------------
Confirm dropping databases and running restore:
WARNING: This script will drop and restore your database.
Your existing installation will be replaced with the backup database.
Once this operation is complete there is no going back.
Do you want to proceed?, [y(yes), q(quit)] y
[OK]
--------------------------------------------------------------------------------
Validate hostname is the same as backup: [OK]
--------------------------------------------------------------------------------
Setting file security:
| Restoring SELinux context [OK]
--------------------------------------------------------------------------------
Restore configs from backup:
\ Restoring configs [OK]
--------------------------------------------------------------------------------
Ensure restored MongoDB storage engine matches the current DB: [OK]
--------------------------------------------------------------------------------
Run installer reset:
/ Installer reset [OK]
--------------------------------------------------------------------------------
Stop applicable services:
Stopping the following service(s):
rh-mongodb34-mongod, qdrouterd, qpidd, squid, pulp_celerybeat, pulp_resource_manager, pulp_streamer, pulp_workers, smart_proxy_dynflow_core, httpd, puppetserver, foreman-proxy
- All services stopped [OK]
--------------------------------------------------------------------------------
Extract any existing tar files in backup:
\ Extracting pulp data [OK]
--------------------------------------------------------------------------------
Restore mongo dump:
/ All services stopped [OK]
--------------------------------------------------------------------------------
Migrate pulp db:
\ Migrating pulp database [OK]
--------------------------------------------------------------------------------
Regenerate required activemq and qpidd queues while restoring online backup:
/ Stopping tomcat service [FAIL]
undefined method `services' for nil:NilClass
--------------------------------------------------------------------------------
Scenario [Restore backup] failed.
The following steps ended up in failing state:
[restore-regenerate-queues]
Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist="restore-regenerate-queues"
Running Resuce Restore backup ================================================================================
Actual results:
Regenerate required activemq and qpidd queues while restoring online backup:
/ Stopping tomcat service [FAIL]
undefined method `services' for nil:NilClass
Expected results:
Restore should pass, and it shouldn't try to stop tomcat.service on capsule which is not present on Capsule.
Additional info:
Tested this on Capsule 6.8.6 Snap 1.1 and this issue exists there as well.
Updated by The Foreman Bot about 3 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman_maintain/pull/468 added
Updated by Amit Upadhye about 3 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman_maintain|f670eee9f06f7d7039c7a4f3cecfe6c5bd24107d.