Bug 1667111

Summary: PackageKit does not respect disabled repositories
Product: Red Hat Enterprise Linux 8 Reporter: Magnus Glantz <sudo>
Component: PackageKitAssignee: Richard Hughes <rhughes>
Status: CLOSED NOTABUG QA Contact: Desktop QE <desktop-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0CC: jkoten, klember, mclasen, mmcgrath, mpitt, tpelka, vanhoof
Target Milestone: rcKeywords: Reopened
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-31 08:43:10 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: 1635157    

Description Magnus Glantz 2019-01-17 13:22:27 UTC
Description of problem:
Packagekit does not respect disabled yum repositories and therefor tries to download repository information for all repositories defined in /etc/yum.repos.d/* disabled and enabled. This causes extensive delays to get information about available updates and packages.

Version-Release number of selected component (if applicable):
In RHEL8 HTB latest snapshot (snapshot 2), PackageKit-1.1.12-2.el8.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Install minimal RHEL8 Beta Snapshot 2
2. Register with 'subscription-manager register --auto-attach'
3. Ensure you have a number of repositories which are disabled.
4. Run 'pkcon -vp refresh force'
5. Observe how output from 'pkcon -vp refresh force' indicates downloading repository information for disabled repositories.

Actual results:
[root@rhel8htb ~]# grep "enabled = 0" /etc/yum.repos.d/redhat.repo |wc -l
56
[root@rhel8htb ~]# grep "enabled = 1" /etc/yum.repos.d/redhat.repo |wc -l
2
[root@rhel8htb ~]# time pkcon -vp refresh force
15:37:25	PackageKit          Verbose debugging enabled (on console 1)
15:37:25	PackageKit          filter=(null), filters=0
15:37:25	PackageKit          adding state 0x56132e6cd000
15:37:25	PackageKit          role now refresh-cache
Transaction:	Refreshing cache
15:37:25	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
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
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:	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
Percentage:	30
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
Status: 	Downloading repository information
Status: 	Loading cache
Status: 	Downloading repository information
Status: 	Loading cache
Percentage:	60
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:	80
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: 	Downloading repository information
Status: 	Loading cache
Status: 	Downloading repository information
Status: 	Loading cache
Status: 	Querying
Status: 	Loading cache
Percentage:	100
Status: 	Finished
15:41:38	PackageKit          remove state 0x56132e6cd000
Results:

real	4m12.750s
user	0m0.038s
sys	0m0.015s

# Removing disabled repositories from /etc/yum.repos.d/redhat.repo

[root@rhel8htb ~]# time pkcon -vp refresh force
15:49:53	PackageKit          Verbose debugging enabled (on console 1)
15:49:53	PackageKit          filter=(null), filters=0
15:49:53	PackageKit          adding state 0x565042afc000
15:49:53	PackageKit          role now refresh-cache
Transaction:	Refreshing cache
15:49:53	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
Status: 	Querying
Status: 	Loading cache
Percentage:	100
Status: 	Finished
15:50:40	PackageKit          remove state 0x565042afc000
Results:

real	0m46.270s
user	0m0.012s
sys	0m0.010s
[root@rhel8htb ~]# 

Expected results:
PackageKit does not process disabled repositories.

Additional info:
Bumped into problem when troubleshooting BZ#1662123

Comment 2 Magnus Glantz 2019-01-17 13:31:14 UTC
So that it's clear, this issue hits a specific feature in RHEL8 Cockpit, which allows users to see available updates for a system. As it is, this features is effectively broken due to this, as it takes many minutes for an end user to get any information. Most users will just assume the feature is broken, or stop using it, as 'yum check-update' will return an answer many minutes faster.

Comment 4 Richard Hughes 2019-01-23 17:19:17 UTC
This is by design, enabled_metadata=0 will prevent that behavior for the .repo file. It's been this way for about 4 years, and see this link for the rationalle https://blogs.gnome.org/hughsie/2015/01/09/finding-hidden-applications-with-gnome-software/

Comment 5 Magnus Glantz 2019-01-23 22:41:47 UTC
(In reply to Richard Hughes from comment #4)
> This is by design, enabled_metadata=0 will prevent that behavior for the
> .repo file. It's been this way for about 4 years, and see this link for the
> rationalle
> https://blogs.gnome.org/hughsie/2015/01/09/finding-hidden-applications-with-
> gnome-software/

Aha, then, hm, I guess this is a subscription-manager issue then. The end-user problem is Cockpit taking 9 minutes to see if there are software updates :)

Comment 6 Martin Pitt 2019-01-24 08:10:09 UTC
Thanks, moving to subscription-manager then.

Comment 7 Martin Pitt 2019-01-24 08:13:20 UTC
Oh, I see, there is now a new bug for this: 1668947

*** This bug has been marked as a duplicate of bug 1668947 ***

Comment 8 Magnus Glantz 2019-04-03 08:07:14 UTC
I'm sorry, but it seems that PackageKit ignores the enable_metadata option. Please see: BZ#1668947

Comment 9 Magnus Glantz 2019-04-03 08:08:39 UTC
Reassigning to PackageKit

Comment 10 Magnus Glantz 2019-04-03 08:10:45 UTC
Changed headline to better reflect the issue

Comment 11 Richard Hughes 2019-04-04 08:09:24 UTC
The option is called enabled_metadata, not enable_metadata -- I've commented on thesubman bug to this affect too.

Comment 12 Matthias Clasen 2019-04-04 16:10:05 UTC
sounds like not a bug, then

Comment 14 Magnus Glantz 2019-04-05 06:16:18 UTC
Thanks Richard :-)

Comment 18 Richard Hughes 2019-07-31 08:43:10 UTC
> The option is called enabled_metadata, not enable_metadata -- I've commented on thesubman bug to this affect too.

I'll close this one as PK is doing exactly as it should do.