Bug 974587 - list --consumed is throwing 'NoneType' object has no attribute 'service_level' when imported cert to disconnected system
list --consumed is throwing 'NoneType' object has no attribute 'service_level...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager (Show other bugs)
5.10
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Carter Kozak
IDM QE LIST
:
: 959151 (view as bug list)
Depends On:
Blocks: rhsm-rhel510
  Show dependency treegraph
 
Reported: 2013-06-14 09:54 EDT by Rehana
Modified: 2013-09-30 19:10 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
No description necessary
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-30 19:10:39 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
subscription cert (4.00 KB, application/x-x509-ca-cert)
2013-06-14 09:54 EDT, Rehana
no flags Details
subscription_type_physical (64.72 KB, application/x-x509-ca-cert)
2013-07-15 04:45 EDT, Rehana
no flags Details
subscription_type_virtual (4.00 KB, application/x-x509-ca-cert)
2013-07-15 04:47 EDT, Rehana
no flags Details
stage_entitlements (76.20 KB, image/png)
2013-07-15 04:48 EDT, Rehana
no flags Details

  None (edit)
Description Rehana 2013-06-14 09:54:14 EDT
Created attachment 761295 [details]
subscription cert

Description of problem:
While testing the import feature ( on a disconnected system), observed that list --consumed is throwing 'NoneType' object has no attribute 'service_level' when disconnected system gets registered with the server using the UUID from rhsm-web app, detailed steps given below. 

This was tested against the candlepin server, with the version
http://post-office.corp.redhat.com/archives/entitlement-team-list/2013-June/msg00041.html on both rhel6.4 and rhel5.10

Version-Release number of selected component (if applicable):
[root@localhost entitlement]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: Unknown
subscription-manager: 1.8.10-1.el5_9
python-rhsm: 1.8.12-1.el5_9

How reproducible:
3/3

Steps to Reproduce:
1.Register Client through https://access.stage.redhat.com/ (stage_test_12/redhat)
2.subscription --> units -->Register system 
3.REgistered the system, attached 1 subscription to it,Downloaded entitlement certs from stage
4.Make sure that the system not registered

[root@localhost home]# subscription-manager identity
This system is not yet registered. Try 'subscription-manager register --help' for more information
5.[root@localhost home]# subscription-manager import --cert 8a99f9843c01ccba013c037bb23e0259.pem
Successfully imported certificate 8a99f9843c01ccba013c037bb23e0259.pem
6.[root@localhost home]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
'NoneType' object has no attribute 'service_level'

PFA the imported entitlement cert

Actual results:
Unable to list consumed list subscription and repos list on a disconnected system

I even tried to check, wheather after registering the subscription is getting identified or not but observed the same thing
root@localhost entitlement]# subscription-manager register --consumerid=13bd8f98-8945-4a36-8376-dbe7a592fc4a
Username: stage_test_12
Password:
The system has been registered with ID: 13bd8f98-8945-4a36-8376-dbe7a592fc4a
 
[root@localhost entitlement]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
'NoneType' object has no attribute 'service_level'


Expected results:
User should be able to list the imported subscription

Additional info:
Also tried restarting the rhsmcertd service, but observed the same thing, 

-------log----------
2013-06-14 14:58:52,559 [DEBUG]  @injection.py:64 - Returning callable provider for feature ENT_DIR: <class 'subscription_manager.certdirectory.EntitlementDirectory'>
2013-06-14 14:58:52,559 [DEBUG]  @injection.py:64 - Returning callable provider for feature PROD_DIR: <class 'subscription_manager.certdirectory.ProductDirectory'>
2013-06-14 14:58:52,561 [DEBUG]  @profile.py:96 - Loading current RPM profile.
2013-06-14 14:58:52,643 [INFO]  @managercli.py:309 - Client Versions: {'python-rhsm': '1.8.12-1.el5_9', 'subscription-manager': '1.8.10-1.el5_9'}
2013-06-14 14:58:52,644 [INFO]  @connection.py:583 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = False
2013-06-14 14:58:52,644 [INFO]  @connection.py:596 - Connection Built: host: subscription.rhn.stage.redhat.com, port: 443, handler: /subscription
2013-06-14 14:58:52,644 [INFO]  @connection.py:593 - Using no auth
2013-06-14 14:58:52,644 [INFO]  @connection.py:596 - Connection Built: host: subscription.rhn.stage.redhat.com, port: 443, handler: /subscription
2013-06-14 14:58:52,680 [DEBUG]  @connection.py:394 - Loading CA PEM certificates from: /etc/rhsm/ca/
2013-06-14 14:58:52,680 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2013-06-14 14:58:52,680 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-ca.pem'
2013-06-14 14:58:52,681 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2013-06-14 14:58:52,681 [DEBUG]  @connection.py:415 - Making request: GET /subscription/
2013-06-14 14:58:54,295 [DEBUG]  @connection.py:434 - Response status: 200
2013-06-14 14:58:54,296 [DEBUG]  @connection.py:613 - Server supports the following resources:
2013-06-14 14:58:54,296 [DEBUG]  @connection.py:614 - {'owners': '/owners', 'jobs': '/jobs', 'users': '/users', 'consumers': '/consumers', 'subscriptions': '/subscriptions', 'pools': '/pools', 'products': '/products', 'entitlements': '/entitlements'}
2013-06-14 14:58:54,297 [INFO]  @managercli.py:320 - Server Versions: {'candlepin': 'Unknown', 'server-type': 'Red Hat Subscription Management'}
2013-06-14 14:58:54,297 [DEBUG]  @injection.py:64 - Returning callable provider for feature CERT_SORTER: <class 'subscription_manager.cert_sorter.CertSorter'>
2013-06-14 14:58:54,297 [DEBUG]  @injection.py:68 - Returning instance for feature IDENTITY
2013-06-14 14:58:54,299 [DEBUG]  @certdirectory.py:185 - Installed product IDs: ['100000000000011', '69', '32060', '88888']
2013-06-14 14:58:54,302 [INFO]  @cache.py:164 - Checking current system info against cache: /var/lib/rhsm/cache/installed_products.json
2013-06-14 14:58:54,302 [INFO]  @cache.py:181 - No changes.
2013-06-14 14:58:54,302 [DEBUG]  @injection.py:64 - Returning callable provider for feature STATUS_CACHE: <class 'subscription_manager.cache.StatusCache'>
2013-06-14 14:58:54,302 [DEBUG]  @connection.py:394 - Loading CA PEM certificates from: /etc/rhsm/ca/
2013-06-14 14:58:54,303 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2013-06-14 14:58:54,303 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-ca.pem'
2013-06-14 14:58:54,303 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2013-06-14 14:58:54,304 [DEBUG]  @connection.py:415 - Making request: GET /subscription/consumers/13bd8f98-8945-4a36-8376-dbe7a592fc4a/compliance
2013-06-14 14:58:56,805 [DEBUG]  @connection.py:434 - Response status: 200
2013-06-14 14:58:56,808 [DEBUG]  @cache.py:137 - Wrote cache: /var/lib/rhsm/cache/entitlement_status.json
2013-06-14 14:58:56,809 [DEBUG]  @cert_sorter.py:207 - valid entitled products: ['69']
2013-06-14 14:58:56,810 [DEBUG]  @cert_sorter.py:208 - expired entitled products: []
2013-06-14 14:58:56,810 [DEBUG]  @cert_sorter.py:209 - partially entitled products: []
2013-06-14 14:58:56,810 [DEBUG]  @cert_sorter.py:210 - unentitled products: ['100000000000011', '32060', '88888']
2013-06-14 14:58:56,810 [DEBUG]  @cert_sorter.py:211 - future products: []
2013-06-14 14:58:56,810 [DEBUG]  @cert_sorter.py:212 - partial stacks: []
2013-06-14 14:58:56,810 [DEBUG]  @cert_sorter.py:213 - entitlements valid until: 2013-06-14 09:30:55+00:00
2013-06-14 14:58:56,811 [ERROR]  @managercli.py:151 - exception caught in subscription-manager
2013-06-14 14:58:56,811 [ERROR]  @managercli.py:152 - 'NoneType' object has no attribute 'service_level'
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager", line 80, in ?
    sys.exit(abs(main() or 0))
  File "/usr/sbin/subscription-manager", line 71, in main
    return managercli.ManagerCLI().main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 2231, in main
    return CLI.main(self)
  File "/usr/share/rhsm/subscription_manager/cli.py", line 166, in main
    return cmd.main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 482, in main
    return_code = self._do_command()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 2097, in _do_command
    self.print_consumed(service_level=self.options.service_level)
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 2141, in print_consumed
    service_level = order.service_level or ""
