Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1298237

Summary: CDK - "RestlibException: Unable to attach subscription for the product 'Unknown Product'" during auto-attach after the cdk entitlement expiry
Product: [Community] Candlepin (Migrated to Jira) Reporter: Rehana <redakkan>
Component: candlepinAssignee: William Poteat <wpoteat>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: low Docs Contact:
Priority: low    
Version: 1.2CC: bcourt, wpoteat
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-22 14:39:07 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:

Description Rehana 2016-01-13 15:15:05 UTC
Description of problem:
Observed after cdk entitlement cert expiry , when user tries to auto-attach; attahc fails with RestlibException: Unable to attach subscription for the product 'Unknown Product':

Version-Release number of selected component (if applicable):
subscription management server: 0.9.51.14-1
subscription management rules: 5.15.1
subscription-manager: 1.15.9-15.el7
python-rhsm: 1.15.4-5.el7

How reproducible:
1/1

Steps to Reproduce:
1.Register a vagrant machine to stage environment and attach cdk subscription
2.wait for one day to expire the entitlement cert  ( one day active cdk sku is available for testing purpose)
3.machines facts file 
$ sudo cat /etc/rhsm/facts/cdk.facts 
{"dev_sku": "MCT3295" , "dev_platform": "vagrant" }

4.installed list after expiry
 $ sudo subscription-manager  list --installed
 
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux High Performance Networking (for RHEL Compute Node)
Product ID:     134
Version:        7.1
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat Enterprise Linux Atomic Host
Product ID:     271
Version:        7
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat Enterprise Linux Atomic Host Beta
Product ID:     272
Version:        7-Beta
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat Developer Toolset (for RHEL Server)
Product ID:     176
Version:        2.1
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat Enterprise Linux High Availability (for RHEL Server)
Product ID:     83
Version:        7.2
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support
Product ID:     86
Version:        7.2
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat Enterprise Linux High Availability (for RHEL Server) - Extended Update Support
Product ID:     84
Version:        7.2
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat Enterprise Linux Load Balancer (for RHEL Server)
Product ID:     85
Version:        7.1
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat Beta
Product ID:     180
Version:        Beta
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat EUCJP Support (for RHEL Server)
Product ID:     181
Version:        7.1
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat Enterprise Linux for Real Time
Product ID:     287
Version:        7.2
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat Software Collections (for RHEL Server)
Product ID:     201
Version:        2
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Oracle Java (for RHEL Server) - Extended Update Support
Product ID:     246
Version:        7.1 Beta
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Oracle Java (for RHEL Server)
Product ID:     240
Version:        7.2
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat Enterprise Linux Server - Extended Update Support
Product ID:     70
Version:        7.2
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat Enterprise Linux Resilient Storage (for RHEL Server) - Extended Update Support
Product ID:     91
Version:        7.2
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat Enterprise Linux Resilient Storage (for RHEL Server)
Product ID:     90
Version:        7.2
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat Enterprise Linux Scalable File System (for RHEL Server) - Extended Update Support
Product ID:     93
Version:        7.2
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat Enterprise Linux Scalable File System (for RHEL Server)
Product ID:     92
Version:        7.1
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat Enterprise Linux Server
Product ID:     69
Version:        7.2
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat Enterprise Linux High Performance Networking (for RHEL Server)
Product ID:     132
Version:        7.1
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat Container Development Kit
Product ID:     293
Version:        1.0
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
Product Name:   Red Hat Enterprise MRG Messaging 3 for RHEL 7
Product ID:     291
Version:        3.0
Arch:           x86_64
Status:         Expired
Status Details: Not supported by a valid subscription.
Starts:        
Ends:          
 
5) consumed list after expiry

