Bug 1486445 - foreman-maintain upgrade fails to properly enable 6.2 repos
Summary: foreman-maintain upgrade fails to properly enable 6.2 repos
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Foreman Maintain
Version: 6.1.11
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Anurag Patel
QA Contact: Nikhil Kathole
URL:
Whiteboard:
Depends On:
Blocks: 1496794
TreeView+ depends on / blocked
 
Reported: 2017-08-29 18:40 UTC by Mike McCune
Modified: 2019-09-26 15:38 UTC (History)
5 users (show)

Fixed In Version: foreman-maintain-0.0.9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-19 17:22:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 20798 0 None None None 2017-09-18 12:41:13 UTC
Red Hat Product Errata RHBA-2018:0330 0 normal SHIPPED_LIVE Satellite Maintenance bug fix update 2018-02-19 22:22:51 UTC

Description Mike McCune 2017-08-29 18:40:20 UTC
Have a 6.1 instance trying to upgrade and it attempts to enable non-existent repositories:

# ./bin/foreman-maintain upgrade  run  --target-version 6.2 --whitelist=disk-io
...
Running migration scripts to Satellite 6.2
================================================================================
Setup repositories: 
| Configuring repositories for 6.2                                    [FAIL]    
Failed executing subscription-manager repos --enable=rhel-18-server-rpms --enable=rhel-18-rhscl-18-rpms --enable=rhel-18-server-satellite-6.2-rpms, exit status 1:
 Error: 'rhel-18-server-rpms' does not match a valid repository ID. Use "subscription-manager repos --list" to see valid repositories.
Error: 'rhel-18-rhscl-18-rpms' does not match a valid repository ID. Use "subscription-manager repos --list" to see valid repositories.
Error: 'rhel-18-server-satellite-6.2-rpms' does not match a valid repository ID. Use "subscription-manager repos --list" to see valid repositories.

I'm not sure where this '18' is coming from but that doesn't map to anything available.

Comment 2 Mike McCune 2017-08-29 18:49:58 UTC
Looks like the parsing from the RPM string is off:


# rpm -qf /etc/redhat-release
redhat-release-server-7.4-18.el7.x86_64

it is getting the '18' vs the 7.4

we also really do NOT want to use 7.4 and want to use 7Server or 6Server. Never pin to a specific version of RHEL as there won't ever exist a repo-id for:

rhel-7.4-server-satellite-6.2-rpms

and instead we only have:

rhel-7-server-satellite-6.2-rpms

I'd suggest switching to facter vs parsing the RPM:

# facter operatingsystemmajrelease
7

Comment 3 Mike McCune 2017-08-29 19:53:20 UTC
we also have the wrong repo-id for the SCL:

 Error: 'rhel-7-rhscl-7-rpms' does not match a valid repository ID. Use "subscription-manager repos --list" to see valid repositories.


it is:

 rhel-server-rhscl-7-rpms 

no need for the extra 7

Comment 4 Sachin Ghai 2017-09-05 12:46:41 UTC
Yeah, I hit the same issue today on rhel6 system:

 Error: 'rhel-6-rhscl-6-rpms' does not match a valid repository ID.

it should be: rhel-server-rhscl-6-rpms

Comment 5 Nikhil Kathole 2017-12-19 10:44:53 UTC
VERIFIED

Version Tested:
# rpm -q rubygem-foreman_maintain
rubygem-foreman_maintain-0.1.1-1.el7sat.noarch

D, [2017-12-19 05:39:08-0500 #107219] DEBUG -- : Running command subscription-manager repos --enable=rhel-7-server-rpms --enable=rhel-server-rhscl-7-rpms --enable=rhel-7-server-satellite-6.2-rpms with stdin nil
D, [2017-12-19 05:39:18-0500 #107219] DEBUG -- : output of the command:
 Repository 'rhel-7-server-rpms' is enabled for this system.
Repository 'rhel-7-server-satellite-6.2-rpms' is enabled for this system.
Repository 'rhel-server-rhscl-7-rpms' is enabled for this system.

Upgrading from 6.1 to 6.2 on rhel 7 correctly enabled the repositories.

Comment 8 errata-xmlrpc 2018-02-19 17:22:26 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-2018:0330


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