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 1668947 - subscription-manager does not use enable_metadata = 0 for disabled repositories
Summary: subscription-manager does not use enable_metadata = 0 for disabled repositories
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: rc
: 8.0
Assignee: Jiri Hnidek
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks: 1635157
TreeView+ depends on / blocked
 
Reported: 2019-01-23 23:07 UTC by Magnus Glantz
Modified: 2023-09-07 19:42 UTC (History)
11 users (show)

Fixed In Version: subscription-manager-1.23.8-19
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-14 02:03:21 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
redhat.repo file created from registering system (28.59 KB, text/plain)
2019-01-23 23:07 UTC, Magnus Glantz
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github candlepin subscription-manager pull 2029 0 'None' closed 1668947: set enable_metadata to 0 for disabled repos; ENT-1146 2021-01-28 07:40:07 UTC
Github candlepin subscription-manager pull 2063 0 'None' closed 1668947: The option is called enabled_metadata 2021-01-28 07:39:24 UTC
Red Hat Bugzilla 1667111 0 unspecified CLOSED PackageKit does not respect disabled repositories 2023-09-07 19:46:24 UTC
Red Hat Issue Tracker RHELPLAN-12053 0 None None None 2023-09-07 19:42:46 UTC

Internal Links: 1647562

Description Magnus Glantz 2019-01-23 23:07:56 UTC
Created attachment 1522906 [details]
redhat.repo file created from registering system

Description of problem:
The end-user problem is that when you check for Software Updates in Cockpit, this takes ~9 minutes. The reason for this is because subscription-manager does not properly configure disabled repositories, at least for this use-case.

When you register a system with 'subscription-manger register --auto-attach' on RHEL8 HTB Snapshot 2 (latest at time of writing), then registries which are NOT enabled are missing 'enable_metadata = 0'. 

This is not a problem when running 'yum/dnf' but when PackageKit processes metadata, it will process any repository which does not have 'enable_metadata = 0' defined. So, if you have a lot of disabled repositories, then when PackageKit looks for updated metadata for repositories to provide Cockpit with information, it takes minutes, instead of seconds. Information about PackageKit behavior was given by Richard Hughes, here: https://bugzilla.redhat.com/show_bug.cgi?id=1667111

On my test system, with some 50 disabled repositories, this effectively destroys Cockpits ability to check for updated software, as no end user will wait for 9 minutes while a white webpage loads (PackageKit walks through 50 disabled repositories).

Here's an example from /etc/yum.repos.d/redhat.repo regarding an disabled repository.

[rhel-atomic-7-cdk-3.0-source-rpms]
name = Red Hat Container Development Kit 3.0 /(Source RPMs)
baseurl = https://cdn.redhat.com/content/dist/rhel/atomic/7/7Server/$basearch/cdk/3.0/source/SRPMS
enabled = 0
gpgcheck = 1
gpgkey = http://
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/1616464139763360633-key.pem
sslclientcert = /etc/pki/entitlement/1616464139763360633.pem
metadata_expire = 86400
ui_repoid_vars = basearch

Version-Release number of selected component (if applicable):
RHEL8 HTB Snapshot 2 (latest at the time of writing)
subscription-manager-1.23.8-4.el8.x86_64

How reproducible:
Always

Steps to Reproduce:
1) Register Red Hat 8 HTB system with 'subscription-manager register --auto-attach'
2) Review /etc/yum.repos.d/redhat.repo
3) Run: 'pkcon -vp refresh force' and observe how disabled repos are processed, as expected from PackageKit's point of view.
4) Remove package definitions completely or add enable_metadata = 0 and observe how all is well.

Actual results:
subscription-manager does not define 'enable_metadata = 0' for disabled repositories.

Expected results:
subscription-manager defines 'enable_metadata = 0' for disabled repositories.

Additional info:
From RHEL 8 HTB program. BZ will be added to HTB tracker.

Comment 1 Martin Pitt 2019-01-24 08:13:20 UTC
*** Bug 1667111 has been marked as a duplicate of this bug. ***

Comment 7 Craig Donnelly 2019-02-07 19:07:14 UTC
Magnus,

We have implemented the fix on the subscription-manager side - 'enable_metadata = 0' is applied to all of the inactive repositories from the sub-man perspective.
With that said, it is still really slow in my opinion - and I still wouldn't wait the 48 seconds it took to loop through all of them anyway (Not on a web-page with no feedback, anyway).

That being the case, would you mind verifying this bug from your side that it meets your expectations?
From my standpoint this is now VERIFIED as far as subscription-manager is concerned.

