Bug 2074110

Summary: subscription-manager release setting is not landing in the redhat.repo file [rhel-9.1.0]
Product: Red Hat Enterprise Linux 9 Reporter: RHEL Program Management Team <pgm-rhel-tools>
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: 9.0CC: candlepin-bugs, cdonnell, jsefler, pvlasin, redakkan, zpetrace
Target Milestone: rcKeywords: Regression, Triaged
Target Release: 9.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.29.29-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2073551 Environment:
Last Closed: 2022-11-15 11:19:30 UTC Type: ---
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: 2073551    
Bug Blocks:    

Comment 3 Rehana 2022-04-25 11:51:12 UTC
// Pre-verifying on : 
===================

# subscription-manager register
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: sca_rhsm_1
Password: 
The system has been registered with ID: a1b9d8b4-a5cb-48c1-b4f6-0e209403726d
The registered system name is: kvm-01-guest19.lab.eng.rdu2.redhat.com

# subscription-manager repos --list-enabled
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   rhel-9-for-x86_64-baseos-rpms
Repo Name: Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs)
Repo URL:  https://cdn.stage.redhat.com/content/dist/rhel9/$releasever/x86_64/baseos/os
Enabled:   1

Repo ID:   rhel-9-for-x86_64-appstream-rpms
Repo Name: Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)
Repo URL:  https://cdn.stage.redhat.com/content/dist/rhel9/$releasever/x86_64/appstream/os
Enabled:   1

# subscription-manager release --list
+-------------------------------------------+
          Available Releases       
+-------------------------------------------+
9
9.0
9.1

# subscription-manager release --set=9.0
Release set to: 9.0
[root@kvm-01-guest19 ~]# subscription-manager repos --list-enabled
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   rhel-9-for-x86_64-baseos-rpms
Repo Name: Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs)
Repo URL:  https://cdn.stage.redhat.com/content/dist/rhel9/9.0/x86_64/baseos/os
Enabled:   1

Repo ID:   rhel-9-for-x86_64-appstream-rpms
Repo Name: Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)
Repo URL:  https://cdn.stage.redhat.com/content/dist/rhel9/9.0/x86_64/appstream/os
Enabled:   1

# yum repolist
Updating Subscription Management repositories.
repo id                                                                               repo name
rhel-9-for-x86_64-appstream-rpms                                                      Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)
rhel-9-for-x86_64-baseos-rpms                                                         Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs)

ˆ^Notice the $releasever is the repo url was replaced by the release version set on the system. Based on the observation , pre verifying the bug

Comment 7 Zdenek Petracek 2022-07-25 13:41:37 UTC
SUBMAN version:
[root@kvm-02-guest09 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 4.0.18-2
subscription management rules: 5.41
subscription-manager: 1.29.29-1.el9

Registering:
[root@kvm-02-guest09 ~]# subscription-manager register
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: zpetracePH03
Password: 


[root@kvm-02-guest09 pki]# subscription-manager repos --list-enabled
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   rhel-9-for-x86_64-appstream-rpms
Repo Name: Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel9/$releasever/x86_64/appstream/os
Enabled:   1

Repo ID:   rhel-9-for-x86_64-baseos-rpms
Repo Name: Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel9/$releasever/x86_64/baseos/os
Enabled:   1

[root@kvm-02-guest09 pki]# subscription-manager release --list
+-------------------------------------------+
          Available Releases       
+-------------------------------------------+
9
9.0

[root@kvm-02-guest09 pki]# subscription-manager release --set=9.0
Release set to: 9.0


[root@kvm-02-guest09 pki]# subscription-manager repos --list-enabled
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   rhel-9-for-x86_64-baseos-rpms
Repo Name: Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel9/9.0/x86_64/baseos/os
Enabled:   1

Repo ID:   rhel-9-for-x86_64-appstream-rpms
Repo Name: Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel9/9.0/x86_64/appstream/os
Enabled:   1
^^ $releasever was changed by the release version set on the system = PASSED

Comment 9 errata-xmlrpc 2022-11-15 11:19:30 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:8341