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 2203431 - [RFE]: dnf should show when the releasever variable is set
Summary: [RFE]: dnf should show when the releasever variable is set
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: dnf
Version: 9.2
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Packaging Maintenance Team
QA Contact: swm-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-12 16:28 UTC by Taft Sanders
Modified: 2023-08-16 08:07 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-06-08 07:40:52 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1707593 1 None None None 2023-09-22 12:59:23 UTC
Red Hat Bugzilla 2039032 0 unspecified CLOSED [RFE] Notify users of releasever lock in subscription-manager 2023-09-22 13:15:28 UTC
Red Hat Issue Tracker RHELPLAN-157109 0 None None None 2023-05-12 16:30:40 UTC

Description Taft Sanders 2023-05-12 16:28:47 UTC
1. Proposed title of this feature request  
n/a

2. Who is the customer behind the request?  
n/a

3. What is the nature and description of the request?  
Prevent yum/dnf from blindly interfering with repository access

4. Why does the customer need this? (List the business requirements here) 
To avoid custom configurations from interfering with Red Hat repository access.

5. How would the customer like to achieve this? (List the functional requirements here)  
- Upon registering, the /etc/{yum,dnf}/vars/ directory should be checked for variables used by rhsm, such as 'releasever' and 'basearch' to avoid conflict with subscription-manager implementation of these variables.

6. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.  
- Register a system with these variables in place as yum/dnf variables and see if subscription-manager register and yum/dnf commands show warnings for these variables being set.

7. Is there already an existing RFE upstream or in Red Hat Bugzilla?  
no

8. Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?  
no

9. Is the sales team involved in this request and do they have any additional input?  
no

10. List any affected packages or components.  


11. Would the customer be able to assist in testing this functionality if implemented?  
yes, I would

Comment 2 Pino Toscano 2023-05-15 08:48:16 UTC
Ah, the neverending issue of "sub-man vs dnf" in managing the "release" information of the system; see also bug 1707593 for something close to this (if not even the same?), and bug 2039032 for something "from the other way round".

The description is a bit lacking of details: can you please describe an actual situation (files changed, commands run, etc) that matches your request? I'm honestly not totally sure about what exactly this proposal is about.

Comment 3 Taft Sanders 2023-05-15 18:31:47 UTC
(In reply to Pino Toscano from comment #2)
> Ah, the neverending issue of "sub-man vs dnf" in managing the "release"
> information of the system; see also Red Hatbug 1707593 for something close
> to this (if not even the same?), and bug 2039032 for something "from the
> other way round".
> 
> The description is a bit lacking of details: can you please describe an
> actual situation (files changed, commands run, etc) that matches your
> request? I'm honestly not totally sure about what exactly this proposal is
> about.

Hey Pino,

The use case scenario is for users to understand the impact of settings that they have set and where they are set. When registering with a host with a release version set on an activation key or setting with a subscription-manager command, this value will inject itself in the redhat.repo file and not allow any settings local to yum/dnf to interject on the repository access. Typically, the release value for an activation key will not be set giving way to any local releasever variables set on the system. This has caused a number of customer's to open cases with Red Hat Support to understand why their system can't access repositories or update specific packages. Below is an example:
hammer> activation-key info --name test-releasever --organization-id 1
Name:                  test-releasever
Id:                    3
Host Limit:            Unlimited
Auto Attach:           true
Release Version:       9
Lifecycle Environment: Library
Content View:          Default Organization View
Host Collections:      

Content Overrides:     

System Purpose:        
    Service Level:  
    Purpose Usage:  
    Purpose Role:   
    Purpose Addons:

[root@drone90 ~]# subscription-manager register --org="Default_Organization" --activationkey="test-releasever"
The system has been registered with ID: 721df1fe-945a-4748-94ac-b35c53a16639
The registered system name is: drone90.usersys.redhat.com
[root@drone90 ~]# dnf repolist -v
Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, groups-manager, needs-restarting, playground, product-id, repoclosure, repodiff, repograph, repomanage, reposync, subscription-manager, uploadprofile
Updating Subscription Management repositories.
DNF version: 4.10.0
cachedir: /var/cache/dnf
Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)                                                                                     19 MB/s |  21 MB     00:01    
Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs)                                                                                        19 MB/s |  12 MB     00:00    
Repo-id            : rhel-9-for-x86_64-appstream-rpms
Repo-name          : Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)
Repo-revision      : 1683785834
Repo-updated       : Thu 11 May 2023 02:17:14 AM EDT
Repo-pkgs          : 10,808
Repo-available-pkgs: 10,602
Repo-size          : 30 G
Repo-baseurl       : https://bombsat612.d.sysmgmt.cee.redhat.com/pulp/content/Default_Organization/Library/content/dist/rhel9/9/x86_64/appstream/os
Repo-expire        : 86,400 second(s) (last: Mon 15 May 2023 01:47:27 PM EDT)
Repo-filename      : /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-revision      : 1683721183
Repo-updated       : Wed 10 May 2023 08:19:43 AM EDT
Repo-pkgs          : 3,682
Repo-available-pkgs: 3,682
Repo-size          : 5.2 G
Repo-baseurl       : https://bombsat612.d.sysmgmt.cee.redhat.com/pulp/content/Default_Organization/Library/content/dist/rhel9/9/x86_64/baseos/os
Repo-expire        : 86,400 second(s) (last: Mon 15 May 2023 01:47:28 PM EDT)
Repo-filename      : /etc/yum.repos.d/redhat.repo
Total packages: 14,647

[root@drone90 ~]# echo '9.1' > /etc/dnf/vars/releasever
[root@drone90 ~]# cat /etc/dnf/vars/releasever 
9.1

