Bug 1654491 - product-id plugin fails to install product certificates from CDN
Summary: product-id plugin fails to install product certificates from CDN
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
urgent
high
Target Milestone: rc
: 8.0
Assignee: Jiri Hnidek
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On: 1647633
Blocks: 1647127
TreeView+ depends on / blocked
 
Reported: 2018-11-28 21:57 UTC by John Sefler
Modified: 2019-06-14 01:17 UTC (History)
6 users (show)

Fixed In Version: subscription-manager-1.23.8-8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-14 01:17:25 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github candlepin subscription-manager pull 1984 None None None 2018-12-13 18:17:15 UTC
Red Hat Bugzilla 1647633 None None None 2019-07-17 14:11:01 UTC

Internal Links: 1647633

Description John Sefler 2018-11-28 21:57:46 UTC
Description of problem:
This bug is really a continuation of the failing usage scenario reported in Bug 1647633.  Now that dnf Bug 1647633 is ON_QA, the subsequent task is to fix dnf-plugin-subscription-manager to consume the transaction info from dnf.


Version-Release number of selected component (if applicable):
[root@dell-r730-002-guest29 ~]# rpm -q dnf dnf-plugin-subscription-manager
dnf-4.0.9-1.el8.noarch
dnf-plugin-subscription-manager-1.23.8-2.el8.x86_64  <===== (with a WORKAROUND applied for bug 1651669)

How reproducible:


Steps to Reproduce:
[root@dell-r730-002-guest29 ~]# subscription-manager config --server.hostname=subscription.rhsm.stage.redhat.com --logging.default_log_level=DEBUG --rhsm.baseurl=https://cdn.stage.redhat.com

[root@dell-r730-002-guest29 ~]# subscription-manager register --auto-attach
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: rhel8-htb-beta
Password: 
The system has been registered with ID: 18583cb5-22ee-4db8-ba88-9511d57464c7
The registered system name is: dell-r730-002-guest29.dsal.lab.eng.rdu2.redhat.com
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 High Touch Beta
Status:       Subscribed

[root@dell-r730-002-guest29 ~]# 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@dell-r730-002-guest29 ~]# subscription-manager repos --list-enabled | grep rhel-8-for-x86_64-highavailability-htb-rpms -A3
Repo ID:   rhel-8-for-x86_64-highavailability-htb-rpms
Repo Name: Red Hat Enterprise Linux 8 for x86_64 - High Availability HTB (RPMs)
Repo URL:  https://cdn.stage.redhat.com/content/htb/rhel8/8/x86_64/highavailability/os
Enabled:   1