AttributeError: 'NoneType' object has no attribute 'service_level'
 

---repos list---

[root@localhost ~]# subscription-manager repos --list
iteration over non-sequence
2013-06-14 15:03:39,422 [INFO]  @cache.py:308 - Server does not support packages, skipping profile upload.
2013-06-14 15:03:39,425 [INFO]  @cache.py:164 - Checking current system info against cache: /var/lib/rhsm/cache/installed_products.json
2013-06-14 15:03:39,425 [INFO]  @cache.py:181 - No changes.
2013-06-14 15:03:39,426 [DEBUG]  @connection.py:394 - Loading CA PEM certificates from: /etc/rhsm/ca/
2013-06-14 15:03:39,426 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2013-06-14 15:03:39,427 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-ca.pem'
2013-06-14 15:03:39,427 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2013-06-14 15:03:39,427 [DEBUG]  @connection.py:415 - Making request: GET /subscription/consumers/13bd8f98-8945-4a36-8376-dbe7a592fc4a/release
2013-06-14 15:03:41,954 [DEBUG]  @connection.py:434 - Response status: 200
2013-06-14 15:03:41,958 [ERROR]  @managercli.py:151 - exception caught in subscription-manager
2013-06-14 15:03:41,958 [ERROR]  @managercli.py:152 - iteration over non-sequence
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager", line 80, in ?
    sys.exit(abs(main() or 0))
  File "/usr/sbin/subscription-manager", line 71, in main
    return managercli.ManagerCLI().main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 2231, in main
    return CLI.main(self)
  File "/usr/share/rhsm/subscription_manager/cli.py", line 166, in main
    return cmd.main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 482, in main
    return_code = self._do_command()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1807, in _do_command
    repos = rl.get_repos()
  File "/usr/share/rhsm/subscription_manager/repolib.py", line 49, in get_repos
    repos = action.get_unique_content()
  File "/usr/share/rhsm/subscription_manager/repolib.py", line 169, in get_unique_content
    for r in self.get_content(ent_cert, baseurl, ca_cert):
  File "/usr/share/rhsm/subscription_manager/repolib.py", line 187, in get_content
    for content in ent_cert.content:
TypeError: iteration over non-sequence
Comment 2 Bryan Kearney 2013-06-17 21:38:19 EDT
fiex in commit 2d1405d606ee62cbd0ec9607f57238cce06ff2f7
Author: Bryan Kearney <bkearney@redhat.com>
Date:   Fri Jun 14 12:39:18 2013 -0400

    974587: Allow list --consumed to handle certificates with empty order sections
Comment 3 Rehana 2013-07-15 04:43:53 EDT
Retested on:
------------
server type: Red Hat Subscription Management
subscription management server: Unknown
subscription-manager: 1.8.13-1.el5_9
python-rhsm: 1.8.13-1.el5_9

Observed that the fix work fine for entitlement cert of type "System:physical",
however observed that importing entitlement of type "System:virtual" still have some issues.(PFA: attached 8a99f9843c01ccba013c037bb23e0259.pem,8a99f9843c01ccba013c037bb24e0268.pem,entitlements_from_stage.png)

here is steps  i have tried;

1) unregistered client
---------------------------
[root@localhost home]# subscription-manager identity
This system is not yet registered. Try 'subscription-manager register --help' for more information.

2) Importing certs downloaded from https://access.stage.redhat.com
[root@localhost home]# subscription-manager import --cert 8a99f9843c01ccba013c037bb23e0259.pem --cert 8a99f9843c01ccba013c037bb24e0268.pem
Successfully imported certificate 8a99f9843c01ccba013c037bb23e0259.pem --->(type :Physical)
Successfully imported certificate 8a99f9843c01ccba013c037bb24e0268.pem --->(type: Virtual)

3)
[root@localhost home]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name:				------------->> subscription of type "virtual" did not list the details
Provides:         
SKU:               
Contract:          
Account:           
Serial:            2745118027413685224
Pool ID:           Not Available
Active:            True
Quantity Used:     
Service Level:     
Service Type:      
Status Details:    
Starts:            12/31/2012
Ends:              12/31/2013

Subscription Name: Red Hat Enterprise Linux Server, Premium (8 sockets) (Up to 4 guests)    ---> subscription of type"physical"listed details
Provides:          Red Hat Beta
                   Red Hat Software Collections Beta (for RHEL Server)
                   Red Hat Enterprise Linux Server
