Bug 961017 - server side product status updated inappropriately after "service rhsmcertd restart"
Summary: server side product status updated inappropriately after "service rhsmcertd r...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager
Version: 5.10
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: IDM QE LIST
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel510 rhsm-rhel70
TreeView+ depends on / blocked
 
Reported: 2013-05-08 14:22 UTC by Sharath Dwaral
Modified: 2015-03-23 01:14 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-05 15:32:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sharath Dwaral 2013-05-08 14:22:12 UTC
Description of problem:
In the below description, though RHEL sever was not subscribed to any subscriptions, the status changes to subscribed after rhsmcertd restart

Version-Release number of selected component (if applicable):
# rpm -qa | egrep "subscription-manager|python-rhsm"
python-rhsm-1.8.10-1.git.0.3f8551e.el5
subscription-manager-migration-data-1.11.2.7-1.git.0.1dfd00e.el5
subscription-manager-gui-1.8.6-1.git.41.bde7358.el5
subscription-manager-firstboot-1.8.6-1.git.41.bde7358.el5
subscription-manager-migration-1.8.6-1.git.41.bde7358.el5
subscription-manager-1.8.6-1.git.41.bde7358.el5

How reproducible:
Always

Steps to Reproduce:

Start with a plain RHEL Server system, and copy /etc/pki/product/69.pem as well as /var/lib/rhsm/productid.js somewhere safe.

productid.js should look something like this:

[root@localhost ~]# cat /var/lib/rhsm/productid.js 
{
  "69": "anaconda-RedHatEnterpriseLinux-201211201732.x86_64"
}

Now reproduce using steps above.

To reset the machine:

1. unregister
2. Remove any product certs in /etc/pki/product.
3. Restore the two files you backed up.
4. Make sure ccs is uninstalled.
5. yum clean all

Registering to stage

[root@sharath-64server product]# subscription-manager register
Username: stage_test_2
Password: 
The system has been registered with ID: 75671af8-6816-493f-9eb7-e4b44a434f69 

# subscription-manager register
Username: stage_test_2
Password: 
The system has been registered with ID: 1f498405-53e4-41f4-ac27-77806f35d51b 

# subscription-manager list --avail | grep -i -A2 High-Availability
Subscription Name: High-Availability (8 sockets)
SKU:               RH1149049
Pool ID:           8a99f9833c01cc09013c025321d00130
--
Subscription Name: High-Availability (8 sockets)
SKU:               RH1149049
Pool ID:           8a99f9833c01cc09013c025321df013f
--
Subscription Name: High-Availability (8 sockets)
SKU:               RH1149049
Pool ID:           8a99f9843c01ccba013c037a0fa0015a
--
Subscription Name: High-Availability (8 sockets)
SKU:               RH1149049
Pool ID:           8a99f9843c01ccba013c037a0fd40169

# subscription-manager subscribe --pool=8a99f9833c01cc09013c025321d00130
Successfully attached a subscription for: High-Availability (8 sockets)

# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+

Subscription Name: High-Availability (8 sockets)
Provides:          Red Hat Enterprise Linux High Availability (for RHEL Server)
SKU:               RH1149049
Contract:          10014697
Account:           5206740
Serial Number:     6582271433544536451
Pool ID:           8a99f9843c01ccba013c037a0fd40169
Active:            True
Quantity Used:     1
Service Level:     Layered
Service Type:      L1-L3
Starts:            12/31/2012
Ends:              12/31/2013

# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name: Red Hat Enterprise Linux Server
Product ID:   69
Version:      5.9
Arch:         x86_64
Status:       Not Subscribed
Starts:       
Ends:         

# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: High-Availability (8 sockets)
Provides:          Red Hat Enterprise Linux High Availability (for RHEL Server)
SKU:               RH1149049
Contract:          10014694
Account:           5206740
Serial Number:     6888499241916196322
Pool ID:           8a99f9833c01cc09013c025321d00130
Active:            True
Quantity Used:     1
Service Level:     Layered
Service Type:      L1-L3
Status Details:    
Starts:            01/03/2013
Ends:              01/03/2014

# ls /etc/pki/products/
69.pem

