Bug 1733287

Summary: foreman-maintain should check for epel repo first
Product: Red Hat Satellite Reporter: Stephen Wadeley <swadeley>
Component: Foreman MaintainAssignee: Kavita <kgaikwad>
Status: CLOSED ERRATA QA Contact: Stephen Wadeley <swadeley>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.6.0CC: apatel, bkearney, inecas, jpathan, kgaikwad, mbacovsk, mmccune
Target Milestone: 6.8.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-foreman_maintain-0.6.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-27 12:38:20 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:

Description Stephen Wadeley 2019-07-25 15:34:27 UTC
Description of problem:

Procedures::Packages::Install should be after epel repo check

If you have epel repo enabled and run foreman-maintain its possible it will fail when it tries to get packages for the speed test.


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

[root@dell-r330-12 ~]# rpm -q rubygem-foreman_maintain
rubygem-foreman_maintain-0.4.5-1.el7sat.noarch

How reproducible:
depends on packages versions for libpmem at the time


Steps to Reproduce:
1. enable epel repo (yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm)
2. foreman-maintain upgrade run --target-version 6.6.z --whitelist="disk-performance,repositories-validate,repositories-setup"
3.

Actual results:

~]# foreman-maintain upgrade run --target-version 6.6.z
Running preparation steps required to run the next scenarios
================================================================================
Procedures::Packages::Install: Error: Package: libpmem-devel-1.1-1.el7.x86_64 (epel)
           Requires: libpmem = 1.1-1.el7
           Available: libpmem-1.1-1.el7.x86_64 (epel)
               libpmem = 1.1-1.el7
           Available: libpmem-1.1-4.el7.x86_64 (rhel-7-server-rpms)
               libpmem = 1.1-4.el7
           Available: libpmem-1.2.1-4.el7.x86_64 (rhel-7-server-rpms)
               libpmem = 1.2.1-4.el7
           Available: libpmem-1.3-3.el7.x86_64 (rhel-7-server-rpms)
               libpmem = 1.3-3.el7
           Installing: libpmem-1.4-3.el7.x86_64 (rhel-7-server-rpms)
               libpmem = 1.4-3.el7



Expected results:

Check if EPEL repository enabled on system: 
| Checking for presence of EPEL repository  


Additional info:

foreman-maintain should not attempt to install packages for speed check if you use --whitelist="disk-performance" command option.

Comment 2 Kavita 2020-02-13 10:27:43 UTC
Created redmine issue https://projects.theforeman.org/issues/29002 from this bug

Comment 3 Kavita 2020-02-13 11:59:27 UTC
Hello Stephen,

There are steps that can require some additional steps to be performed before foreman-maintain can proceed. A typical example is installing additional dependencies.
In foreman-maintain, these additional steps are called as preparation steps and these will be run as separate scenario all together.
Through foreman-maintain we can control ordering for checks but running these preparation steps and running pre-upgrade checks are two different scenarios.

To achieve what you have mentioned i.e foreman-maintain should check for epel repo first in case of pre-upgrade checks and 
to avoid repetitive conditional checking of EPEL repository each time for every package install preparation step.
I need to run this EPEL repository check explicitly as a part of preparation steps scenario when any package installation step added.
In results, user will see that this check will be run twice one while running preparation steps and one as part of pre-upgrade checks.

- Kavita

Comment 5 Stephen Wadeley 2020-02-28 17:22:27 UTC
Hello Kaviata

thanks for comment 3

it sounds unavoidable then, the double check.

Thank you

Comment 6 Bryan Kearney 2020-05-14 16:05:51 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/29002 has been resolved.

Comment 21 errata-xmlrpc 2020-10-27 12:38:20 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 (Satellite 6.8 Satellite Maintenance 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/RHBA-2020:4365