[root@dhcp7-157 ~]# rpm -q subscription-manager
subscription-manager-1.23.8-19.el8.x86_64
[root@dhcp7-157 ~]# grep enable_metadata /etc/yum.repos.d/redhat.repo 
enable_metadata = 0
enable_metadata = 0
enable_metadata = 1
enable_metadata = 0
enable_metadata = 1
enable_metadata = 0
enable_metadata = 0
enable_metadata = 0
enable_metadata = 0
enable_metadata = 0
enable_metadata = 0
enable_metadata = 0
enable_metadata = 0
enable_metadata = 0
enable_metadata = 0
enable_metadata = 0
enable_metadata = 0
enable_metadata = 0
[root@dhcp7-157 ~]# time pkcon -vp refresh force
13:55:47	PackageKit          Verbose debugging enabled (on console 1)
13:55:47	PackageKit          filter=(null), filters=0
13:55:47	PackageKit          adding state 0x5607ed518800
13:55:47	PackageKit          role now refresh-cache
Transaction:	Refreshing cache
13:55:47	PackageKit          notify::connected
Status: 	Waiting in queue
Status: 	Waiting for authentication
Status: 	Waiting in queue
Status: 	Starting
Status: 	Loading cache
Status: 	Downloading repository information
Status: 	Loading cache
Status: 	Downloading repository information
Status: 	Loading cache
Percentage:	10
Status: 	Downloading repository information
Status: 	Loading cache
Status: 	Downloading repository information
Status: 	Loading cache
Percentage:	20
Status: 	Downloading repository information
Status: 	Loading cache
Status: 	Downloading repository information
Status: 	Loading cache
Status: 	Downloading repository information
Status: 	Loading cache
Status: 	Downloading repository information
Status: 	Loading cache
Status: 	Downloading repository information
Status: 	Loading cache
Status: 	Downloading repository information
Status: 	Loading cache
Status: 	Downloading repository information
Status: 	Loading cache
Status: 	Downloading repository information
Status: 	Loading cache
Status: 	Downloading repository information
Status: 	Loading cache
Status: 	Downloading repository information
Status: 	Loading cache
Status: 	Downloading repository information
Status: 	Loading cache
Status: 	Downloading repository information
Status: 	Loading cache
Status: 	Downloading repository information
Status: 	Loading cache
Percentage:	90
Status: 	Downloading repository information
Status: 	Loading cache
Status: 	Querying
Status: 	Loading cache
Percentage:	100
Status: 	Finished
13:56:35	PackageKit          remove state 0x5607ed518800
Results:

real	0m48.421s
user	0m0.036s
sys	0m0.029s

Comment 8 Magnus Glantz 2019-02-07 20:15:45 UTC
That seems weird, PackageKit seems to still be processing the repositories in your test. 
AFAIK, it should just print out: 

"Status: 	Downloading repository information" 

..twice - as only two repositories are enabled and without enable_metadata = 0. Let me test this.

Comment 9 John Sefler 2019-02-19 18:05:42 UTC
Re-testing version...

[root@kvm-01-guest22 ~]# rpm -q subscription-manager
subscription-manager-1.23.8-26.el8.x86_64

[root@kvm-01-guest22 ~]# subscription-manager register --serverurl=subscription.rhsm.stage.redhat.com --username=stage_auto_testuser --auto-attach
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Password: 
The system has been registered with ID: 0dc71f49-5011-42c7-86fe-7df347ea3afd
The registered system name is: kvm-01-guest22.lab.eng.rdu2.redhat.com
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 High Touch Beta
Status:       Subscribed

[root@kvm-01-guest22 ~]# dnf repolist --disablerepo=beaker*
Updating Subscription Management repositories.
Last metadata expiration check: 0:00:26 ago on Tue 19 Feb 2019 12:28:39 PM EST.
repo id                              repo name                                                    status
rhel-8-for-x86_64-appstream-htb-rpms Red Hat Enterprise Linux 8 for x86_64 - AppStream HTB (RPMs) 8,287
rhel-8-for-x86_64-baseos-htb-rpms    Red Hat Enterprise Linux 8 for x86_64 - BaseOS HTB (RPMs)    3,567

[root@kvm-01-guest22 ~]# egrep "^\[|enable" /etc/yum.repos.d/redhat.repo 
[rhel-8-for-x86_64-highavailability-htb-source-rpms]
enabled = 0
enable_metadata = 0
[codeready-builder-htb-for-rhel-8-x86_64-debug-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-appstream-htb-rpms]
enabled = 1
enable_metadata = 1
[rhel-8-for-x86_64-resilientstorage-htb-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-appstream-htb-source-rpms]
enabled = 0
enable_metadata = 0
[codeready-builder-htb-for-rhel-8-x86_64-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-baseos-htb-source-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-baseos-htb-debug-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-highavailability-htb-debug-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-rt-htb-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-rt-htb-source-rpms]
enabled = 0
enable_metadata = 0
[codeready-builder-htb-for-rhel-8-x86_64-source-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-resilientstorage-htb-debug-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-resilientstorage-htb-source-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-appstream-htb-debug-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-highavailability-htb-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-baseos-htb-rpms]
enabled = 1
enable_metadata = 1
[rhel-8-for-x86_64-rt-htb-debug-rpms]
enabled = 0
enable_metadata = 0
[root@kvm-01-guest22 ~]# 

