Bug 1857506

Summary: Capsule Upgrade Fail: satellite-installer --scenario capsule --upgrade throws NameError
Product: Red Hat Satellite Reporter: Devendra Singh <desingh>
Component: UpgradesAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Devendra Singh <desingh>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.8.0CC: mawerner, pcreech, sadas, vijsingh, zhunting
Target Milestone: 6.8.0Keywords: AutomationBlocker, BetaBlocker, Triaged, UpgradeBlocker
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: foreman-installer-2.1.2 Doc Type: Known Issue
Doc Text:
Capsule Upgrade Fail: satellite-installer --scenario capsule --upgrade throws NameError
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-27 13:04:18 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 Devendra Singh 2020-07-16 03:26:53 UTC
Description of problem:Capsule Upgrade Fail: satellite-installer --scenario capsule --upgrade  throws NameError


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

How reproducible:
always

Steps to Reproduce:
1. Prepare the environment to perform the satellite and Capsule upgrade from 6.7 to 6.8  
2. Configure all the repository(Enabled the required repository)
3. Trigger satellite upgrade and it completes successfully.
4. Trigger Capsule upgrade but it fail with NameError.

satellite-installer --scenario capsule --upgrade --certs-tar-file /home/XYZ.com-certs.tar --certs-update-all
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:139:in `execute'
	10: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-4.1.0/lib/kafo/hooking.rb:49:in `execute'
	 9: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-4.1.0/lib/kafo/hooking.rb:49:in `each'
	 8: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-4.1.0/lib/kafo/hooking.rb:51:in `block in execute'
	 7: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-4.1.0/lib/kafo/hook_context.rb:16:in `execute'
	 6: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-4.1.0/lib/kafo/hook_context.rb:16:in `instance_exec'
	 5: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-4.1.0/lib/kafo/hooking.rb:34:in `block (4 levels) in load'
	 4: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-4.1.0/lib/kafo/hooking.rb:34:in `instance_eval'
	 3: from /usr/share/foreman-installer/katello/hooks/pre_validations/29-upgrade.rb:2:in `block (4 levels) in load'
	 2: from /usr/share/foreman-installer/hooks/boot/01-kafo-hook-extensions.rb:90:in `log_and_say'
	 1: from /opt/theforeman/tfm/root/usr/share/gems/gems/highline-1.7.8/lib/highline.rb:383:in `color'
/opt/theforeman/tfm/root/usr/share/gems/gems/highline-1.7.8/lib/highline/style.rb:33:in `Style': :warn is not a defined Style (NameError)


Actual results:
Capsule upgrade failed with NameError.

Expected results:
Capsule upgrade should be completed succssfully.

Additional info:

Comment 1 Eric Helms 2020-07-16 12:56:27 UTC
The --upgrade flag is no longer required for upgrades and has be deprecated. The error is coming from the code that warns users of this. We'll fix this but I advise that any upgrade commands for 6.8 drop "--upgrade" from any Satellite or Capsule upgrade commands.

Comment 2 Justin Sherrill 2020-07-16 12:58:05 UTC
Connecting redmine issue https://projects.theforeman.org/issues/30402 from this bug

Comment 3 Devendra Singh 2020-07-16 13:33:56 UTC
(In reply to Eric Helms from comment #1)
> The --upgrade flag is no longer required for upgrades and has be deprecated.
> The error is coming from the code that warns users of this. We'll fix this
> but I advise that any upgrade commands for 6.8 drop "--upgrade" from any
> Satellite or Capsule upgrade commands.

I tried capsule upgrade without upgrade option and it completed successfully.

#satellite-installer --scenario capsule --certs-tar-file /home/XYZ-certs.tar --certs-update-all
Marking certificate /root/ssl-build/XYZ/XYZ-qpid-router-client for update
Marking certificate /root/ssl-build/XYZ/XYZ-qpid-broker for update
Marking certificate /root/ssl-build/XYZ/XYZ-qpid-client-cert for update
Marking certificate /root/ssl-build/XYZ/XYZ-qpid-router-server for update
Marking certificate /root/ssl-build/XYZ/XYZ-apache for update
Marking certificate /root/ssl-build/XYZ/XYZ-foreman-client for update
Marking certificate /root/ssl-build/XYZ/XYZ-foreman-proxy-client for update
Marking certificate /root/ssl-build/XYZ/XYZ-puppet-client for update
Marking certificate /root/ssl-build/XYZ/XYZ-foreman-proxy for update
Preparing installation Done                                              
  Success!
  * Capsule is running at https://XYZ:9090

Comment 5 Bryan Kearney 2020-08-20 08:06:13 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/30402 has been resolved.

Comment 6 Tomer Brisker 2020-09-06 15:00:30 UTC
*** Bug 1874465 has been marked as a duplicate of this bug. ***

Comment 7 Devendra Singh 2020-09-09 17:55:11 UTC
Verified on 6.8 Snap14.

# satellite-installer --scenario capsule --certs-tar-file /home/xyz.com-certs.tar --certs-update-all
Marking certificate /root/ssl-build/xyz.com/xyz.com-qpid-router-client for update
Marking certificate /root/ssl-build/xyz.com/xyz.com-qpid-broker for update
Marking certificate /root/ssl-build/xyz.com/xyz.com-qpid-client-cert for update
Marking certificate /root/ssl-build/xyz.com/xyz.com-qpid-router-server for update
Marking certificate /root/ssl-build/xyz.com/xyz.com-apache for update
Marking certificate /root/ssl-build/xyz.com/xyz.com-foreman-client for update
Marking certificate /root/ssl-build/xyz.com/xyz.com-foreman-proxy-client for update
Marking certificate /root/ssl-build/xyz.com/xyz.com-puppet-client for update
Marking certificate /root/ssl-build/xyz.com/xyz.com-foreman-proxy for update
Preparing installation Done                                              
  Success!
  * Capsule is running at https://xyz.com:9090
  The full log is at /var/log/foreman-installer/capsule.log

Comment 10 errata-xmlrpc 2020-10-27 13:04:18 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