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 1839649 - satellite-installer --reset returns a traceback
Summary: satellite-installer --reset returns a traceback
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Installation
Version: 6.8.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: 6.8.0
Assignee: satellite6-bugs
QA Contact: Devendra Singh
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-25 07:40 UTC by Vladimír Sedmík
Modified: 2020-10-27 13:03 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 13:02:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 29512 0 Normal Closed foreman-installer --reset fails with 'Could not find foreman_maintain' 2021-02-16 21:33:47 UTC
Red Hat Product Errata RHSA-2020:4366 0 None None None 2020-10-27 13:03:08 UTC

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


Note You need to log in before you can comment on or make changes to this bug.