SKU:               RH0103708
Contract:          10014723
Account:           5206751
Serial:            45922140425730468
Pool ID:           Not Available
Active:            True
Quantity Used:     1
Service Level:     Premium
Service Type:      L1-L3
Status Details:    
Starts:            12/31/2012
Ends:              12/31/2013

[root@localhost home]# cd /etc/pki/entitlement/
[root@localhost entitlement]# ll
total 96
-rw-r--r-- 1 root root  1674 Jul 15 13:11 2745118027413685224-key.pem
-rw-r--r-- 1 root root  2418 Jul 15 13:11 2745118027413685224.pem
-rw-r--r-- 1 root root  1674 Jul 15 13:11 45922140425730468-key.pem
-rw-r--r-- 1 root root 64598 Jul 15 13:11 45922140425730468.pem

4)entitlement cert (type :physical) displayed its content details but the other one which is of type "virtual" didnot display the content details

[root@localhost entitlement]# rct cc 2745118027413685224.pem

+-------------------------------------------+
    Entitlement Certificate
+-------------------------------------------+

Certificate:
    Path: 2745118027413685224.pem
    Version: 3.2
    Serial: 2745118027413685224
    Start Date: 2012-12-31 05:00:00+00:00
    End Date: 2013-12-31 04:59:59+00:00
    Pool ID: Not Available

Subject:
    CN: 8a99f9833fcdf2d0013fe146f34f000b

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



[root@localhost entitlement]# rct cc 45922140425730468.pem

+-------------------------------------------+
    Entitlement Certificate
+-------------------------------------------+

Certificate:
    Path: 45922140425730468.pem
    Version: 1.0
    Serial: 45922140425730468
    Start Date: 2012-12-31 05:00:00+00:00
    End Date: 2013-12-31 04:59:59+00:00
    Pool ID: Not Available

Subject:
    CN: 8a99f9833fcdf2d0013fe13e892c7eda

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

Product:
    ID: 180
    Name: Red Hat Beta
    Version:
    Arch: x86_64,ppc64,ia64,ppc,s390,x86,s390x
    Tags:

Product:
    ID: 205
    Name: Red Hat Software Collections Beta (for RHEL Server)
    Version:
    Arch: x86_64
    Tags:

Product:
    ID: 69
    Name: Red Hat Enterprise Linux Server
    Version:
    Arch: x86_64,ia64,x86
    Tags:

Order:
    Name: Red Hat Enterprise Linux Server, Premium (8 sockets) (Up to 4 guests)
    Number:
    SKU: RH0103708
    Contract: 10014723
    Account: 5206751
    Service Level: Premium
    Service Type: L1-L3
    Quantity: 100
    Quantity Used: 1
    Socket Limit: 8
    RAM Limit:
    Core Limit:
    Virt Limit:
    Virt Only: False
    Subscription:
    Stacking ID:
    Warning Period: 0
    Provides Management: 0

Content:
    Type: yum
    Name: Red Hat Enterprise Linux 5 Server Beta (Debug RPMs)
    Label: rhel-5-server-beta-debug-rpms
    Vendor: Red Hat
    URL: /content/beta/rhel/server/5/$releasever/$basearch/debug
    GPG: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    Enabled: False
    Expires: 86400
    Required Tags: rhel-5-server
    Arches:

Content:
    Type: file
    Name: Red Hat Enterprise Linux 5 Server Beta (ISOs)
    Label: rhel-5-server-beta-isos
    Vendor: Red Hat
    URL: /content/beta/rhel/server/5/$releasever/$basearch/iso
    GPG: http://
    Enabled: False
    Expires: 86400
    Required Tags: rhel-5-server
    Arches:

5) Subscription repos -list displayed "iteration over non-sequence" when had the "virtual" type subscription on the system

[root@localhost entitlement]# subscription-manager repos --list
iteration over non-sequence

After removing the entitlement of type "virtual" repos list displayed the content details correctly

[root@localhost entitlement]# ll
total 96
-rw-r--r-- 1 root root  1674 Jul 15 13:11 2745118027413685224-key.pem
-rw-r--r-- 1 root root  2418 Jul 15 13:11 2745118027413685224.pem
-rw-r--r-- 1 root root  1674 Jul 15 13:11 45922140425730468-key.pem
-rw-r--r-- 1 root root 64598 Jul 15 13:11 45922140425730468.pem
[root@localhost entitlement]# rm -rf 2745118027413685224*
[root@localhost entitlement]# subscription-manager repos --list
+----------------------------------------------------------+
    Available Repositories in /etc/yum.repos.d/redhat.repo
+----------------------------------------------------------+
Repo ID:   rhel-6-server-sam-source-rpms
Repo Name: Red Hat Subscription Asset Manager (for RHEL 6 Server) (Source RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/subscription-asset-manager/1/source/SRPMS
Enabled:   0

Repo ID:   rhel-6-server-rhev-agent-beta-debug-rpms
Repo Name: Red Hat Enterprise Virtualization Agents for RHEL 6 Server Beta (Debug RPMs)
Repo URL:  https://cdn.redhat.com/content/beta/rhel/server/6/$releasever/$basearch/rhev-agent/3/debug
Enabled:   0

Repo ID:   rhel-6-server-cf-tools-1-source-rpms
Repo Name: Red Hat CloudForms Tools for RHEL 6 (Source RPMs)
Repo URL:  https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/cf-tools/1/source/SRPMS
Enabled:   0

6) And subscription-manager-gui launch failed with "'NoneType' object has no attribute 'stacking_id'"

