Bug 703626

Summary: product-id yum plugin is not run on 5.7
Product: Red Hat Enterprise Linux 5 Reporter: Chris Duryee <cduryee>
Component: subscription-managerAssignee: Adrian Likins <alikins>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 5.7CC: bkearney, jsefler, mkhusid
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-21 08:47:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 675214    

Description Chris Duryee 2011-05-10 20:26:31 UTC
Description of problem:

The product-id plugin is attached to the postverifytrans hook, but 5.7 doesn't have that hook in the conduit. Right now, the product-id yum plugin is skipped during a run of yum.

How reproducible: every time


Steps to Reproduce:
1. yum install or yum erase a package (for example, yum install zsh)
2. command output does not contain "Installed products updated"
  
Expected results:

"Installed products updated" should display, indicating that the plugin ran.

Additional info:

We should also do additional checks to make sure product-id actually did what it was supposed to, but checking stdout is a good initial smoketest.

Comment 2 Adrian Likins 2011-05-10 22:16:54 UTC
How to reproduct:

1. get a RHEL5.7 box with subscription-manager installed
2. make sure yum is pointing at a repo with a productid in the repodata, I used:


[rhel]
name=rhel $releasever - $basearch
baseurl=http://download.devel.redhat.com/nightly/latest-RHEL5.7-Client/tree-x86_64/Client/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

3. Check /etc/pki/product/ 
  
You should be able to [re]move these 

4. yum install zsh

You will notice there isnt any product cert related text output. Also, /etc/pki/product will still be empty


After applying a build with the fix, in step 4 you should see something like:

duration: 1034(ms)
installing: 82.pem


in the yum output. 

Also, there will be a product cert in /etc/pki/product/

Comment 4 Adrian Likins 2011-05-12 17:40:04 UTC
commit 15111975242bbb43c837bcee8a4342680262bcf8
Author: Adrian Likins <alikins>
Date:   Tue May 10 17:44:50 2011 -0400

    703626: product-id yum plugin was using too new of yum api
    
    postverifytrans yum plugin hook doesn't exist on rhel5, so
    change to a posttrans hook.
    
    Package.yumdb_info also doesn't exist on rhel5.7, so change to
    looking up rpm info via pkgSack to find the equiv of "from_repo"

651ce37216d17fd0999170a9f36a24c2a26e16f4 in master


productid.py is still broke in anaconda as seen in https://bugzilla.redhat.com/show_bug.cgi?id=670973

But this part can be tested independently as in comment #2.

Comment 5 John Sefler 2011-05-20 17:24:47 UTC
Regarding the install of the product-id by anaconda....

I just provisioned this beaker box with RHEL5.7-Client-20110518.0_nfs-i386 and the product ids do get installed...

      Beaker Test information:
                         HOSTNAME=dell-pesc1425-01.rhts.eng.bos.redhat.com
                            JOBID=87704
                         RECIPEID=179974
                    RESULT_SERVER=127.0.0.1:7090
                           DISTRO=RHEL5.7-Client-20110518.0
                     ARCHITECTURE=i386
**  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **  **
[root@dell-pesc1425-01 ~]# ls /etc/pki/product/
100.pem  136.pem  82.pem
[root@dell-pesc1425-01 ~]# rpm -q subscription-manager
subscription-manager-0.95.5.18-1.el5
[root@dell-pesc1425-01 ~]# rpm -q subscription-manager --changelog | grep 703626
- 703626: product-id yum plugin was using too new of yum api



I also created a KVM guest from RHEL57 beta candidate http://porkchop.redhat.com/rel-eng/RHEL-5.7-Server-Beta-1.2/ and the product ids do get installed...
[root@jsefler-RHEL57ServerBeta12 ~]# ls /etc/pki/product/
95.pem
[root@jsefler-RHEL57ServerBeta12 ~]# rpm -q subscription-manager
subscription-manager-0.95.5.18-1.el5
[root@jsefler-RHEL57ServerBeta12 ~]# rpm -q subscription-manager --changelog | grep 703626
- 703626: product-id yum plugin was using too new of yum api


^^^ Those verify the anaconda portion of the bug

Comment 6 John Sefler 2011-05-20 18:19:58 UTC
Verifying version...
[root@jsefler-RHEL57ServerBeta12 ~]# rpm -q subscription-manager
subscription-manager-0.95.5.18-1.el5
[root@jsefler-RHEL57ServerBeta12 ~]# rpm -q subscription-manager --changelog | grep 703626
- 703626: product-id yum plugin was using too new of yum api


Creating the following repo that has a product id: 
http://download.devel.redhat.com/devel/candidate-trees/latest-RHEL5.7-Client/tree-x86_64/Client/repodata/productid ...

[root@jsefler-RHEL57ServerBeta12 ~]# cat /etc/yum.repos.d/rhel-latest57client.repo 
[latest57client]
name=rhel $releasever - $basearch
baseurl=http://download.devel.redhat.com/nightly/latest-RHEL5.7-Client/tree-x86_64/Client/
enabled=1
gpgcheck=0


[root@jsefler-RHEL57ServerBeta12 ~]# yum repolist
Loaded plugins: product-id, security, subscription-manager
Updating Red Hat repositories.
latest57client                                           | 1.4 kB     00:00     
latest57client/primary                                   | 828 kB     00:00     
latest57client                                                        2111/2111
repo id                      repo name                            status
latest57client               rhel 5Server - x86_64                enabled: 2,111
repolist: 2,111
[root@jsefler-RHEL57ServerBeta12 ~]# yum list zsh
Loaded plugins: product-id, security, subscription-manager
Updating Red Hat repositories.
Available Packages
zsh.x86_64                      4.2.6-5.el5                       latest57client
[root@jsefler-RHEL57ServerBeta12 ~]# ls /etc/pki/product/
95.pem

[root@jsefler-RHEL57ServerBeta12 ~]# yum -y install zsh --disablerepo=* --enablerepo=latest57client
Loaded plugins: product-id, security, subscription-manager
Updating Red Hat repositories.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package zsh.x86_64 0:4.2.6-5.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package     Arch           Version                Repository              Size
================================================================================
Installing:
 zsh         x86_64         4.2.6-5.el5            latest57client         1.7 M

Transaction Summary
================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 1.7 M
Downloading Packages:
zsh-4.2.6-5.el5.x86_64.rpm                               | 1.7 MB     00:01     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : zsh                                                      1/1 
latest57client/productid                                 | 1.7 kB     00:00     
duration: 251(ms)
deleting: /etc/pki/product/95.pem
installing: 82.pem
Installed products updated.

Installed:
  zsh.x86_64 0:4.2.6-5.el5                                                      

Complete!
[root@jsefler-RHEL57ServerBeta12 ~]# 
[root@jsefler-RHEL57ServerBeta12 ~]# ls /etc/pki/product/
82.pem

^^^ Verified that the 82.pem product id was installed as expected.

Not sure why the other product id (95.pem) was deleted.  Need info from alikins.

Comment 7 Chris Duryee 2011-05-20 19:21:05 UTC
removing beta flag, this would get addressed in the RC

Comment 8 John Sefler 2011-05-20 20:17:38 UTC
The observance of the deleted product cert at the end of comment #6 has been opened in bug #706532.  Tracking this issue separately, the original problem in this bug is now verified.

Moving to VERIFIED.

Comment 9 errata-xmlrpc 2011-07-21 08:47:01 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2011-1078.html

Comment 10 errata-xmlrpc 2011-07-21 12:30:30 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2011-1078.html