Bug 1440001

Summary: Entitlement certs are deleted and re-generated after running 'subscription-manager refresh' against Stage candlepin
Product: Red Hat Enterprise Linux 7 Reporter: qianzhan
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED NOTABUG QA Contact: John Sefler <jsefler>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: khowell, redakkan, shihliu, skallesh
Target Milestone: rc   
Target Release: ---   
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: 2017-04-10 15:17:16 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:
Attachments:
Description Flags
rhsm.log none

Description qianzhan 2017-04-07 05:26:37 UTC
Description of problem:
Entitlement certs are deleted and re-generated after running 'subscription-manager refresh' against Stage candlepin

Version-Release number of selected component (if applicable):
[root@localhost ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.9.51.21-1
subscription management rules: 5.15.1
subscription-manager: 1.19.4-1.el7
python-rhsm: 1.19.2-1.el7


How reproducible:
always

Steps to Reproduce:
1. Install RHEL-7.4-20170330.1, and register the system with auto-attach against Stage candlepin:

[root@localhost ~]# subscription-manager register --auto-attach
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Username: stage_virtwho_test_2016
Password: 
The system has been registered with ID: 021f02f4-96de-43f2-8946-0936e38b7676 

Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

[root@localhost ~]# ll /etc/pki/entitlement/
total 36
-rw-------. 1 root root  1675 Apr  7 13:11 1908261723745354179-key.pem
-rw-r--r--. 1 root root 31166 Apr  7 13:11 1908261723745354179.pem

2. Refresh local data and check entitlement cert:

[root@localhost ~]# subscription-manager refresh
1 local certificate has been deleted.
All local data refreshed
[root@localhost ~]# ll /etc/pki/entitlement/
total 36
-rw-------. 1 root root  1675 Apr  7 13:12 6075876887143205160-key.pem
-rw-r--r--. 1 root root 31142 Apr  7 13:12 6075876887143205160.pem

3. Check consumed subscriptions before and after refreshment:
[root@localhost ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Cloud Infrastructure, Premium (8-sockets)
Provides:            Oracle Java (for RHEL Server)
                     Red Hat JBoss Core Services
                     JBoss Enterprise Application Platform
                     Red Hat CloudForms Beta
                     Red Hat Enterprise Linux Server - Extended Update Support
                     Red Hat Enterprise Linux Server
                     Red Hat OpenStack Beta
                     Red Hat Enterprise Linux Atomic Host
                     Red Hat Enterprise MRG Messaging
                     Oracle Java (for RHEL Server) - Extended Update Support
                     Red Hat Beta
                     Red Hat Software Collections (for RHEL Server)
                     Red Hat Enterprise Linux Atomic Host Beta
                     Red Hat Developer Toolset (for RHEL Server)
                     Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support
                     Red Hat Software Collections Beta (for RHEL Server)
                     Red Hat OpenStack
                     Red Hat Enterprise Linux Load Balancer (for RHEL Server)
                     Red Hat Virtualization Host
                     Red Hat QuickStart Cloud Installer
                     Red Hat Virtualization
                     Red Hat CloudForms
                     Red Hat Enterprise Linux High Availability (for RHEL Server)
SKU:                 MCT2846
Contract:            10998657
Account:             5699976
Serial:              6075876887143205160
Pool ID:             8a99f982553a7c280155581ac19f73f4
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Premium
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              06/15/2016
Ends:                06/15/2017
System Type:         Virtual

[root@localhost ~]# subscription-manager refresh
1 local certificate has been deleted.
All local data refreshed
[root@localhost ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Cloud Infrastructure, Premium (8-sockets)
Provides:            Oracle Java (for RHEL Server)
                     Red Hat JBoss Core Services
                     JBoss Enterprise Application Platform
                     Red Hat Enterprise Linux Server - Extended Update Support
                     Red Hat CloudForms Beta
                     Red Hat OpenStack Beta
                     Red Hat Enterprise Linux Atomic Host
                     Red Hat Enterprise Linux Server
                     Red Hat Enterprise MRG Messaging
                     Oracle Java (for RHEL Server) - Extended Update Support
                     Red Hat Beta
                     Red Hat Software Collections (for RHEL Server)
                     Red Hat Enterprise Linux Atomic Host Beta
                     Red Hat Developer Toolset (for RHEL Server)
                     Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support
                     Red Hat Software Collections Beta (for RHEL Server)
                     Red Hat OpenStack
                     Red Hat Enterprise Linux Load Balancer (for RHEL Server)
                     Red Hat Virtualization Host
                     Red Hat QuickStart Cloud Installer
                     Red Hat Virtualization
                     Red Hat CloudForms
                     Red Hat Enterprise Linux High Availability (for RHEL Server)
SKU:                 MCT2846
Contract:            10998657
Account:             5699976
Serial:              4125242484417681098
Pool ID:             8a99f982553a7c280155581ac19f73f4
Provides Management: No
Active:              True
Quantity Used:       1
Service Level:       Premium
Service Type:        L1-L3
Status Details:      Subscription is current
Subscription Type:   Standard
Starts:              06/15/2016
Ends:                06/15/2017
System Type:         Virtual


Actual results:
As step 2, an entitlement cert is deleted and another is regenerated.

Expected results:
Entitlement cert should stay the same as the consumed subscription stay the same after refreshment.

Additional info:
please see attachment 'rhsm.log'

Comment 2 qianzhan 2017-04-07 05:27:59 UTC
Created attachment 1269566 [details]
rhsm.log

Comment 3 Kevin Howell 2017-04-10 15:17:16 UTC
We changed this behavior intentionally. Until candlepin can be changed upstream this is required in order to ensure that new or changed content sets are made available during a refresh. See bug 1360909 for rationale.