# yum install ipvsadm
Loaded plugins: product-id, rhnplugin, security, subscription-manager
This system is receiving updates from Red Hat Subscription Management.
This system is not registered with RHN Classic or RHN Satellite.
You can use rhn_register to register.
RHN Satellite or RHN Classic support will be disabled.
rhel-ha-for-rhel-5-server-rpms                                                                                                                                                              | 3.7 kB     00:00     
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ipvsadm.x86_64 0:1.24-13.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                     Arch                                       Version                                           Repository                                                          Size
===================================================================================================================================================================================================================
Installing:
 ipvsadm                                     x86_64                                     1.24-13.el5                                       rhel-ha-for-rhel-5-server-rpms                                      34 k

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

Total download size: 34 k
Is this ok [y/N]: y
Downloading Packages:
ipvsadm-1.24-13.el5.x86_64.rpm                                                                                                                                                              |  34 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : ipvsadm                                                                                                                                                                                     1/1 

Installed:
  ipvsadm.x86_64 0:1.24-13.el5                                                                                                                                                                                     

Complete!

# ls /etc/pki/product
69.pem  83.pem

# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name: Red Hat Enterprise Linux Server
Product ID:   69
Version:      5.9
Arch:         x86_64
Status:       Not Subscribed
Starts:       
Ends:         

Product Name: Red Hat Enterprise Linux High Availability (for RHEL Server)
Product ID:   83
Version:      5.8
Arch:         x86_64
Status:       Not Subscribed
Starts:       
Ends:

# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: High-Availability (8 sockets)
Provides:          Red Hat Enterprise Linux High Availability (for RHEL Server)
SKU:               RH1149049
Contract:          10014694
Account:           5206740
Serial Number:     6888499241916196322
Pool ID:           8a99f9833c01cc09013c025321d00130
Active:            True
Quantity Used:     1
Service Level:     Layered
Service Type:      L1-L3
Status Details:    
Starts:            01/03/2013
Ends:              01/03/2014


# service rhsmcertd restart
Stopping rhsmcertd...                                      [  OK  ]
Starting rhsmcertd...                                      [  OK  ]

# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux High Availability (for RHEL Server)
Product ID:     83
Version:        5.8
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         01/03/2013
Ends:           01/03/2014

Product Name:   Red Hat Enterprise Linux Server
Product ID:     69
Version:        5.9
Arch:           x86_64
Status:         Subscribed
Status Details: 
Starts:         12/31/2012
Ends:           12/31/2013

# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Red Hat Enterprise Linux Server
Provides:          Red Hat Enterprise Linux Server
                   Red Hat Beta
SKU:               RH0127380
Contract:          10014831
Account:           5206740
Serial Number:     2030644856042326399
Pool ID:           8a99f9833c01cc09013c0469b5cc0c4d
Active:            True
Quantity Used:     1
Service Level:     Standard
Service Type:      L1-L3
Status Details:    
Starts:            12/31/2012
Ends:              12/31/2013

Subscription Name: High-Availability (8 sockets)
Provides:          Red Hat Enterprise Linux High Availability (for RHEL Server)
SKU:               RH1149049
Contract:          10014694
Account:           5206740
Serial Number:     6888499241916196322
Pool ID:           8a99f9833c01cc09013c025321d00130
Active:            True
Quantity Used:     1
Service Level:     Layered
Service Type:      L1-L3
Status Details:    
Starts:            01/03/2013
Ends:              01/03/2014
  
Actual results:
Red Hat Enterprise Linux Server Status -> Subscribed
Automatically subscribes to RHEL server subscription 

Expected results:
Red Hat Enterprise Linux Server Status -> Not Subscribed
Should not automatically subscribe to RHEL server subscription

Additional info:

Related to https://bugzilla.redhat.com/show_bug.cgi?id=958548

Please see attachment for detailed logs

Comment 1 Devan Goodwin 2013-06-05 15:32:49 UTC
This is the healing mechanism kicking in. Systems (by default) have this flag set to true, and periodically on rhsmcertd runs will attempt to provide subscriptions for anything not subscribed *if possible*. In this case rhsmcertd runs, sees you need coverage for RHEL, and then gets you an entitlement for it.

This is all expected behaviour. The healing can be disabled as far as the server is concerned but I don't think it's exposed in any web UI's or the client yet as nobody has requested it at this time. Basically if we can fix your subs, we do so. This check will happen once every 24h by default, but is controlled by a property in rhsm.conf.

Everything looks expected here, please let me know if I've missed anything, but closing for now.


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