----log---
2013-07-15 13:58:34,751 [DEBUG]  @cache.py:138 - Wrote cache: /var/lib/rhsm/cache/entitlement_status.json
2013-07-15 13:58:34,752 [DEBUG]  @cert_sorter.py:254 - valid entitled products: ['69']
2013-07-15 13:58:34,752 [DEBUG]  @cert_sorter.py:255 - expired entitled products: []
2013-07-15 13:58:34,752 [DEBUG]  @cert_sorter.py:256 - partially entitled products: []
2013-07-15 13:58:34,752 [DEBUG]  @cert_sorter.py:257 - unentitled products: ['100000000000002']
2013-07-15 13:58:34,752 [DEBUG]  @cert_sorter.py:258 - future products: []
2013-07-15 13:58:34,752 [DEBUG]  @cert_sorter.py:259 - partial stacks: []
2013-07-15 13:58:34,752 [DEBUG]  @cert_sorter.py:260 - entitlements valid until: 2013-07-15 08:31:05+00:00
2013-07-15 13:58:34,753 [DEBUG]  @injection.py:80 - Returning instance for feature CERT_SORTER
2013-07-15 13:58:34,753 [DEBUG]  @injection.py:80 - Returning instance for feature IDENTITY
2013-07-15 13:58:34,753 [DEBUG]  @injection.py:72 - Initializing singleton for feature PLUGIN_MANAGER
2013-07-15 13:58:34,753 [DEBUG]  @plugins.py:519 - loaded plugin modules: []
2013-07-15 13:58:34,753 [DEBUG]  @plugins.py:520 - loaded plugins: {}
2013-07-15 13:58:34,753 [DEBUG]  @injection.py:80 - Returning instance for feature PLUGIN_MANAGER
2013-07-15 13:58:34,786 [INFO]  @facts.py:137 - Loading custom facts from: /etc/rhsm/facts/migration.facts
2013-07-15 13:58:34,786 [INFO]  @facts.py:137 - Loading custom facts from: /etc/rhsm/facts/memory.facts
2013-07-15 13:58:34,787 [INFO]  @facts.py:137 - Loading custom facts from: /etc/rhsm/facts/core.facts
2013-07-15 13:58:34,787 [DEBUG]  @managergui.py:147 - Client Versions: {'python-rhsm': '1.8.13-1.el5_9', 'subscription-manager': '1.8.13-1.el5_9'} 
2013-07-15 13:58:34,825 [DEBUG]  @connection.py:394 - Loading CA PEM certificates from: /etc/rhsm/ca/
2013-07-15 13:58:34,826 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2013-07-15 13:58:34,826 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-ca.pem'
2013-07-15 13:58:34,826 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2013-07-15 13:58:34,826 [DEBUG]  @connection.py:415 - Making request: GET /subscription/
2013-07-15 13:58:37,044 [DEBUG]  @connection.py:434 - Response status: 200
2013-07-15 13:58:37,044 [DEBUG]  @connection.py:613 - Server supports the following resources:
2013-07-15 13:58:37,044 [DEBUG]  @connection.py:614 - {'owners': '/owners', 'jobs': '/jobs', 'users': '/users', 'consumers': '/consumers', 'subscriptions': '/subscriptions', 'pools': '/pools', 'products': '/products', 'entitlements': '/entitlements'}
2013-07-15 13:58:37,045 [DEBUG]  @managergui.py:148 - Server Versions: {'candlepin': 'Unknown', 'server-type': 'Red Hat Subscription Management'} 
2013-07-15 13:58:37,047 [DEBUG]  @injection.py:80 - Returning instance for feature IDENTITY
2013-07-15 13:58:37,049 [DEBUG]  @injection.py:80 - Returning instance for feature IDENTITY
2013-07-15 13:58:37,049 [DEBUG]  @injection.py:80 - Returning instance for feature PLUGIN_MANAGER
2013-07-15 13:58:37,052 [DEBUG]  @injection.py:80 - Returning instance for feature CP_PROVIDER
2013-07-15 13:58:37,060 [DEBUG]  @injection.py:80 - Returning instance for feature IDENTITY
2013-07-15 13:58:37,073 [DEBUG]  @injection.py:80 - Returning instance for feature CP_PROVIDER
2013-07-15 13:58:37,074 [DEBUG]  @injection.py:80 - Returning instance for feature IDENTITY
2013-07-15 13:58:37,076 [DEBUG]  @injection.py:80 - Returning instance for feature IDENTITY
2013-07-15 13:58:37,078 [DEBUG]  @injection.py:80 - Returning instance for feature IDENTITY
2013-07-15 13:58:37,081 [ERROR]  @subscription-manager-gui:188 - 'NoneType' object has no attribute 'stacking_id'
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager-gui", line 171, in ?
    main = managergui.MainWindow(auto_launch_registration=options.register)
  File "/usr/share/rhsm/subscription_manager/gui/managergui.py", line 182, in __init__
    prod_dir=self.product_dir)
  File "/usr/share/rhsm/subscription_manager/gui/mysubstab.py", line 111, in __init__
    self.update_subscriptions()
  File "/usr/share/rhsm/subscription_manager/gui/mysubstab.py", line 157, in update_subscriptions
    sorter = EntitlementCertStackingGroupSorter(self.entitlement_dir.list())
  File "/usr/share/rhsm/subscription_manager/cert_sorter.py", line 377, in __init__
    StackingGroupSorter.__init__(self, certs)
  File "/usr/share/rhsm/subscription_manager/cert_sorter.py", line 344, in __init__
    stacking_id = self._get_stacking_id(entitlement)
  File "/usr/share/rhsm/subscription_manager/cert_sorter.py", line 380, in _get_stacking_id
    return cert.order.stacking_id
AttributeError: 'NoneType' object has no attribute 'stacking_id'

hence moving the status to "assigned"
Comment 4 Rehana 2013-07-15 04:45:32 EDT
Created attachment 773617 [details]
subscription_type_physical
Comment 5 Rehana 2013-07-15 04:47:03 EDT
Created attachment 773626 [details]
subscription_type_virtual
Comment 6 Rehana 2013-07-15 04:48:30 EDT
Created attachment 773631 [details]
stage_entitlements
Comment 8 Bryan Kearney 2013-07-16 17:00:10 EDT
*** Bug 959151 has been marked as a duplicate of this bug. ***
Comment 9 Bryan Kearney 2013-07-18 16:15:24 EDT
fixed in master at 

commit 2f2ba1aaba69baa726f0a81ae0f615665029b744
Author: Bryan Kearney <bkearney@redhat.com>
Date:   Tue Jul 16 16:26:54 2013 -0400

    974587: Add more checks for no order portion being present
Comment 12 Adrian Likins 2013-08-02 16:04:03 EDT
I'd also be curious what the results of this are with a RHEL6.4 client. Fear is that the certs are being generated that fail on some older clients, which may mean this needs to be a candlepin fix. (ala, https://bugzilla.redhat.com/show_bug.cgi?id=979153).
Comment 13 Adrian Likins 2013-08-02 16:18:53 EDT
With the 6.4 client, and a cert downloaded from access.stage.redhat.com:

[subscription-manager-internal (RHEL6.4 %)]$ sudo bin/subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+

'NoneType' object has no attribute 'name'


[subscription-manager-internal (RHEL6.4 %)]$ sudo bin/subscription-manager list --installed
'NoneType' object has no attribute 'stacking_id'