[root@drone90 ~]# subscription-manager release --unset
Release preference has been unset

[root@drone90 ~]# dnf clean all; dnf repolist -v
Updating Subscription Management repositories.
38 files removed
Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, groups-manager, needs-restarting, playground, product-id, repoclosure, repodiff, repograph, repomanage, reposync, subscription-manager, uploadprofile
Updating Subscription Management repositories.
DNF version: 4.10.0
cachedir: /var/cache/dnf
Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)                                                                                     29  B/s |  14  B     00:00    
Errors during downloading metadata for repository 'rhel-9-for-x86_64-appstream-rpms':
  - Status code: 404 for https://bombsat612.d.sysmgmt.cee.redhat.com/pulp/content/Default_Organization/Library/content/dist/rhel9/9.1/x86_64/appstream/os/repodata/repomd.xml (IP: 10.13.226.239)
Error: Failed to download metadata for repo 'rhel-9-for-x86_64-appstream-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
[root@drone90 ~]# subscription-manager release --show
Release not set
[root@drone90 ~]# subscription-manager release --list
+-------------------------------------------+
          Available Releases       
+-------------------------------------------+
6.7
6Server
7.4
7.9
7Server
8
8.0
8.1
8.2
8.3
8.4
8.5
8.6
8.7
9


In RHEL 7 the output of yum would include the variables used after the repo label to signify what values were used for any variables in the repository configuration:
[root@drone78 ~]# yum repolist
Loaded plugins: product-id, search-disabled-repos, subscription-manager
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
repo id                                                                        repo name                                                                              status
!rhel-7-server-optional-rpms/7Server/x86_64                                    Red Hat Enterprise Linux 7 Server - Optional (RPMs)                                    23,811
!rhel-7-server-rpms/7Server/x86_64                                             Red Hat Enterprise Linux 7 Server (RPMs)                                               33,665
repolist: 57,476

With the change in RHEL 8 to stop showing these values, there is no indication where or what values are being used when populating the variables in the Repo-baseurl value:
[root@drone90 ~]# 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)

[root@drone90 ~]# yum repolist -v
Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, groups-manager, needs-restarting, playground, product-id, repoclosure, repodiff, repograph, repomanage, reposync, subscription-manager, uploadprofile
Updating Subscription Management repositories.
YUM version: 4.10.0
cachedir: /var/cache/dnf
Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs)                                                                                    204  B/s |  14  B     00:00    
Errors during downloading metadata for repository 'rhel-9-for-x86_64-appstream-rpms':
  - Status code: 404 for https://bombsat612.d.sysmgmt.cee.redhat.com/pulp/content/Default_Organization/Library/content/dist/rhel9/9.1/x86_64/appstream/os/repodata/repomd.xml (IP: 10.13.226.239)
Error: Failed to download metadata for repo 'rhel-9-for-x86_64-appstream-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried


I'm very aware that this is most likely a duplicate of another bug or 2 or 3 and probably even a duplicate of a bug I created. But the need for change still exists even after several years of ever-changing RHSM behavior. 
Quite simply, my request is to have [subscription-manager, {subscriptin-manager plugin or yum/dnf}] report that a releasever variable exists on any use of the command. This should not cause a non-zero exit code, but just simply a warning message to any or all sources like stdout, rhsm.log, and the dnf log, that the system has a releasever and/or basearch value set in the yum/dnf var directory.

Comment 4 Pino Toscano 2023-05-16 05:52:44 UTC
(In reply to Taft Sanders from comment #3)
> The use case scenario is for users to understand the impact of settings that
> they have set and where they are set. When registering with a host with a
> release version set on an activation key or setting with a
> subscription-manager command, this value will inject itself in the
> redhat.repo file and not allow any settings local to yum/dnf to interject on
> the repository access. Typically, the release value for an activation key
> will not be set giving way to any local releasever variables set on the
> system. This has caused a number of customer's to open cases with Red Hat
> Support to understand why their system can't access repositories or update
> specific packages.

As I said, this sounds like another consequence of bug 1707593, and something for which bug 2039032 could potentially help.

> I'm very aware that this is most likely a duplicate of another bug or 2 or 3
> and probably even a duplicate of a bug I created. But the need for change
> still exists even after several years of ever-changing RHSM behavior. 
> Quite simply, my request is to have [subscription-manager,
> {subscriptin-manager plugin or yum/dnf}] report that a releasever variable
> exists on any use of the command. This should not cause a non-zero exit
> code, but just simply a warning message to any or all sources like stdout,
> rhsm.log, and the dnf log, that the system has a releasever and/or basearch
> value set in the yum/dnf var directory.

This is a request for dnf then, since it is what handles yum/dnf variables. I don't think subscription-manager should get even more into the business of what dnf does, since as you can see it creates lots of issues, and I honestly don't want more of those.

Hence, I'm routing this to dnf.

Comment 5 Jaroslav Mracek 2023-06-08 07:40:52 UTC
I've investigated our options and I discover that the request will be not so easy to implement. `releasever` is a substitution value  - string that does not remember who modify it. It can be modified by creating vars, environment value or a plugin can  override it. If the value is not set then DNF tries to auto-detect it. `releasever` is an optional part but when it is unset it complains, because it is often the reason why repositories are not functional (# dnf --installroot /tmp/test install <something>). I don't think it is a good idea to provide a warning for situation when releasever is set by user because it is intended for some use cases in RHEL environment.

Summary - the implementation will be demanding (unknown value origin) and the request has only limited benefit for users.

I am really sorry, but I am closing it.


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