-bash-4.2$ sudo subscription-manager  list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:   Internal Shadow Sku CDK Entitlement
Provides:            Oracle Java (for RHEL Server)
                     Red Hat Enterprise Linux High Performance Networking (for RHEL Compute Node)
                     Red Hat Enterprise Linux Server - Extended Update Support
                     Red Hat EUCJP Support (for RHEL Server)
                     Red Hat Enterprise Linux Server
                     Red Hat Enterprise Linux Atomic Host
                     Oracle Java (for RHEL Server) - Extended Update Support
                     Red Hat Enterprise Linux Resilient Storage (for RHEL Server) - Extended Update Support
                     Red Hat Beta
                     Red Hat Software Collections (for RHEL Server)
                     Red Hat Enterprise Linux Resilient Storage (for RHEL Server)
                     Red Hat Enterprise Linux High Availability (for RHEL Server) - Extended Update Support
                     Red Hat Enterprise Linux Atomic Host Beta
                     Red Hat Enterprise MRG Messaging 3 for RHEL 7
                     Red Hat Developer Toolset (for RHEL Server)
                     Red Hat Enterprise Linux Scalable File System (for RHEL Server) - Extended Update Support
                     Red Hat Enterprise Linux Scalable File System (for RHEL Server)
                     Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support
                     Red Hat Enterprise Linux for Real Time
                     Red Hat Enterprise Linux Load Balancer (for RHEL Server)
                     Red Hat Enterprise Linux High Performance Networking (for RHEL Server)
                     Red Hat Enterprise Linux High Availability (for RHEL Server)
                     Red Hat Container Development Kit
SKU:                 MCT3295
Contract:            
Account:            
Serial:              3256113830661101176
Pool ID:             8a99f9815239b6a801523ad5f1410163
Provides Management: No
Active:              False
Quantity Used:       1
Service Level:       Self-Support
Service Type:        
Status Details:      Subscription is expired
Subscription Type:  
Starts:              01/12/2016
Ends:                01/13/2016
System Type:         Physical
 

6) try auto-attach on the system

-bash-4.2$ sudo subscription-manager attach --auto
1 local certificate has been deleted.
 
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux High Performance Networking (for RHEL Compute Node)
Status:       Not Subscribed
 
Product Name: Red Hat Enterprise Linux Atomic Host
Status:       Not Subscribed
 
Product Name: Red Hat Enterprise Linux Atomic Host Beta
Status:       Not Subscribed
 
Product Name: Red Hat Developer Toolset (for RHEL Server)
Status:       Not Subscribed
 
Product Name: Red Hat Enterprise Linux High Availability (for RHEL Server)
Status:       Not Subscribed
 
Product Name: Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support
Status:       Not Subscribed
 
Product Name: Red Hat Enterprise Linux High Availability (for RHEL Server) - Extended Update Support
Status:       Not Subscribed
 
Product Name: Red Hat Enterprise Linux Load Balancer (for RHEL Server)
Status:       Not Subscribed
 
Product Name: Red Hat Beta
Status:       Not Subscribed
 
Product Name: Red Hat EUCJP Support (for RHEL Server)
Status:       Not Subscribed
 
Product Name: Red Hat Enterprise Linux for Real Time
Status:       Not Subscribed
 
Product Name: Red Hat Software Collections (for RHEL Server)
Status:       Not Subscribed
 
Product Name: Oracle Java (for RHEL Server) - Extended Update Support
Status:       Not Subscribed
 
Product Name: Oracle Java (for RHEL Server)
Status:       Not Subscribed
 
Product Name: Red Hat Enterprise Linux Server - Extended Update Support
Status:       Not Subscribed
 
Product Name: Red Hat Enterprise Linux Resilient Storage (for RHEL Server) - Extended Update Support
Status:       Not Subscribed
 
Product Name: Red Hat Enterprise Linux Resilient Storage (for RHEL Server)
Status:       Not Subscribed
 
Product Name: Red Hat Enterprise Linux Scalable File System (for RHEL Server) - Extended Update Support
Status:       Not Subscribed
 