[root@dell-r730-002-guest29 ~]# dnf repolist
Updating Subscription Management repositories.
Updating Subscription Management repositories.
Red Hat Enterprise Linux 8 for x86_64 - AppStream HTB (RP 2.0 MB/s | 8.8 MB     00:04    
Red Hat Enterprise Linux 8 for x86_64 - BaseOS HTB (RPMs) 1.5 MB/s | 4.1 MB     00:02    
Red Hat Enterprise Linux 8 for x86_64 - High Availability  38 kB/s | 106 kB     00:02    
repo id                                     repo name                               status
rhel-8-for-x86_64-appstream-htb-rpms        Red Hat Enterprise Linux 8 for x86_64 - 5,692
rhel-8-for-x86_64-baseos-htb-rpms           Red Hat Enterprise Linux 8 for x86_64 - 2,238
rhel-8-for-x86_64-highavailability-htb-rpms Red Hat Enterprise Linux 8 for x86_64 -    45

[root@dell-r730-002-guest29 ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux for x86_64 High Touch Beta
Product ID:     230
Version:        8.0 HTB
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         11/07/2018
Ends:           11/06/2019

[root@dell-r730-002-guest29 ~]# dnf install libknet1 --debuglevel=3 --assumeyes --nogpgcheck
Loaded plugins: builddep, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, needs-restarting, playground, product-id, repoclosure, repodiff, repograph, repomanage, reposync, subscription-manager
Updating Subscription Management repositories.
DNF version: 4.0.9
cachedir: /var/cache/dnf
Updating Subscription Management repositories.
repo: using cache for: rhel-8-for-x86_64-appstream-htb-rpms
not found other for: Red Hat Enterprise Linux 8 for x86_64 - AppStream HTB (RPMs)
not found deltainfo for: Red Hat Enterprise Linux 8 for x86_64 - AppStream HTB (RPMs)
rhel-8-for-x86_64-appstream-htb-rpms: using metadata from Mon 26 Nov 2018 03:23:53 PM EST.
repo: using cache for: rhel-8-for-x86_64-baseos-htb-rpms
not found other for: Red Hat Enterprise Linux 8 for x86_64 - BaseOS HTB (RPMs)
not found modules for: Red Hat Enterprise Linux 8 for x86_64 - BaseOS HTB (RPMs)
not found deltainfo for: Red Hat Enterprise Linux 8 for x86_64 - BaseOS HTB (RPMs)
rhel-8-for-x86_64-baseos-htb-rpms: using metadata from Tue 27 Nov 2018 05:38:48 AM EST.
repo: using cache for: rhel-8-for-x86_64-highavailability-htb-rpms
not found other for: Red Hat Enterprise Linux 8 for x86_64 - High Availability HTB (RPMs)
not found modules for: Red Hat Enterprise Linux 8 for x86_64 - High Availability HTB (RPMs)
not found deltainfo for: Red Hat Enterprise Linux 8 for x86_64 - High Availability HTB (RPMs)
rhel-8-for-x86_64-highavailability-htb-rpms: using metadata from Tue 27 Nov 2018 05:38:03 AM EST.
Last metadata expiration check: 0:03:48 ago on Wed 28 Nov 2018 04:32:51 PM EST.
Completion plugin: Generating completion cache...
--> Starting dependency resolution
---> Package libknet1.x86_64 1.4-2.el8 will be installed
--> Finished dependency resolution
Dependencies resolved.
==========================================================================================
 Package     Arch      Version       Repository                                      Size
==========================================================================================
Installing:
 libknet1    x86_64    1.4-2.el8     rhel-8-for-x86_64-highavailability-htb-rpms     69 k

Transaction Summary
==========================================================================================
Install  1 Package

Total download size: 69 k
Installed size: 161 k
Downloading Packages:
libknet1-1.4-2.el8.x86_64.rpm                             169 kB/s |  69 kB     00:00    
------------------------------------------------------------------------------------------
Total                                                     169 kB/s |  69 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                  1/1 
  Installing       : libknet1-1.4-2.el8.x86_64                                        1/1 
  Running scriptlet: libknet1-1.4-2.el8.x86_64                                        1/1 
  Verifying        : libknet1-1.4-2.el8.x86_64                                        1/1 
Completion plugin: Generating completion cache...
Installed products updated.

Installed:
  libknet1-1.4-2.el8.x86_64                                                               

Complete!

[root@dell-r730-002-guest29 ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux for x86_64 High Touch Beta
Product ID:     230
Version:        8.0 HTB
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         11/07/2018
Ends:           11/06/2019

[root@dell-r730-002-guest29 ~]# 


FAILED:  EXPECTED THE PRODUCTID CERTIFICATE FROM http://cdn.stage.redhat.com/content/htb/rhel8/8/x86_64/highavailability/os/repodata/14201d49eb23147e7384b7b8c37eb037840852270a2f8faf52b7837b288d73bf TO BE DOWNLOADED AND INSTALLED BY THE LOADED PLUGIN "product-id" AND APPEAR IN THE LIST OF INSTALLED PRODUCTS.

Comment 4 Whitney Chadwick 2018-12-06 19:56:20 UTC
Set blocker+ per blocker meeting on Dec 6th

Comment 5 Karel Srot 2018-12-14 07:28:38 UTC
Hi Chris,
could you please update the Fixed in Version field with package NVR so it is clear in which build the issue is fixed? Thank you.

Comment 8 Craig Donnelly 2018-12-17 20:48:13 UTC
VERIFIED against:

[root@unused ~]# rpm -q dnf dnf-plugin-subscription-manager
dnf-4.0.9-1.el8.noarch
dnf-plugin-subscription-manager-1.23.8-8.el8.x86_64

[root@unused ~]# rpm -q subscription-manager
subscription-manager-1.23.8-8.el8.x86_64

=====

[root@unused ~]# subscription-manager config --server.hostname=subscription.rhsm.stage.redhat.com --logging.default_log_level=DEBUG --rhsm.baseurl=https://cdn.stage.redhat.com
[root@unused ~]# reg
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
The system has been registered with ID: 41c5ba0b-02c8-400f-949c-f5ff89e7659b
The registered system name is: unused
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for x86_64 High Touch Beta
Status:       Subscribed

[root@unused ~]# 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@unused ~]# subscription-manager repos --list-enabled | grep rhel-8-for-x86_64-highavailability-htb-rpms -A3
Repo ID:   rhel-8-for-x86_64-highavailability-htb-rpms
Repo Name: Red Hat Enterprise Linux 8 for x86_64 - High Availability HTB (RPMs)
Repo URL:  https://cdn.stage.redhat.com/content/htb/rhel8/8/x86_64/highavailability/os
Enabled:   1
[root@unused ~]# dnf repolist
Updating Subscription Management repositories.
Updating Subscription Management repositories.
Red Hat Enterprise Linux 8 for x86_64 - BaseOS HTB (RPMs)                            1.3 MB/s | 5.2 MB     00:03    
Red Hat Enterprise Linux 8 for x86_64 - High Availability HTB (RPMs)                  54 kB/s | 155 kB     00:02    
repo id                                     repo name                                                          status
rhel-8-for-x86_64-appstream-htb-rpms        Red Hat Enterprise Linux 8 for x86_64 - AppStream HTB (RPMs)       6,185
rhel-8-for-x86_64-baseos-htb-rpms           Red Hat Enterprise Linux 8 for x86_64 - BaseOS HTB (RPMs)          2,688
rhel-8-for-x86_64-highavailability-htb-rpms Red Hat Enterprise Linux 8 for x86_64 - High Availability HTB (RPM    74
[root@unused ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux for x86_64 High Touch Beta
Product ID:     230
Version:        8.0 HTB
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         11/26/2018
Ends:           11/25/2019

[root@unused ~]# dnf install libknet1 --debuglevel=3 --assumeyes --nogpgcheck
Loaded plugins: builddep, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, needs-restarting, playground, product-id, repoclosure, repodiff, repograph, repomanage, reposync, subscription-manager, uploadprofile
Updating Subscription Management repositories.
DNF version: 4.0.9
cachedir: /var/cache/dnf
Updating Subscription Management repositories.
repo: using cache for: rhel-8-for-x86_64-appstream-htb-rpms
not found other for: Red Hat Enterprise Linux 8 for x86_64 - AppStream HTB (RPMs)
not found deltainfo for: Red Hat Enterprise Linux 8 for x86_64 - AppStream HTB (RPMs)
rhel-8-for-x86_64-appstream-htb-rpms: using metadata from Tue 11 Dec 2018 06:14:29 AM EST.
repo: using cache for: rhel-8-for-x86_64-baseos-htb-rpms
not found other for: Red Hat Enterprise Linux 8 for x86_64 - BaseOS HTB (RPMs)
not found modules for: Red Hat Enterprise Linux 8 for x86_64 - BaseOS HTB (RPMs)
not found deltainfo for: Red Hat Enterprise Linux 8 for x86_64 - BaseOS HTB (RPMs)
rhel-8-for-x86_64-baseos-htb-rpms: using metadata from Thu 06 Dec 2018 06:43:00 AM EST.
repo: using cache for: rhel-8-for-x86_64-highavailability-htb-rpms
not found other for: Red Hat Enterprise Linux 8 for x86_64 - High Availability HTB (RPMs)
not found modules for: Red Hat Enterprise Linux 8 for x86_64 - High Availability HTB (RPMs)
not found deltainfo for: Red Hat Enterprise Linux 8 for x86_64 - High Availability HTB (RPMs)
rhel-8-for-x86_64-highavailability-htb-rpms: using metadata from Wed 05 Dec 2018 01:29:04 PM EST.
Last metadata expiration check: 0:00:19 ago on Mon 17 Dec 2018 03:35:22 PM EST.
Completion plugin: Generating completion cache...
--> Starting dependency resolution
---> Package libknet1.x86_64 1.4-2.el8 will be installed
--> Finished dependency resolution
Dependencies resolved.
=====================================================================================================================
 Package            Arch             Version             Repository                                             Size
=====================================================================================================================
Installing:
 libknet1           x86_64           1.4-2.el8           rhel-8-for-x86_64-highavailability-htb-rpms            69 k

Transaction Summary
=====================================================================================================================
Install  1 Package

Total download size: 69 k
Installed size: 161 k
Downloading Packages:
libknet1-1.4-2.el8.x86_64.rpm                                                         47 kB/s |  69 kB     00:01    
---------------------------------------------------------------------------------------------------------------------
Total                                                                                 47 kB/s |  69 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                             1/1 
  Installing       : libknet1-1.4-2.el8.x86_64                                                                   1/1 
  Running scriptlet: libknet1-1.4-2.el8.x86_64                                                                   1/1 
  Verifying        : libknet1-1.4-2.el8.x86_64                                                                   1/1 
Completion plugin: Generating completion cache...
Installed products updated.

Installed:
  libknet1-1.4-2.el8.x86_64                                                                                          

Complete!
[root@unused ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux for x86_64 High Touch Beta
Product ID:     230
Version:        8.0 HTB
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         11/26/2018
Ends:           11/25/2019

Product Name:   Red Hat Enterprise Linux for x86_64 Beta
Product ID:     486
Version:        8.0 Beta
Arch:           x86_64
Status:         Not Subscribed
Status Details: Not supported by a valid subscription.
Starts:         
Ends:           

Product Name:   Red Hat Enterprise Linux High Availability Beta
Product ID:     487
Version:        8.0 Beta
Arch:           x86_64
Status:         Not Subscribed
Status Details: Not supported by a valid subscription.
Starts:         
Ends:           

Checking cert from htb ha repo @ http://cdn.stage.redhat.com/content/htb/rhel8/8/x86_64/highavailability/os/repodata/91ebc0e06f062ef7ed223000450c58c3864c931a10be11f12401cf1935fd17ad (Current one in repomd)

[root@unused ~]# curl -O http://cdn.stage.redhat.com/content/htb/rhel8/8/x86_64/highavailability/os/repodata/91ebc0e06f062ef7ed223000450c58c3864c931a10be11f12401cf1935fd17ad
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2195  100  2195    0     0  17420      0 --:--:-- --:--:-- --:--:-- 17560
[root@unused ~]# rct cat-cert 91ebc0e06f062ef7ed223000450c58c3864c931a10be11f12401cf1935fd17ad 

+-------------------------------------------+
	Product Certificate
+-------------------------------------------+

Certificate:
	Path: 91ebc0e06f062ef7ed223000450c58c3864c931a10be11f12401cf1935fd17ad
	Version: 1.0
	Serial: 12750047592154747633
	Start Date: 2018-10-12 14:25:53+00:00
	End Date: 2038-10-07 14:25:53+00:00

Subject:
	CN: Red Hat Product ID [8edb5edd-68c6-4a71-a1ed-a259bce84c45]

Issuer:
	C: US
	CN: Red Hat Entitlement Product Authority
	O: Red Hat, Inc.
	OU: Red Hat Network
	ST: North Carolina
	emailAddress: ca-support@redhat.com

Product:
	ID: 487
	Name: Red Hat Enterprise Linux High Availability Beta
	Version: 8.0 Beta
	Arch: x86_64
	Tags: rhel-8-highavailability
	Brand Type: 
	Brand Name:

Comment 9 Karel Srot 2018-12-19 08:40:07 UTC
Hi John,
while testing dnf bug 1647633 I have encountered following:

# subscription-manager repos --disable '*' --enable '*-htb-*' --disable '*-source-rpms' --disable '*-debug-rpms'
# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux for x86_64 High Touch Beta
Product ID:     230
Version:        8.0 HTB
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         04/24/2013
Ends:           01/01/2022

Product Name:   Red Hat Enterprise Linux for x86_64 Beta
Product ID:     486
Version:        8.0 Beta
Arch:           x86_64
Status:         Not Subscribed
Status Details: Not supported by a valid subscription.
Starts:         
Ends:           

# dnf -y install libknet1
# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux for x86_64 High Touch Beta
Product ID:     230
Version:        8.0 HTB
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         04/24/2013
Ends:           01/01/2022

Product Name:   Red Hat Enterprise Linux High Availability High Touch Beta
Product ID:     236
Version:        8.0 HTB
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         04/24/2013
Ends:           01/01/2022

Product Name:   Red Hat Enterprise Linux Resilient Storage High Touch Beta
Product ID:     238
Version:        8.0 HTB
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         04/24/2013
Ends:           01/01/2022

# dnf -y history undo last
# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux for x86_64 High Touch Beta
Product ID:     230
Version:        8.0 HTB
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         04/24/2013
Ends:           01/01/2022

Is it expected that in the end I have only 1 product listed as installed while originally there were 2? It seems to be related to disabling of all repos except HTB, however is this really an expected result? The bits are still installed, despite the repo is disabled.

Comment 10 Jiri Hnidek 2018-12-19 14:49:00 UTC
Hi Karel,
we are sure that product certificates (installed in /et/pki/product) should not be removed, when corresponding repository is disabled. The product certificate should be removed only in case, when the last RPM package (installed from corresponding repository) is removed and the repository is not "active" anymore.

I suspect that product certificates are removed, because subcommand "hitory undo last" is used in this case. Can you please verify my suspicion (try to remove RPM package using: "dnf -y remove libknet1"). Please fill another bug report describing this case.

Thanks in advance,

Jiri

Comment 11 Karel Srot 2018-12-20 13:13:43 UTC
I can confirm this is unrelated to dnf history undo, I have filed a bug 1661219.


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