2013-08-02 16:18:18,567 [DEBUG]  @profile.py:95 - Loading current RPM profile.
2013-08-02 16:18:19,023 [INFO]  @managercli.py:253 - Client Versions: {'python-rhsm': '1.1.8-1.git.0.dd4869c.el6', 'subscription-manager': '1.1.23-1.git.0.aa12f3f.el6'} 
2013-08-02 16:18:19,025 [INFO]  @connection.py:538 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = True
2013-08-02 16:18:19,025 [INFO]  @connection.py:549 - Connection Built: host: subscription.rhn.stage.redhat.com, port: 443, handler: /subscription
2013-08-02 16:18:19,026 [INFO]  @connection.py:545 - Using no auth
2013-08-02 16:18:19,026 [INFO]  @connection.py:549 - Connection Built: host: subscription.rhn.stage.redhat.com, port: 443, handler: /subscription
2013-08-02 16:18:19,089 [DEBUG]  @connection.py:381 - Making request: GET /subscription/
2013-08-02 16:18:19,342 [DEBUG]  @connection.py:394 - Response status: 200
2013-08-02 16:18:19,343 [DEBUG]  @connection.py:565 - Server supports the following resources:
2013-08-02 16:18:19,343 [DEBUG]  @connection.py:566 - {'owners': '/owners', 'jobs': '/jobs', 'users': '/users', 'consumers': '/consumers', 'subscriptions': '/subscriptions', 'pools': '/pools', 'products': '/products', 'entitlements': '/entitlements'}
2013-08-02 16:18:19,344 [INFO]  @managercli.py:264 - Server Versions: {'candlepin': 'Unknown', 'server-type': 'This system is currently not registered.'} 
2013-08-02 16:18:19,346 [ERROR]  @managercli.py:115 - exception caught in subscription-manager
2013-08-02 16:18:19,346 [ERROR]  @managercli.py:116 - 'NoneType' object has no attribute 'name'
Traceback (most recent call last):
  File "bin/subscription-manager", line 88, in <module>
    sys.exit(abs(main() or 0))
  File "bin/subscription-manager", line 79, in main
    return managercli.ManagerCLI().main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 2085, in main
    return CLI.main(self)
  File "/usr/share/rhsm/subscription_manager/cli.py", line 156, in main
    return cmd.main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 424, in main
    return_code = self._do_command()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1940, in _do_command
    self.print_consumed(service_level=self.options.service_level)
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1982, in print_consumed
    order_name = self._format_name(order.name, 24, columns)
AttributeError: 'NoneType' object has no attribute 'name'




[subscription-manager-internal (RHEL6.4 %)]$ sudo bin/subscription-manager repos --list
'NoneType' object has no attribute 'stacking_id'
2013-08-02 16:17:56,190 [DEBUG]  @profile.py:95 - Loading current RPM profile.
2013-08-02 16:17:56,655 [INFO]  @managercli.py:253 - Client Versions: {'python-rhsm': '1.1.8-1.git.0.dd4869c.el6', 'subscription-manager': '1.1.23-1.git.0.aa12f3f.el6'} 
2013-08-02 16:17:56,656 [INFO]  @connection.py:538 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = True
2013-08-02 16:17:56,657 [INFO]  @connection.py:549 - Connection Built: host: subscription.rhn.stage.redhat.com, port: 443, handler: /subscription
2013-08-02 16:17:56,657 [INFO]  @connection.py:545 - Using no auth
2013-08-02 16:17:56,658 [INFO]  @connection.py:549 - Connection Built: host: subscription.rhn.stage.redhat.com, port: 443, handler: /subscription
2013-08-02 16:17:56,722 [DEBUG]  @connection.py:381 - Making request: GET /subscription/
2013-08-02 16:17:56,981 [DEBUG]  @connection.py:394 - Response status: 200
2013-08-02 16:17:56,982 [DEBUG]  @connection.py:565 - Server supports the following resources:
2013-08-02 16:17:56,982 [DEBUG]  @connection.py:566 - {'owners': '/owners', 'jobs': '/jobs', 'users': '/users', 'consumers': '/consumers', 'subscriptions': '/subscriptions', 'pools': '/pools', 'products': '/products', 'entitlements': '/entitlements'}
2013-08-02 16:17:56,983 [INFO]  @managercli.py:264 - Server Versions: {'candlepin': 'Unknown', 'server-type': 'This system is currently not registered.'} 
2013-08-02 16:17:57,134 [DEBUG]  @cert_sorter.py:116 - Sorting product and entitlement cert status for: 2013-08-02 20:17:57.134273+00:00
2013-08-02 16:17:57,136 [DEBUG]  @cert_sorter.py:169 - Installed product IDs: ['69']
2013-08-02 16:17:57,137 [DEBUG]  @cert_sorter.py:185 - Checking certificate: 3619886291277975922
2013-08-02 16:17:57,137 [ERROR]  @managercli.py:115 - exception caught in subscription-manager
2013-08-02 16:17:57,137 [ERROR]  @managercli.py:116 - 'NoneType' object has no attribute 'stacking_id'
Traceback (most recent call last):
  File "bin/subscription-manager", line 88, in <module>
    sys.exit(abs(main() or 0))
  File "bin/subscription-manager", line 79, in main
    return managercli.ManagerCLI().main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 2085, in main
    return CLI.main(self)
  File "/usr/share/rhsm/subscription_manager/cli.py", line 156, in main
    return cmd.main()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 424, in main
    return_code = self._do_command()
  File "/usr/share/rhsm/subscription_manager/managercli.py", line 1650, in _do_command
    certmgr = CertManager(uep=self.cp)
  File "/usr/share/rhsm/subscription_manager/certmgr.py", line 55, in __init__
    self.healinglib = HealingLib(self.lock, self.uep, facts.to_dict(),
  File "/usr/share/rhsm/subscription_manager/facts.py", line 112, in to_dict
    return self.get_facts()
  File "/usr/share/rhsm/subscription_manager/facts.py", line 104, in get_facts
    facts.update(self._get_validity_facts(facts))
  File "/usr/share/rhsm/subscription_manager/facts.py", line 136, in _get_validity_facts
    self.entitlement_dir, facts_dict)
  File "/usr/share/rhsm/subscription_manager/cert_sorter.py", line 119, in __init__
    self._scan_entitlement_certs()
  File "/usr/share/rhsm/subscription_manager/cert_sorter.py", line 206, in _scan_entitlement_certs
    stack_id = order.stacking_id
AttributeError: 'NoneType' object has no attribute 'stacking_id'





