Bug 1733287 - foreman-maintain should check for epel repo first
Summary: foreman-maintain should check for epel repo first
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Foreman Maintain
Version: Unspecified
Hardware: Unspecified
OS: Unspecified
medium vote
Target Milestone: 6.7.0
Assignee: Kavita
QA Contact: Stephen Wadeley
Depends On:
TreeView+ depends on / blocked
Reported: 2019-07-25 15:34 UTC by Stephen Wadeley
Modified: 2020-02-13 11:59 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed:
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Foreman Issue Tracker 29002 Normal Ready For Testing foreman-maintain should check for epel repo first 2020-02-17 16:21:53 UTC

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

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"

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

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