VERIFIED: For every entitled repo that is enabled by default, its enable_metadata is also set to 1

[root@kvm-01-guest22 ~]# subscription-manager repos --enable rhel-8-for-x86_64-highavailability-htb-rpms
Repository 'rhel-8-for-x86_64-highavailability-htb-rpms' is enabled for this system.
[root@kvm-01-guest22 ~]# subscription-manager repos --enable rhel-8-for-x86_64-resilientstorage-htb-rpms
Repository 'rhel-8-for-x86_64-resilientstorage-htb-rpms' is enabled for this system.
[root@kvm-01-guest22 ~]# 
[root@kvm-01-guest22 ~]# egrep "^\[|enable" /etc/yum.repos.d/redhat.repo 
[rhel-8-for-x86_64-highavailability-htb-source-rpms]
enabled = 0
enable_metadata = 0
[codeready-builder-htb-for-rhel-8-x86_64-debug-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-appstream-htb-rpms]
enabled = 1
enable_metadata = 1
[rhel-8-for-x86_64-resilientstorage-htb-rpms]
enabled = 1
enable_metadata = 1
[rhel-8-for-x86_64-appstream-htb-source-rpms]
enabled = 0
enable_metadata = 0
[codeready-builder-htb-for-rhel-8-x86_64-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-baseos-htb-source-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-baseos-htb-debug-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-highavailability-htb-debug-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-rt-htb-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-rt-htb-source-rpms]
enabled = 0
enable_metadata = 0
[codeready-builder-htb-for-rhel-8-x86_64-source-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-resilientstorage-htb-debug-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-resilientstorage-htb-source-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-appstream-htb-debug-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-highavailability-htb-rpms]
enabled = 1
enable_metadata = 1
[rhel-8-for-x86_64-baseos-htb-rpms]
enabled = 1
enable_metadata = 1
[rhel-8-for-x86_64-rt-htb-debug-rpms]
enabled = 0
enable_metadata = 0
[root@kvm-01-guest22 ~]# 

VERIFIED: After using subscription-manager repos to enable additional repos (rhel-8-for-x86_64-highavailability-htb-rpms and rhel-8-for-x86_64-resilientstorage-htb-rpms), its enable_metadata is also enabled.


[root@kvm-01-guest22 ~]# subscription-manager repos --disable rhel-8-for-x86_64-appstream-htb-rpms
Repository 'rhel-8-for-x86_64-appstream-htb-rpms' is disabled for this system.
[root@kvm-01-guest22 ~]# 
[root@kvm-01-guest22 ~]# egrep "^\[|enable" /etc/yum.repos.d/redhat.repo 
[rhel-8-for-x86_64-highavailability-htb-source-rpms]
enabled = 0
enable_metadata = 0
[codeready-builder-htb-for-rhel-8-x86_64-debug-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-appstream-htb-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-resilientstorage-htb-rpms]
enabled = 1
enable_metadata = 1
[rhel-8-for-x86_64-appstream-htb-source-rpms]
enabled = 0
enable_metadata = 0
[codeready-builder-htb-for-rhel-8-x86_64-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-baseos-htb-source-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-baseos-htb-debug-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-highavailability-htb-debug-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-rt-htb-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-rt-htb-source-rpms]
enabled = 0
enable_metadata = 0
[codeready-builder-htb-for-rhel-8-x86_64-source-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-resilientstorage-htb-debug-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-resilientstorage-htb-source-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-appstream-htb-debug-rpms]
enabled = 0
enable_metadata = 0
[rhel-8-for-x86_64-highavailability-htb-rpms]
enabled = 1
enable_metadata = 1
[rhel-8-for-x86_64-baseos-htb-rpms]
enabled = 1
enable_metadata = 1
[rhel-8-for-x86_64-rt-htb-debug-rpms]
enabled = 0
enable_metadata = 0
[root@kvm-01-guest22 ~]# 

VERIFIED: After using subscription-manager repos to disable a repo (rhel-8-for-x86_64-appstream-htb-rpms), its enable_metadata is also disabled.


Moving bug to VERIFIED.  The repo attribute for enable_metadata is following the enabled attribute as requested.


Additional Testing...

[root@kvm-01-guest22 yum.repos.d]# time pkcon refresh force
Refreshing cache              [=========================]         
Starting                      [=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Finished                      [=========================]         

real	0m40.288s
user	0m0.024s
sys	0m0.019s


NEEDINFO on sudo
As alluded to in comment 7 and comment 8, pkcon appears to be downloading cache for all 18 of the repos regardless of the enabled/enable_metadata setting.  If this is wrong, then please open a bug against PackageKit and link it back to this bug for reference.

Comment 10 Magnus Glantz 2019-04-03 07:57:50 UTC
I'll open a BZ to PackageKit and link it here.

Comment 11 Richard Hughes 2019-04-04 08:08:40 UTC
The logic is sound, but there's a typo in this report and also the subman fix -- the option is called "enabled_metadata" NOT "enable_metadata".


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