[subscription-manager-internal (RHEL6.4 %)]$ sudo bin/subscription-manager-gui 
'NoneType' object has no attribute 'stacking_id'
2013-08-02 16:17:14,437 [DEBUG]  @profile.py:95 - Loading current RPM profile.
2013-08-02 16:17:14,912 [INFO]  @connection.py:538 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = True
2013-08-02 16:17:14,912 [INFO]  @connection.py:549 - Connection Built: host: subscription.rhn.stage.redhat.com, port: 443, handler: /subscription
2013-08-02 16:17:14,913 [DEBUG]  @connection.py:165 - ContectConnection
2013-08-02 16:17:14,914 [DEBUG]  @managergui.py:174 - Loading consumer info from identity certificates.
2013-08-02 16:17:14,915 [DEBUG]  @managergui.py:213 - Client Versions: {'python-rhsm': '1.1.8-1.git.0.dd4869c.el6', 'subscription-manager': '1.1.23-1.git.0.aa12f3f.el6'} 
2013-08-02 16:17:14,983 [DEBUG]  @connection.py:381 - Making request: GET /subscription/
2013-08-02 16:17:15,242 [DEBUG]  @connection.py:394 - Response status: 200
2013-08-02 16:17:15,243 [DEBUG]  @connection.py:565 - Server supports the following resources:
2013-08-02 16:17:15,243 [DEBUG]  @connection.py:566 - {'owners': '/owners', 'jobs': '/jobs', 'users': '/users', 'consumers': '/consumers', 'subscriptions': '/subscriptions', 'pools': '/pools', 'products': '/products', 'entitlements': '/entitlements'}
2013-08-02 16:17:15,244 [DEBUG]  @managergui.py:214 - Server Versions: {'candlepin': 'Unknown', 'server-type': 'This system is currently not registered.'} 
2013-08-02 16:17:15,637 [DEBUG]  @cert_sorter.py:116 - Sorting product and entitlement cert status for: 2013-08-02 20:17:15.637299+00:00
2013-08-02 16:17:15,645 [DEBUG]  @cert_sorter.py:169 - Installed product IDs: ['69']
2013-08-02 16:17:15,646 [DEBUG]  @cert_sorter.py:185 - Checking certificate: 3619886291277975922
2013-08-02 16:17:15,647 [ERROR]  @subscription-manager-gui:146 - 'NoneType' object has no attribute 'stacking_id'
Traceback (most recent call last):
  File "bin/subscription-manager-gui", line 129, in <module>
    main = managergui.MainWindow(auto_launch_registration=options.register)
  File "/usr/share/rhsm/subscription_manager/gui/managergui.py", line 245, in __init__
    prod_dir=self.product_dir)
  File "/usr/share/rhsm/subscription_manager/gui/installedtab.py", line 68, in __init__
    self.facts.get_facts())
  File "/usr/share/rhsm/subscription_manager/facts.py", line 104, in get_facts
    facts.update(self._get_validity_facts(facts))
  File "/usr/share/rhsm/subscription_manager/facts.py", line 136, in _get_validity_facts
    self.entitlement_dir, facts_dict)
  File "/usr/share/rhsm/subscription_manager/cert_sorter.py", line 119, in __init__
    self._scan_entitlement_certs()
  File "/usr/share/rhsm/subscription_manager/cert_sorter.py", line 206, in _scan_entitlement_certs
    stack_id = order.stacking_id
AttributeError: 'NoneType' object has no attribute 'stacking_id'
Comment 14 Adrian Likins 2013-08-02 16:22:08 EDT
[subscription-manager (awood/991548 %)]$ rct cat-cert /etc/pki/entitlement/3619886291277975922.pem 
Traceback (most recent call last):
  File "/usr/bin/rct", line 44, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/bin/rct", line 39, in main
    return RctCLI().main()
  File "/usr/share/rhsm/subscription_manager/cli.py", line 156, in main
    return cmd.main()
  File "/usr/share/rhsm/rct/commands.py", line 44, in main
    return_code = self._do_command()
  File "/usr/share/rhsm/rct/commands.py", line 92, in _do_command
    skip_products=self.options.no_products)
  File "/usr/share/rhsm/rct/printing.py", line 198, in printc
    printer.printc(cert)
  File "/usr/share/rhsm/rct/printing.py", line 107, in printc
    print self.cert_to_str(cert)
  File "/usr/share/rhsm/rct/printing.py", line 163, in cert_to_str
    sorted_content = sorted(cert.content, key=lambda content: content.label)
TypeError: 'NoneType' object is not iterable
Comment 16 Carter Kozak 2013-08-07 10:04:06 EDT
This fixes certs with no content.  All certificates should have order information, that will be fixed on the server side.

commit 456aafc1170394d500355d3c616c2b6324f9a3ea
Author: ckozak <ckozak@redhat.com>
Date:   Wed Aug 7 09:38:41 2013 -0400

    974587: allow certs with no content
Comment 17 Jesus M. Rodriguez 2013-08-07 11:13:53 EDT
Change will be in version 1.8.19-1 or later
Comment 18 Rehana 2013-08-08 01:23:08 EDT
Retested on,
rpm -qa | grep subscr
subscription-manager-debuginfo-1.8.19-1.el5
subscription-manager-gui-1.8.19-1.el5
subscription-manager-1.8.19-1.el5
subscription-manager-migration-1.8.19-1.el5
subscription-manager-firstboot-1.8.19-1.el5

rpm -qa | grep python-rhsm
python-rhsm-1.8.16-1.el5
python-rhsm-debuginfo-1.8.16-1.el5

1) list --consumed displayed subscription details
[root@localhost entitlement]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: 
Provides:          
SKU:               
Contract:          
Account:           
Serial:            8866766575896923170
Pool ID:           Not Available
Active:            True
Quantity Used:     
Service Level:     
Service Type:      
Status Details:    
Starts:            12/31/2012
Ends:              12/31/2013

Subscription Name: 
Provides:          
SKU:               
Contract:          
Account:           
Serial:            5056741586082610808
Pool ID:           Not Available
Active:            True
Quantity Used:     
Service Level:     
Service Type:      
Status Details:    
Starts:            12/31/2012
Ends:              12/31/2013

2) Repo list displayed correct details,but observed there is a traceback in the rhsm.log

[root@localhost entitlement]# subscription-manager repos --list
This system has no repositories available through subscriptions.

