Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 2073558

Summary: subscription-manager release setting is not landing in the redhat.repo file
Product: Red Hat Enterprise Linux 8 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Pino Toscano <ptoscano>
Status: CLOSED ERRATA QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 8.6CC: candlepin-bugs, cdonnell, jhnidek, lmiksik, pvlasin, redakkan
Target Milestone: rcKeywords: Regression, Triaged
Target Release: 8.6Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.28.29-3.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2074111 (view as bug list) Environment:
Last Closed: 2022-05-10 15:23:24 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:
Bug Depends On:    
Bug Blocks: 2074111    

Description John Sefler 2022-04-08 19:42:47 UTC
Description of problem:
On an RC compose of RHEL8.6 with a GA product subscription attached, subscription-manager release --list correctly reports the available listing file.  However, when using subscription-manager --set to pin the release repo paths to a specific cdn path, the "$releasever" variable in the repo paths is NOT getting replaced by the release setting.  This is a regression from RHEL8.5 GA behavior and affects all consumers of extended update support content.



Version-Release number of selected component (if applicable):
DISTRO=RHEL-8.6.0-20220407.0
[root@kvm-06-guest14 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 3.2.22-1
subscription management rules: 5.41
subscription-manager: 1.28.29-2.el8

How reproducible:


Steps to Reproduce:
[root@kvm-06-guest14 ~]# subscription-manager register --auto-attach --serverurl=subscription.rhsm.stage.redhat.com
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: stage_rhsmqe_testuser01
Password: 
The system has been registered with ID: cee7787e-0e06-4351-a066-34cd8240e322
The registered system name is: kvm-06-guest14.hv2.lab.eng.bos.redhat.com
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64
Status:       Subscribed

[root@kvm-06-guest14 ~]# grep '$releasever' /etc/yum.repos.d/redhat.repo | wc --lines
42   <===== PASSED: MANY GA REPOS PATHS IN redhat.repo EMPLOY '$releasever'

[root@kvm-06-guest14 ~]# subscription-manager release --list
+-------------------------------------------+
          Available Releases
+-------------------------------------------+
8
8.0
8.1
8.2
8.3
8.4
8.5

[root@kvm-06-guest14 ~]# subscription-manager release --set=8.5
Release set to: 8.5

[root@kvm-06-guest14 ~]# grep '$releasever' /etc/yum.repos.d/redhat.repo | wc --lines
42   <====== FAILED: EXPECTED ZERO WHEN A RELEASE HAS BEEN SET BY SUBSCRIPTION-MANAGER

[root@kvm-06-guest14 ~]# grep '$releasever' /etc/yum.repos.d/redhat.repo
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/baseos/debug
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/sat-tools/6.5/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/sat-tools/6.6/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/sat-tools/6.7/source/SRPMS
baseurl = https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/baseos/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/sat-tools/6.8/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/sat-tools/6.6/debug
baseurl = https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/baseos/debug
baseurl = https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/appstream/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/sat-tools/6.9/debug
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/codeready-builder/debug
baseurl = https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/appstream/source/SRPMS
baseurl = https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/supplementary/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/sat-tools/6.10/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/baseos/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/appstream/debug
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/baseos/source/SRPMS
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/supplementary/source/SRPMS
baseurl = https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/supplementary/source/SRPMS
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/sat-tools/6.9/source/SRPMS
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/appstream/os
baseurl = https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/codeready-builder/source/SRPMS
baseurl = https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/supplementary/debug
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/sat-tools/6.10/source/SRPMS
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/sat-tools/6.7/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/sat-tools/6.8/debug
baseurl = https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/codeready-builder/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/sat-tools/6.10/debug
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/supplementary/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/sat-tools/6.9/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/sat-tools/6.5/source/SRPMS
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/codeready-builder/os
baseurl = https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/baseos/source/SRPMS
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/sat-tools/6.6/source/SRPMS
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/sat-tools/6.7/debug
baseurl = https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/codeready-builder/debug
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/sat-tools/6.8/source/SRPMS
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/sat-tools/6.5/debug
baseurl = https://cdn.redhat.com/content/dist/rhel8/$releasever/x86_64/appstream/debug
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/supplementary/debug
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/appstream/source/SRPMS
baseurl = https://cdn.redhat.com/content/eus/rhel8/$releasever/x86_64/codeready-builder/source/SRPMS
                                                   ^^^^^^^^^^^
                                                   ^^^^^^^^^^^
                                                   ^^^^^^^^^^^
                                                   ^^^^^^^^^^^
FAILED: Expected all of the $releasever variables in the paths above to be substituted with the "8.5" value that was set using "subscription-manager --set=8.5".

Actual results:
  above

Expected results:
  all occurrences of $releasever in /etc/yum.repos.d/redhat.repo should be substituted with the set release value.



Additional info:
Observe that this cache file is stale (and that manually removing it restores the expected results)...

[root@kvm-06-guest14 ~]# cat /var/lib/rhsm/cache/releasever.json
{"releaseVer": null}

[root@kvm-06-guest14 ~]# subscription-manager release
Release: 8.5

[root@kvm-06-guest14 ~]# grep '$releasever' /etc/yum.repos.d/redhat.repo | wc --lines
42   <===== FAILED: EXPECTED ZERO

[root@kvm-06-guest14 ~]# rm -f /var/lib/rhsm/cache/releasever.json

[root@kvm-06-guest14 ~]# subscription-manager release --set=8.5
Release set to: 8.5

[root@kvm-06-guest14 ~]# grep '$releasever' /etc/yum.repos.d/redhat.repo | wc --lines
0   <===== PASSED

[root@kvm-06-guest14 ~]# cat /var/lib/rhsm/cache/releasever.json
{"releaseVer": "8.5"}

Comment 6 John Sefler 2022-04-13 17:52:30 UTC
Pre-verification testing of build...

[root@hpe-dl380pgen8-02-vm-16 ~]# rpm -q subscription-manager
subscription-manager-1.28.29-3.el8.x86_64
[root@hpe-dl380pgen8-02-vm-16 ~]# rpm -q subscription-manager --changelog | grep 2073558 -B10
* Wed Apr 13 2022 Christopher Snyder <csnyder> 1.28.29-3
- refresh: clear also the release status (ptoscano)
- 2073558: clear the release cache on release change (ptoscano)

[root@hpe-dl380pgen8-02-vm-16 ~]# subscription-manager register --auto-attach --serverurl=subscription.rhsm.stage.redhat.com
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: stage_rhsmqe_testuser01 
Password: 
The system has been registered with ID: fe9c9f5f-5fe2-4de6-9313-1347fac1a774
The registered system name is: hpe-dl380pgen8-02-vm-16.hpe2.lab.eng.bos.redhat.com
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64
Status:       Subscribed

[root@hpe-dl380pgen8-02-vm-16 ~]# grep '$releasever' /etc/yum.repos.d/redhat.repo | wc --lines
42      <===== 42 OF THE ENTITLED REPO PATHS USE A $releasever VARIABLE

[root@hpe-dl380pgen8-02-vm-16 ~]# subscription-manager release --list
+-------------------------------------------+
          Available Releases
+-------------------------------------------+
8
8.0
8.1
8.2
8.3
8.4
8.5

[root@hpe-dl380pgen8-02-vm-16 ~]# subscription-manager release --set=8.5
Release set to: 8.5

[root@hpe-dl380pgen8-02-vm-16 ~]# grep '$releasever' /etc/yum.repos.d/redhat.repo | wc --lines
0       <===== PASSED: THE $relasever VARIABLE HAS BEEN SUBSTITUTED

[root@hpe-dl380pgen8-02-vm-16 ~]# subscription-manager release  --unset
Release preference has been unset

[root@hpe-dl380pgen8-02-vm-16 ~]# grep '$releasever' /etc/yum.repos.d/redhat.repo | wc --lines
42      <===== PASSED: THE $relasever VARIABLE HAS BEEN RESTORED AFTER RELEASE IS UNSET

[root@hpe-dl380pgen8-02-vm-16 ~]# subscription-manager release --set=8
Release set to: 8

[root@hpe-dl380pgen8-02-vm-16 ~]# grep '$releasever' /etc/yum.repos.d/redhat.repo | wc --lines
0       <===== PASSED: THE $relasever VARIABLE HAS BEEN SUBSTITUTED AGAIN

[root@hpe-dl380pgen8-02-vm-16 ~]# subscription-manager release --set=8.9
No releases match '8.9'.  Consult 'release --list' for a full listing.

[root@hpe-dl380pgen8-02-vm-16 ~]# subscription-manager release --set=8.4
Release set to: 8.4

[root@hpe-dl380pgen8-02-vm-16 ~]# egrep '$releasever|8\.4' /etc/yum.repos.d/redhat.repo
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/baseos/debug
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/sat-tools/6.9/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/baseos/source/SRPMS
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/sat-tools/6.8/source/SRPMS
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/codeready-builder/debug
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/supplementary/source/SRPMS
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/appstream/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/codeready-builder/source/SRPMS
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/sat-tools/6.5/source/SRPMS
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/sat-tools/6.6/os
baseurl = https://cdn.redhat.com/content/dist/rhel8/8.4/x86_64/codeready-builder/source/SRPMS
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/sat-tools/6.6/source/SRPMS
baseurl = https://cdn.redhat.com/content/dist/rhel8/8.4/x86_64/baseos/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/sat-tools/6.10/source/SRPMS
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/sat-tools/6.8/debug
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/sat-tools/6.9/source/SRPMS
baseurl = https://cdn.redhat.com/content/dist/rhel8/8.4/x86_64/baseos/debug
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/sat-tools/6.10/os
baseurl = https://cdn.redhat.com/content/dist/rhel8/8.4/x86_64/supplementary/source/SRPMS
baseurl = https://cdn.redhat.com/content/dist/rhel8/8.4/x86_64/codeready-builder/debug
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/sat-tools/6.9/debug
baseurl = https://cdn.redhat.com/content/dist/rhel8/8.4/x86_64/appstream/source/SRPMS
baseurl = https://cdn.redhat.com/content/dist/rhel8/8.4/x86_64/baseos/source/SRPMS
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/appstream/source/SRPMS
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/sat-tools/6.7/debug
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/sat-tools/6.10/debug
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/codeready-builder/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/sat-tools/6.5/os
baseurl = https://cdn.redhat.com/content/dist/rhel8/8.4/x86_64/supplementary/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/sat-tools/6.8/os
baseurl = https://cdn.redhat.com/content/dist/rhel8/8.4/x86_64/appstream/debug
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/supplementary/debug
baseurl = https://cdn.redhat.com/content/dist/rhel8/8.4/x86_64/supplementary/debug
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/sat-tools/6.5/debug
baseurl = https://cdn.redhat.com/content/dist/rhel8/8.4/x86_64/codeready-builder/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/supplementary/os
baseurl = https://cdn.redhat.com/content/dist/rhel8/8.4/x86_64/appstream/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/sat-tools/6.7/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/appstream/debug
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/baseos/os
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/sat-tools/6.6/debug
baseurl = https://cdn.redhat.com/content/eus/rhel8/8.4/x86_64/sat-tools/6.7/source/SRPMS
                                                   ^^^
                                                   ^^^
                                                   ^^^
                                                   ^^^
PASSED: All 42 REPO PATHS WITH $releasever HAVE BEEN SUBSTITUTED WITH THE MOST RECENTLY SET RELEASE VALUE


Additional pre-verification for the refresh command...
[root@hpe-dl380pgen8-02-vm-16 ~]# cat /var/lib/rhsm/cache/releasever.json
{"releaseVer": "8.4"}

[root@hpe-dl380pgen8-02-vm-16 ~]# subscription-manager refresh
All local data refreshed

[root@hpe-dl380pgen8-02-vm-16 ~]# cat /var/lib/rhsm/cache/releasever.json
cat: /var/lib/rhsm/cache/releasever.json: No such file or directory

[root@hpe-dl380pgen8-02-vm-16 ~]# yum repolist --disablerepo=beaker*
Updating Subscription Management repositories.
repo id                                                        repo name
rhel-8-for-x86_64-appstream-rpms                               Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
rhel-8-for-x86_64-baseos-rpms                                  Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)

