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 1463383

Summary: [RFE] Satellite installer should not run on systems which have hotfixes applied
Product: Red Hat Satellite Reporter: Rich Jerrido <rjerrido>
Component: Satellite MaintainAssignee: Kavita <kgaikwad>
Status: CLOSED ERRATA QA Contact: Jameer Pathan <jpathan>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.9CC: apatel, bkearney, cdonnell, egolov, inecas, jcallaha, kgaikwad, mbacovsk, vijsingh, zhunting
Target Milestone: 6.6.0Keywords: FutureFeature, PrioBumpGSS
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-foreman_maintain-0.4.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-22 16:36:54 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 Rich Jerrido 2017-06-20 17:47:32 UTC
Description of problem:

As a user of Red Hat Satellite, there are times when a newer release (either a .y or .z release) is available which doesn't contain an errata for which the user has applied a hotfix for. If the user applies the latest erratum, the hotfix may be overwritten. This RFE requests an installer check to prevent the user from upgrading if there are hotfixes applied. 


Example Current Scenario:

- user has version 6.2.7 applied. 
- due to a bug, user was issued a hotfix, with the proper errata slated for 6.2.9
- 6.2.8 is released. 
- If user upgrades to 6.2.8, they may inadvertently negate the effects of their hotfix. 

 
Example Ideal Scenario:

- user has version 6.2.7 applied. 
- due to a bug, user was issued a hotfix, with the proper errata slated for 6.2.9
- 6.2.8 is released. 
- When user attempts upgrade to 6.2.8, the installer will check the installed RPMs and stop if any hotfix packages are installed. 
- The user would be presented with an option to override the installer (with a switch similar to --disable-system-checks) if needed

Comment 1 Rich Jerrido 2017-06-20 17:58:10 UTC
Note (and these are suggestions) 

- the upstream installer has the '--disable-system-checks       This option will skip the system checks for memory. (default: false)' option, which could be leveraged for this. 
- this _could_ be implemented via foreman-maintain or the installer. 

1) foreman-maintain health check --label hotfix-check 
2) yum update
3) satellite-installer --upgrade.

Comment 2 Kavita 2018-10-12 07:11:58 UTC
Created redmine issue http://projects.theforeman.org/issues/25186 from this bug

Comment 3 Bryan Kearney 2019-01-15 09:08:32 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25186 has been resolved.

Comment 4 Bryan Kearney 2019-01-15 09:09:20 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25186 has been resolved.

Comment 5 Bryan Kearney 2019-01-15 09:10:26 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25186 has been resolved.

Comment 6 Bryan Kearney 2019-01-15 09:11:23 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25186 has been resolved.

Comment 7 Bryan Kearney 2019-01-15 09:12:20 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25186 has been resolved.

Comment 8 Bryan Kearney 2019-01-15 09:13:29 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25186 has been resolved.

Comment 9 Bryan Kearney 2019-01-15 09:14:22 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25186 has been resolved.

Comment 10 Bryan Kearney 2019-01-15 09:15:31 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25186 has been resolved.

Comment 11 Bryan Kearney 2019-01-15 09:16:43 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25186 has been resolved.

Comment 13 Jameer Pathan 2019-05-30 10:13:59 UTC
Verified

@Satellite 6.6.0 snap 4
@rubygem-foreman_maintain-0.4.1-1.el7sat.noarch

Steps:
- applied a hotfix on satellite 
- modified file related to foreman
- Run # foreman-maintain health check --label check-hotfix-installed

Observation:
- Foreman-maintain was able to detect modified files and installed hotfix on system

# foreman-maintain health check --label check-hotfix-installed
Running ForemanMaintain::Scenario::FilteredScenario
================================================================================
Check to verify if any hotfix installed on system: 
- Checking for presence of hotfix(es). It may take some time to verify.         
                                                                      [WARNING]

HOTFIX rpm(s) applied on this system:
utils-1.0.0-1.HOTFIX.noarch

Found 1 file(s) modified on this system.
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman_remote_execution-0.1.0/lib/hammer_cli_foreman_remote_execution/options/normalizers.rb

*** WARNING: Before update make sure the updated packages contain the listed modifications
*** otherwise these fixes will be lost. 
*** It is also recommended to backup the modified files prior update.
--------------------------------------------------------------------------------
Scenario [ForemanMaintain::Scenario::FilteredScenario] failed.

The following steps ended up in warning state:

  [check-hotfix-installed]

The steps in warning state itself might not mean there is an error,
but it should be reviews to ensure the behavior is expected

Additional info:
- The check 'check-hotfix-installed' only gives warning to user.
- The installed hotfix package should have "HOTFIX" mentioned in it's release 
otherwise check won't work.(e.g. utils-1.0.0-1.HOTFIX.noarch)

Comment 14 Jameer Pathan 2019-05-30 10:19:38 UTC
Additional info:
- If the system is subscribed using custom activation key, then 'check-hotfix-installed' will be skipped.

# foreman-maintain health check --label check-hotfix-installed
Running ForemanMaintain::Scenario::FilteredScenario
================================================================================
Check to verify if any hotfix installed on system:                    [SKIPPED]
Your system is subscribed using custom activation key. Hotfixes can't be detected.
--------------------------------------------------------------------------------

Comment 17 errata-xmlrpc 2019-10-22 16:36:54 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, 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-2019:3181