rhsm.log
-------
2013-08-08 10:33:22,194 [DEBUG]  @connection.py:614 - {'owners': '/owners', 'jobs': '/jobs', 'users': '/users', 'consumers': '/consumers', 'subscriptions': '/subscriptions', 'pools': '/pools', 'products': '/products', 'entitlements': '/entitlements'}
2013-08-08 10:33:22,194 [INFO]  @managercli.py:303 - Server Versions: {'candlepin': 'Unknown', 'server-type': 'This system is currently not registered.'}
2013-08-08 10:33:22,194 [DEBUG]  @injection.py:80 - Returning instance for feature ENT_DIR
2013-08-08 10:33:22,194 [DEBUG]  @injection.py:80 - Returning instance for feature PROD_DIR
2013-08-08 10:33:22,195 [DEBUG]  @injection.py:80 - Returning instance for feature PLUGIN_MANAGER
2013-08-08 10:33:22,195 [DEBUG]  @injection.py:80 - Returning instance for feature PROD_DIR
2013-08-08 10:33:22,195 [DEBUG]  @injection.py:80 - Returning instance for feature PLUGIN_MANAGER
2013-08-08 10:33:22,195 [DEBUG]  @injection.py:80 - Returning instance for feature ENT_DIR
2013-08-08 10:33:22,200 [ERROR]  @certlib.py:292 - [Errno 2] No such file or directory: '/etc/pki/consumer/key.pem'
2013-08-08 10:33:22,200 [WARNING]  @certmgr.py:93 - Exception caught while running certlib update
2013-08-08 10:33:22,200 [ERROR]  @certmgr.py:94 - 
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/certmgr.py", line 84, in update
    ret = self.certlib.update()
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 68, in update
    return self._do_update()
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 91, in _do_update
    return action.perform()
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 234, in perform
    expected = self._get_expected_serials(report)
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 307, in _get_expected_serials
    exp = self.get_certificate_serials_list()
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 300, in get_certificate_serials_list
    reply = self.uep.getCertificateSerials(self._get_consumer_id())
  File "/usr/share/rhsm/subscription_manager/certlib.py", line 293, in _get_consumer_id
    raise Disconnected()
Disconnected
2013-08-08 10:33:22,203 [INFO]  @repolib.py:158 - repos updated: 0
2013-08-08 10:33:22,203 [INFO]  @facts.py:73 - Cache /var/lib/rhsm/facts/facts.json does not exit
2013-08-08 10:33:22,207 [DEBUG]  @hwprobe.py:519 - cpu info: {'cpu.cpu(s)': 1, 'cpu.core(s)_per_socket': 1, 'cpu.thread(s)_per_core': 1, 'cpu.topology_source': 'kernel /sys cpu sibling lists', 'cpu.cpu_socket(s)': 1}
2013-08-08 10:33:22,235 [INFO]  @facts.py:137 - Loading custom facts from: /etc/rhsm/facts/core.facts
2013-08-08 10:33:22,236 [DEBUG]  @injection.py:80 - Returning instance for feature PROD_DIR
-------------------------------------------------

3)most importantly  subscription-manager-gui Failed to launch again

[root@localhost entitlement]# subscription-manager-gui 
debug1: client_input_channel_open: ctype x11 rchan 3 win 65536 max 16384
debug1: client_request_x11: request from 127.0.0.1 33757
debug1: channel 1: new [x11]
debug1: confirm x11
debug1: client_input_channel_open: ctype x11 rchan 5 win 65536 max 16384
debug1: client_request_x11: request from 127.0.0.1 33758
debug1: channel 3: new [x11]
debug1: confirm x11
debug1: channel 3: FORCE input drain
debug1: channel 3: free: x11, nchannels 4
'NoneType' object has no attribute 'warning_period'
debug1: channel 1: FORCE input drain
[root@localhost entitlement]# debug1: channel 1: free: x11, nchannels 3

rhsm.log
-----------------