[root@hpe-dl380pgen8-02-vm-16 ~]# cat /var/lib/rhsm/cache/releasever.json
{"releaseVer": "8.4"}

PASSED: THE REFRESH COMMAND CLEARS THE CACHED releasever AND SUBSEQUENT CALLS TO YUM RE-CASHED THE PREVIOUSLY SET RELEASE 



Verified:Tested against fixed in version subscription-manager-1.28.29-3.el8

Comment 9 John Sefler 2022-04-14 20:12:50 UTC
**  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **
                 This System is reserved by jsefler.

      Beaker Test information:
                         HOSTNAME=kvm-07-guest32.hv2.lab.eng.bos.redhat.com
                            JOBID=6510028
                         RECIPEID=11797275
                    RESULT_SERVER=
                           DISTRO=RHEL-8.6.0-20220414.2
                     ARCHITECTURE=x86_64

**  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **
[root@kvm-07-guest32 ~]# rpm -q subscription-manager
subscription-manager-1.28.29-3.el8.x86_64
[root@kvm-07-guest32 ~]# 
[root@kvm-07-guest32 ~]# rpm -q subscription-manager --changelog | grep 2073558 -B10
* Wed Apr 13 2022 Christopher Snyder <csnyder> 1.28.29-3
- refresh: clear also the release status (ptoscano)
- 2073558: clear the release cache on release change (ptoscano)
[root@kvm-07-guest32 ~]# 
[root@kvm-07-guest32 ~]# subscription-manager register --auto-attach --serverurl=subscription.rhsm.stage.redhat.com
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: stage_rhsmqe_testuser01
Password: 
The system has been registered with ID: f971e6ef-ff23-4936-bbb2-29b2eb7aa338
The registered system name is: kvm-07-guest32.hv2.lab.eng.bos.redhat.com
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64
Status:       Subscribed

