Bug 1839649

Summary: satellite-installer --reset returns a traceback
Product: Red Hat Satellite Reporter: Vladimír Sedmík <vsedmik>
Component: InstallationAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Devendra Singh <desingh>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.8.0CC: ahumbe, ehelms, zhunting
Target Milestone: 6.8.0Keywords: 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: 2020-10-27 13:02: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:

Description Vladimír Sedmík 2020-05-25 07:40:32 UTC
Description of problem:
When running 'satellite-installer --reset' command on a Satellite 6.8 (even a fresh one) it returns a traceback for foreman-maintain hook:

[root@dhcp-2-221 ~]# satellite-installer --reset
Executing: foreman-maintain packages -h
Executing: foreman-maintain packages is-locked --assumeyes
Package versions are locked. Continuing with unlock.
Executing: foreman-maintain packages unlock --assumeyes
Are you sure you want to continue? This will drop the databases, reset all configurations that you have made and bring the server back to a fresh install. [y/n]
y
Traceback (most recent call last):
	16: from /usr/sbin/satellite-installer:8:in `<main>'
	15: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-4.1.0/lib/kafo/kafo_configure.rb:162:in `run'
	14: from /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
	13: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-4.1.0/lib/kafo/kafo_configure.rb:118:in `run'
	12: from /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
	11: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-4.1.0/lib/kafo/kafo_configure.rb:155:in `execute'
	10: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-4.1.0/lib/kafo/kafo_configure.rb:424:in `run_installation'
	 9: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-4.1.0/lib/kafo/hooking.rb:49:in `execute'
	 8: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-4.1.0/lib/kafo/hooking.rb:49:in `each'
	 7: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-4.1.0/lib/kafo/hooking.rb:51:in `block in execute'
	 6: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-4.1.0/lib/kafo/hook_context.rb:16:in `execute'
	 5: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-4.1.0/lib/kafo/hook_context.rb:16:in `instance_exec'
	 4: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-4.1.0/lib/kafo/hooking.rb:34:in `block (4 levels) in load'
	 3: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-4.1.0/lib/kafo/hooking.rb:34:in `instance_eval'
	 2: from /usr/share/foreman-installer/katello/hooks/pre/10-reset_feature.rb:185:in `block (4 levels) in load'
	 1: from /usr/share/foreman-installer/katello/hooks/pre/10-reset_feature.rb:7:in `reset'
/usr/share/foreman-installer/hooks/boot/03-foreman-maintain-extensions.rb:25:in `stop_services': wrong number of arguments (given 0, expected 1) (ArgumentError)


Version-Release number of selected component (if applicable):
Satellite 6.8 snap 1
rubygem-foreman_maintain-0.6.3-2.el7sat.noarch


How reproducible:
always


Steps to Reproduce:
1. Have a Satellite
2. Run 'satellite-installer --reset' on it


Actual results:
A traceback


Expected results:
Successful reset

Comment 1 Devendra Singh 2020-06-15 10:21:21 UTC
Verified on 6.8 Snap4:

# satellite-installer --reset 
Executing: foreman-maintain packages -h
Executing: foreman-maintain packages is-locked --assumeyes
Package versions are locked. Continuing with unlock.
Executing: foreman-maintain packages unlock --assumeyes
Are you sure you want to continue? This will drop the databases, reset all configurations that you have made and bring the server back to a fresh install. [y/n]
y
Executing: foreman-maintain service stop
Executing: foreman-maintain service start --only=postgresql
Dropped database 'foreman'
DISABLE_DATABASE_ENVIRONMENT_CHECK=1 foreman-rake db:drop 2>&1 finished successfully!
rm -f /var/lib/candlepin/cpdb_done finished successfully!
rm -f /var/lib/candlepin/cpinit_done finished successfully!
systemctl stop tomcat finished successfully!
could not change directory to "/root": Permission denied
sudo -u postgres dropdb candlepin finished successfully!
rm -f /var/lib/pulp/init.flag finished successfully!
systemctl stop httpd pulp_workers finished successfully!
systemctl start rh-mongodb34-mongod finished successfully!
MongoDB shell version v3.4.9
connecting to: mongodb://127.0.0.1:27017/pulp_database
MongoDB server version: 3.4.9
{ "dropped" : "pulp_database", "ok" : 1 }
mongo pulp_database --eval 'db.dropDatabase();' finished successfully!
rm -rf /var/lib/pulp/{distributions,published,repos}/* finished successfully!
Preparing installation Done                                              
=============================================
Upgrade Step 1/14: katello:correct_repositories. This may take a long while.
=============================================
Upgrade Step 2/14: katello:correct_puppet_environments. This may take a long while.
=============================================
Upgrade Step 3/14: katello:clean_backend_objects. This may take a long while.
0 orphaned consumer id(s) found in candlepin.
Candlepin orphaned consumers: []
0 orphaned consumer id(s) found in pulp.
Pulp orphaned consumers: []
=============================================
Upgrade Step 4/14: katello:upgrades:3.8:clear_checksum_type. =============================================
Upgrade Step 5/14: katello:upgrades:3.10:clear_invalid_repo_credentials. =============================================
Upgrade Step 6/14: katello:upgrades:3.10:update_gpg_key_urls. =============================================
Upgrade Step 7/14: katello:upgrades:3.11:import_yum_metadata. Importing Yum Metadata Files
=============================================
Upgrade Step 8/14: katello:upgrades:3.11:update_puppet_repos. =============================================
Upgrade Step 9/14: katello:upgrades:3.11:clear_checksum_type. =============================================
Upgrade Step 10/14: katello:upgrades:3.12:remove_pulp2_notifier. =============================================
Upgrade Step 11/14: katello:upgrades:3.13:republish_deb_metadata. Input file /var/lib/pulp/0004_deb_repo_republish_candidates.txt was not readable.
You can manually use an alternate input file by running "foreman-rake katello:upgrades:3.13:republish_deb_metadata[<path>]"
=============================================
Upgrade Step 12/14: katello:upgrades:3.15:set_sub_facet_dmi_uuid. =============================================
Upgrade Step 13/14: katello:upgrades:3.15:reindex_rpm_modular. =============================================
Upgrade Step 14/14: katello:upgrades:3.16:update_applicable_el8_hosts. foreman-rake upgrade:run finished successfully!
  Success!

Comment 4 errata-xmlrpc 2020-10-27 13:02: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 (Important: Satellite 6.8 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/RHSA-2020:4366