2013-08-08 10:29:24,699 [DEBUG]  @injection.py:72 - Initializing singleton for feature IDENTITY
2013-08-08 10:29:24,700 [DEBUG]  @identity.py:130 - Loading consumer info from identity certificates.
2013-08-08 10:29:24,700 [DEBUG]  @injection.py:80 - Returning instance for feature IDENTITY
2013-08-08 10:29:24,700 [DEBUG]  @injection.py:72 - Initializing singleton for feature CP_PROVIDER
2013-08-08 10:29:24,701 [DEBUG]  @injection.py:80 - Returning instance for feature CP_PROVIDER
2013-08-08 10:29:24,701 [DEBUG]  @profile.py:96 - Loading current RPM profile.
2013-08-08 10:29:24,775 [INFO]  @connection.py:583 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = False
2013-08-08 10:29:24,775 [INFO]  @connection.py:596 - Connection Built: host: subscription.rhn.stage.redhat.com, port: 443, handler: /subscription
2013-08-08 10:29:24,775 [DEBUG]  @connection.py:199 - ContectConnection
2013-08-08 10:29:24,776 [DEBUG]  @injection.py:72 - Initializing singleton for feature PROD_DIR
2013-08-08 10:29:24,776 [DEBUG]  @injection.py:80 - Returning instance for feature PROD_DIR
2013-08-08 10:29:24,776 [DEBUG]  @injection.py:72 - Initializing singleton for feature ENT_DIR
2013-08-08 10:29:24,776 [DEBUG]  @injection.py:80 - Returning instance for feature ENT_DIR
2013-08-08 10:29:24,776 [DEBUG]  @injection.py:72 - Initializing singleton for feature CERT_SORTER
2013-08-08 10:29:24,776 [DEBUG]  @injection.py:80 - Returning instance for feature CP_PROVIDER
2013-08-08 10:29:24,776 [DEBUG]  @injection.py:80 - Returning instance for feature PROD_DIR
2013-08-08 10:29:24,776 [DEBUG]  @injection.py:80 - Returning instance for feature ENT_DIR
2013-08-08 10:29:24,776 [DEBUG]  @injection.py:80 - Returning instance for feature IDENTITY
2013-08-08 10:29:24,777 [DEBUG]  @injection.py:80 - Returning instance for feature PROD_DIR
2013-08-08 10:29:24,782 [DEBUG]  @certdirectory.py:204 - Installed product IDs: ['69']
2013-08-08 10:29:24,782 [DEBUG]  @cert_sorter.py:196 - Unregistered, skipping server compliance check.
2013-08-08 10:29:24,782 [DEBUG]  @injection.py:80 - Returning instance for feature CERT_SORTER
2013-08-08 10:29:24,782 [DEBUG]  @injection.py:80 - Returning instance for feature IDENTITY
2013-08-08 10:29:24,782 [DEBUG]  @injection.py:72 - Initializing singleton for feature PLUGIN_MANAGER
2013-08-08 10:29:24,782 [DEBUG]  @plugins.py:519 - loaded plugin modules: []
2013-08-08 10:29:24,782 [DEBUG]  @plugins.py:520 - loaded plugins: {}
2013-08-08 10:29:24,783 [DEBUG]  @injection.py:80 - Returning instance for feature PLUGIN_MANAGER
2013-08-08 10:29:24,787 [DEBUG]  @hwprobe.py:519 - cpu info: {'cpu.cpu(s)': 1, 'cpu.core(s)_per_socket': 1, 'cpu.thread(s)_per_core': 1, 'cpu.topology_source': 'kernel /sys cpu sibling lists', 'cpu.cpu_socket(s)': 1}
2013-08-08 10:29:24,813 [INFO]  @facts.py:137 - Loading custom facts from: /etc/rhsm/facts/core.facts
2013-08-08 10:29:24,814 [DEBUG]  @managergui.py:147 - Client Versions: {'python-rhsm': '1.8.16-1.el5', 'subscription-manager': '1.8.19-1.el5'} 
2013-08-08 10:29:24,852 [DEBUG]  @connection.py:394 - Loading CA PEM certificates from: /etc/rhsm/ca/
2013-08-08 10:29:24,852 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/redhat-uep.pem'
2013-08-08 10:29:24,852 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-stage.pem'
2013-08-08 10:29:24,853 [DEBUG]  @connection.py:376 - Loading CA certificate: '/etc/rhsm/ca/candlepin-ca.pem'
2013-08-08 10:29:24,853 [DEBUG]  @connection.py:415 - Making request: GET /subscription/
2013-08-08 10:29:26,904 [DEBUG]  @connection.py:434 - Response status: 200
2013-08-08 10:29:26,905 [DEBUG]  @connection.py:613 - Server supports the following resources:
2013-08-08 10:29:26,905 [DEBUG]  @connection.py:614 - {'owners': '/owners', 'jobs': '/jobs', 'users': '/users', 'consumers': '/consumers', 'subscriptions': '/subscriptions', 'pools': '/pools', 'products': '/products', 'entitlements': '/entitlements'}
2013-08-08 10:29:26,905 [DEBUG]  @managergui.py:148 - Server Versions: {'candlepin': 'Unknown', 'server-type': 'This system is currently not registered.'} 
2013-08-08 10:29:26,908 [DEBUG]  @injection.py:80 - Returning instance for feature IDENTITY
2013-08-08 10:29:26,909 [DEBUG]  @injection.py:80 - Returning instance for feature IDENTITY
2013-08-08 10:29:26,909 [DEBUG]  @injection.py:80 - Returning instance for feature PLUGIN_MANAGER
2013-08-08 10:29:26,912 [DEBUG]  @injection.py:80 - Returning instance for feature CP_PROVIDER
2013-08-08 10:29:26,921 [DEBUG]  @injection.py:80 - Returning instance for feature IDENTITY
2013-08-08 10:29:26,934 [DEBUG]  @injection.py:80 - Returning instance for feature CP_PROVIDER
2013-08-08 10:29:26,935 [DEBUG]  @injection.py:80 - Returning instance for feature IDENTITY
2013-08-08 10:29:26,937 [DEBUG]  @injection.py:80 - Returning instance for feature IDENTITY
2013-08-08 10:29:26,939 [DEBUG]  @injection.py:80 - Returning instance for feature IDENTITY
2013-08-08 10:29:26,943 [ERROR]  @subscription-manager-gui:188 - 'NoneType' object has no attribute 'warning_period'
Traceback (most recent call last):
  File "/usr/sbin/subscription-manager-gui", line 171, in ?
    main = managergui.MainWindow(auto_launch_registration=options.register)
  File "/usr/share/rhsm/subscription_manager/gui/managergui.py", line 182, in __init__
    prod_dir=self.product_dir)
  File "/usr/share/rhsm/subscription_manager/gui/mysubstab.py", line 110, in __init__
    self.update_subscriptions(update_dbus=False)
  File "/usr/share/rhsm/subscription_manager/gui/mysubstab.py", line 161, in update_subscriptions
    self._add_group(idx, group)
  File "/usr/share/rhsm/subscription_manager/gui/mysubstab.py", line 186, in _add_group
    image = self._get_entry_image(cert)
  File "/usr/share/rhsm/subscription_manager/gui/mysubstab.py", line 332, in _get_entry_image
    if cert.is_expiring():
  File "/usr/lib64/python2.4/site-packages/rhsm/certificate2.py", line 527, in is_expiring
    warning_time = timedelta(days=int(self.order.warning_period))
AttributeError: 'NoneType' object has no attribute 'warning_period'

Moving this bug back to 'Assigned'
Comment 19 Adrian Likins 2013-08-08 09:36:05 EDT
It seems like downloaded entitlement certs from access.stage is not really working. The certificates it provides:

     - do not match a cert that the client would have gotten from subscribe --auto
       or a subscribe --pool
     - the certs downloaded do not seem to have order, subscriptions, or content.
     - the issue dates seem to start dec 21 2012. Not sure what that means, but
       it seems wrong for an ent cert.
     - I'm pretty sure they are not entitlement certificates at all.
     
See comment #15 for an example.
Comment 20 Adrian Likins 2013-08-12 12:42:23 EDT
Filed https://bugzilla.redhat.com/show_bug.cgi?id=995099 for the download link issue.
Comment 21 Carter Kozak 2013-08-14 08:27:54 EDT
There are two issues here

1)  Subscription manager would crash when listing repos, because the certificate has no content
This is fixed now, and was a subscription manager problem

2)  Subscription manager crashes when an entitlement cert has no order
This is a bug with the stage server, every certificate should have an order, regardless of where it was created.  We are working to fix that bug in candlepin.

I'd suggest closing this as "NOT_A_BUG", however it brought up the problem with listing repos in certs with no content that has since been fixed.  That is the problem that should be verified, not the list --consumed bug that is caused by stage.
Comment 22 Rehana 2013-08-14 09:25:56 EDT
Retested on  

subscription-manager version
server type: This system is currently not registered.
subscription management server: Unknown
subscription-manager: 1.8.20-1.el5
python-rhsm: 1.8.16-1.el5

As per comment 21, Verifying this bug against repo list issue that was mentioned in the bug description

[root@localhost home]# subscription-manager import --cert 8a99f9843c01ccba013c037bb24e0268.pem 
Successfully imported certificate 8a99f9843c01ccba013c037bb24e0268.pem

[root@localhost home]# subscription-manager repos --list
This system has no repositories available through subscriptions.

Observed that the repo --list is working when  certs with no content was imported.

Reg://Entitlement cert with no order number from the stage server, a separte bug has been logged https://bugzilla.redhat.com/show_bug.cgi?id=995099 
(see comment 20)

Hence moving this bug to verified
Comment 24 errata-xmlrpc 2013-09-30 19:10:39 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1332.html

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