[root@kvm-07-guest32 ~]# grep '$releasever' /etc/yum.repos.d/redhat.repo | wc --lines
42
[root@kvm-07-guest32 ~]# 
[root@kvm-07-guest32 ~]# subscription-manager release --list
+-------------------------------------------+
          Available Releases
+-------------------------------------------+
8
8.0
8.1
8.2
8.3
8.4
8.5
[root@kvm-07-guest32 ~]# 
[root@kvm-07-guest32 ~]# subscription-manager release --set=8.3
Release set to: 8.3
[root@kvm-07-guest32 ~]# grep '$releasever' /etc/yum.repos.d/redhat.repo | wc --lines
0
[root@kvm-07-guest32 ~]# 
[root@kvm-07-guest32 ~]# subscription-manager release --unset
Release preference has been unset
[root@kvm-07-guest32 ~]# 
[root@kvm-07-guest32 ~]# grep '$releasever' /etc/yum.repos.d/redhat.repo | wc --lines
42
[root@kvm-07-guest32 ~]# 
[root@kvm-07-guest32 ~]# cat /var/lib/rhsm/cache/releasever.json
{"releaseVer": ""}
[root@kvm-07-guest32 ~]# 
[root@kvm-07-guest32 ~]# subscription-manager refresh
All local data refreshed
[root@kvm-07-guest32 ~]# 
[root@kvm-07-guest32 ~]# cat /var/lib/rhsm/cache/releasever.json
cat: /var/lib/rhsm/cache/releasever.json: No such file or directory
[root@kvm-07-guest32 ~]# 


VERIFIED: nightly compose RHEL-8.6.0-20220414.2 includes subscription-manager-1.28.29-3.el8 which includes the fix for bug 2073558 as demonstrated above and comment 6

Comment 11 errata-xmlrpc 2022-05-10 15:23:24 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 (subscription-manager bug fix and enhancement update), 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-2022:2047