Product Name: Red Hat Enterprise Linux Scalable File System (for RHEL Server)
Status:       Not Subscribed
 
Product Name: Red Hat Enterprise Linux Server
Status:       Not Subscribed
 
Product Name: Red Hat Enterprise Linux High Performance Networking (for RHEL Server)
Status:       Not Subscribed
 
Product Name: Red Hat Container Development Kit
Status:       Not Subscribed
 
Product Name: Red Hat Enterprise MRG Messaging 3 for RHEL 7
Status:       Not Subscribed
 
Unable to find available subscriptions for all your installed products.
 
-bash-4.2$ sudo subscription-manager  list --consumed

No consumed subscription pools to list
-bash-4.2$ sudo ls /etc/pki/entitlement/
 
 
rhsm.log
===========
 
2016-01-13 09:17:55,059 [DEBUG] subscription-manager:9574 @connection.py:523 - Making request: POST /subscription/consumers/0e101a32-59c0-4b12-a5b1-061ed839013d/entitlements
2016-01-13 09:19:42,312 [DEBUG] subscription-manager:9574 @connection.py:555 - Response: status=403
2016-01-13 09:19:42,312 [WARNING] subscription-manager:9574 @managercli.py:187 - Error during auto-attach.
2016-01-13 09:19:42,312 [ERROR] subscription-manager:9574 @managercli.py:188 - Unable to attach subscription for the product 'Unknown Product': Subscriptions for MCT3295 expired on: 1/13/16 8:29 AM.
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 183, in autosubscribe
    ents = cp.bind(consumer_uuid)  # new style
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 1133, in bind
    return self.conn.request_post(method)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 647, in request_post
    return self._request("POST", method, params)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 564, in _request
    self.validateResponse(result, request_type, handler)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 611, in validateResponse
    raise RestlibException(response['status'], error_msg, response.get('headers'))
RestlibException: Unable to attach subscription for the product 'Unknown Product': Subscriptions for MCT3295 expired on: 1/13/16 8:29 AM.
2016-01-13 09:19:42,314 [INFO] subscription-manager:9574 @connection.py:778 - Connection built: host=subscription.rhn.stage.redhat.com port=443 handler=/subscription auth=identity_cert ca_dir=/etc/rhsm/ca/ verify=False
2016-01-13 09:19:42,314 [DEBUG] subscription-manager:9574 @connection.py:475 - Loaded CA certificates from /etc/rhsm/ca/: redhat-uep.pem
2016-01-13 09:19:42,314 [DEBUG] subscription-manager:9574 @connection.py:523 - Making request: GET /subscription/consumers/0e101a32-59c0-4b12-a5b1-061ed839013d/certificates/serials

Actual results :

Auto-attach took time to finish and rhsm.log ^^ had exception RestlibException: Unable to attach subscription for the product 'Unknown Product': Subscriptions for MCT3295 expired on: 1/13/16 8:29 AM.

Expected results:
After cdk entitlement expiry, vagrant users should be informed to re-register the system to get a new cdk entitlements and the manual auto-attach on the expired system should display more appropriate error and should handle the exception

Additional info:

Comment 1 Barnaby Court 2016-01-14 20:33:58 UTC
The value of "Unknown Product" could be improved. We do not need to explicitly tell how to work around the CDK expiration. Otherwise it is working as designed.

Comment 2 William Poteat 2016-02-09 12:09:23 UTC
master commit 6b3adb02be32be6ab0c2d7355f3aaddaffe18205

Comment 3 William Poteat 2016-02-09 12:09:58 UTC
Comment 2 is for a different bug.

Comment 4 William Poteat 2016-02-09 12:14:22 UTC
Commit 60d0fdd2170c336012ea74a43bb3bce6a7c1d451

Comment 5 Mike McCune 2016-03-28 23:46:11 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 6 Barnaby Court 2016-07-22 14:39:07 UTC
Moving to closed per the updated candlepin process for bugs that have been merged or have been taken care of.