Bug 1120576 - "subscription-manager version" can not display values for subscription management server and rules
Summary: "subscription-manager version" can not display values for subscription manage...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: API
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified vote
Target Milestone: Unspecified
Assignee: Bryan Kearney
QA Contact: Jitendra Yejare
URL:
Whiteboard:
Depends On:
Blocks: sam20-tracker rhsm-rhel71
TreeView+ depends on / blocked
 
Reported: 2014-07-17 08:09 UTC by qianzhan
Modified: 2019-09-25 21:27 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-12-11 19:22:16 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0502 normal SHIPPED_LIVE subscription-manager bug fix and enhancement update 2015-03-05 16:20:39 UTC

Description qianzhan 2014-07-17 08:09:47 UTC
Description of problem:
"subscription-manager version" can not display values for subscription management server and rules

Version-Release number of selected component (if applicable):
candlepin-0.9.6.4-1.el6sam.noarch
candlepin-scl-1-5.el6_4.noarch
candlepin-scl-quartz-2.1.5-5.el6_4.noarch
candlepin-scl-rhino-1.7R3-1.el6_4.noarch
candlepin-scl-runtime-1-5.el6_4.noarch
candlepin-selinux-0.9.6.4-1.el6sam.noarch
candlepin-tomcat6-0.9.6.4-1.el6sam.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-certs-tools-1.4.2-2.el6sat.noarch
katello-cli-1.4.3.1-1.el6sam.noarch
katello-cli-common-1.4.3.1-1.el6sam.noarch
katello-common-1.4.3.26-1.el6sam_splice.noarch
katello-configure-1.4.5-1.el6sam.noarch
katello-glue-candlepin-1.4.3.26-1.el6sam_splice.noarch
katello-glue-elasticsearch-1.4.3.26-1.el6sam_splice.noarch
katello-headpin-1.4.3.26-1.el6sam_splice.noarch
katello-headpin-all-1.4.3.26-1.el6sam_splice.noarch
katello-selinux-1.4.4-2.el6sat.noarch
ruby193-rubygem-katello-redhat-access-engine-0.0.1-1.el6sam.noarch
thumbslug-0.0.40-1.el6sam.noarch
thumbslug-selinux-0.0.40-1.el6sam.noarch
subscription-manager: 1.12.4-1.el6
python-rhsm: 1.12.4-1.el6

How reproducible:
always

Steps to Reproduce:
1. Register and auto-attach against SAM. 

2. Run "subscription-manager version"
[root@dhcp-14-233 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: Unknown      <==========should display values
subscription management rules: Unknown       <==========should display values
subscription-manager: 1.12.4-1.el6
python-rhsm: 1.12.4-1.el6

3. Check identity and consumed subscription:
[root@dhcp-14-233 ~]# subscription-manager identity
system identity: 60d1e5ab-15e5-4e6c-b10f-4772786ff3c3
name: dhcp-14-233.nay.redhat.com
org name: ACME_Corporation
org ID: ACME_Corporation

[root@dhcp-14-233 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Red Hat Enterprise Linux for Virtual Datacenters, Premium
Provides:          Oracle Java (for RHEL Server)
                   Red Hat Enterprise Linux High Performance Networking (for
                   RHEL Server) - Extended Update Support
                   Red Hat Enterprise Linux Server - Extended Update Support
                   Red Hat Enterprise Linux Server
                   Oracle Java (for RHEL Workstation)
                   Red Hat EUCJP Support (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 High Availability (for RHEL Server)
                   - Extended Update Support
                   Red Hat Developer Toolset (for RHEL Server)
                   Red Hat Enterprise Linux Scalable File System (for RHEL
                   Server) - Extended Update Support
                   Red Hat Software Collections Beta (for RHEL Server)
                   Red Hat Enterprise Linux Load Balancer (for RHEL Server) -
                   Extended Update Support
                   Red Hat S-JIS Support (for RHEL Server) - Extended Update
                   Support
SKU:               RH00049
Contract:          10470616
Account:           5480518
Serial:            1680656145029101642
Pool ID:           8ac2019c473abb0701473abd303302b4
Active:            True
Quantity Used:     1
Service Level:     Premium
Service Type:      L1-L3
Status Details:    
Subscription Type: Standard
Starts:            12/31/2013
Ends:              12/30/2014
System Type:       Physical

Actual results:
As step 2.

Expected results:
subscription management server and rules should have specified values.

Additional info:
When run "" against stage candlepin, it seems fine:

# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.9.20.1-1
subscription management rules: 5.9
subscription-manager: 1.12.4-1.el6
python-rhsm: 1.12.4-1.el6

Comment 1 qianzhan 2014-08-05 07:27:48 UTC
1. When open subscription-manager-gui ==> Help ==> About, the rhsm.log reports:

2014-08-05 07:25:02,473 [DEBUG] subscription-manager-gui @connection.py:414 - Loaded CA certificates from /etc/rhsm/ca/: candlepin-local.pem, candlepin-stage.pem, redhat-uep.pem
2014-08-05 07:25:02,474 [DEBUG] subscription-manager-gui @connection.py:446 - Making request: GET /sam/api/status
2014-08-05 07:25:02,507 [DEBUG] subscription-manager-gui @connection.py:469 - Response: status=200
2014-08-05 07:25:02,508 [WARNING] subscription-manager-gui @connection.py:473 - Clock skew detected, please check your system time
2014-08-05 07:25:02,510 [ERROR] subscription-manager-gui @utils.py:262 - Error while checking server version: 'rulesVersion'
2014-08-05 07:25:02,510 [ERROR] subscription-manager-gui @utils.py:264 - 'rulesVersion'
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/utils.py", line 246, in get_server_versions
    rules_version = status['rulesVersion']
KeyError: 'rulesVersion'


2. The same error happens in rhsm.log when run "subscription-manager version":

2014-08-05 07:26:10,055 [DEBUG] subscription-manager @plugins.py:569 - loaded plugin modules: []
2014-08-05 07:26:10,055 [DEBUG] subscription-manager @plugins.py:570 - loaded plugins: {}
2014-08-05 07:26:10,055 [DEBUG] subscription-manager @identity.py:131 - Loading consumer info from identity certificates.
2014-08-05 07:26:10,084 [DEBUG] subscription-manager @profile.py:97 - Loading current RPM profile.
2014-08-05 07:26:10,169 [INFO] subscription-manager @managercli.py:298 - Client Versions: {'python-rhsm': '1.12.5-1.el6', 'subscription-manager': '1.12.10-1.el6'}
2014-08-05 07:26:10,169 [INFO] subscription-manager @connection.py:659 - Using certificate authentication: key = /etc/pki/consumer/key.pem, cert = /etc/pki/consumer/cert.pem, ca = /etc/rhsm/ca/, insecure = False
2014-08-05 07:26:10,169 [INFO] subscription-manager @connection.py:670 - Connection Built: host: samserv.redhat.com, port: 443, handler: /sam/api
2014-08-05 07:26:10,170 [INFO] subscription-manager @connection.py:666 - Using no auth
2014-08-05 07:26:10,170 [INFO] subscription-manager @connection.py:670 - Connection Built: host: samserv.redhat.com, port: 443, handler: /sam/api
2014-08-05 07:26:10,181 [DEBUG] subscription-manager @connection.py:414 - Loaded CA certificates from /etc/rhsm/ca/: candlepin-local.pem, candlepin-stage.pem, redhat-uep.pem
2014-08-05 07:26:10,181 [DEBUG] subscription-manager @connection.py:446 - Making request: GET /sam/api/
2014-08-05 07:26:10,232 [DEBUG] subscription-manager @connection.py:469 - Response: status=200
2014-08-05 07:26:10,233 [WARNING] subscription-manager @connection.py:473 - Clock skew detected, please check your system time
2014-08-05 07:26:10,235 [DEBUG] subscription-manager @connection.py:686 - Server supports the following resources:
2014-08-05 07:26:10,235 [DEBUG] subscription-manager @connection.py:687 - {'status': '/api/status/', 'organizations': '/api/organizations/', 'roles': '/api/roles/', 'sync_plans': '/api/sync_plans/', 'users': '/api/users/', 'distributors': '/api/distributors/', 'providers': '/api/providers/', 'entitlements': '/api/entitlements/', 'content_overrides': '/api/content_overrides', 'content_views': '/api/content_views/', 'guestids': '/api/guestids', 'system_groups': '/api/system_groups/', 'products': '/api/products/', 'systems': '/api/systems/', 'activation_keys': '/api/activation_keys/', 'content_view_definitions': '/api/content_view_definitions/', 'consumers': '/api/consumers/'}
2014-08-05 07:26:10,236 [DEBUG] subscription-manager @connection.py:414 - Loaded CA certificates from /etc/rhsm/ca/: candlepin-local.pem, candlepin-stage.pem, redhat-uep.pem
2014-08-05 07:26:10,236 [DEBUG] subscription-manager @connection.py:446 - Making request: GET /sam/api/status
2014-08-05 07:26:10,260 [DEBUG] subscription-manager @connection.py:469 - Response: status=200
2014-08-05 07:26:10,261 [WARNING] subscription-manager @connection.py:473 - Clock skew detected, please check your system time
2014-08-05 07:26:10,261 [ERROR] subscription-manager @utils.py:262 - Error while checking server version: 'rulesVersion'
2014-08-05 07:26:10,261 [ERROR] subscription-manager @utils.py:264 - 'rulesVersion'
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/utils.py", line 246, in get_server_versions
    rules_version = status['rulesVersion']
KeyError: 'rulesVersion'
2014-08-05 07:26:10,262 [INFO] subscription-manager @managercli.py:309 - Server Versions: {'rules-version': 'Unknown', 'candlepin': 'Unknown', 'server-type': 'Red Hat Subscription Management'}

Comment 2 qianzhan 2014-08-27 05:30:54 UTC
On RHEL-6.6-20140826.0 against SAM-1.4.1-RHEL-6.6-20140804.0, the value of rules is still not displayed:

[root@dhcp-15-25 ~]# subscription-manager register --auto-attach
Username: admin
Password: 
The system has been registered with ID: aa60a77b-bd06-4d0b-9a23-e43df1e37605 
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

[root@dhcp-15-25 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 1.4.3.26-1.el6sam_splice-Headpin
subscription management rules: Unknown
subscription-manager: 1.12.13-1.el6
python-rhsm: 1.12.5-1.el6

Comment 3 Chris "Ceiu" Rog 2014-10-20 13:26:04 UTC
commit 30401f6584102892b06cfc74a2eae39705c6ef33
Merge: 1e307d9 6832d57
Author: Adrian Likins <alikins@redhat.com>
Date:   Tue Oct 14 17:13:30 2014 -0400

    Merge pull request #1033 from candlepin/crog/1120576
    
    1120576: Added additional testing of version parsing

Comment 4 Chris "Ceiu" Rog 2014-10-24 17:11:03 UTC
Some additional notes from my git commit:

It looks like the root problem exists outside the scope of subman and/or has been handled by a prior update. From what I can tell, the version info is just passed through as it is received from the server. That said, aside from doing things which don't seem very "pythonic" (ie: type checking), there's not a whole lot more we can do to catch bad data being sent by the server.

In any event, I've added additional tests which should test any type reasonable to see in a JSON blob. The version concatenation will still throw an exception, but it's already being explicitly handled/expected and logged and is doing so by design.

Comment 5 qianzhan 2014-10-28 03:27:35 UTC
Bug still exist in RHEL7.1:

SAM server:
candlepin-0.9.6.5-1.el6sam.noarch
candlepin-scl-1-5.el6_4.noarch
candlepin-scl-quartz-2.1.5-5.el6_4.noarch
candlepin-scl-rhino-1.7R3-1.el6_4.noarch
candlepin-scl-runtime-1-5.el6_4.noarch
candlepin-selinux-0.9.6.5-1.el6sam.noarch
candlepin-tomcat6-0.9.6.5-1.el6sam.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-certs-tools-1.4.2-2.el6sat.noarch
katello-cli-1.4.3.1-1.el6sam.noarch
katello-cli-common-1.4.3.1-1.el6sam.noarch
katello-common-1.4.3.28-1.el6sam_splice.noarch
katello-configure-1.4.5.1-3.el6sam.noarch
katello-glue-candlepin-1.4.3.28-1.el6sam_splice.noarch
katello-glue-elasticsearch-1.4.3.28-1.el6sam_splice.noarch
katello-headpin-1.4.3.28-1.el6sam_splice.noarch
katello-headpin-all-1.4.3.28-1.el6sam_splice.noarch
katello-selinux-1.4.4-2.el6sat.noarch
ruby193-rubygem-katello-redhat-access-engine-0.0.1-1.el6sam.noarch
thumbslug-0.0.40-1.el6sam.noarch
thumbslug-selinux-0.0.40-1.el6sam.noarch

Client:
subscription-manager: 1.13.5-1.el7
python-rhsm: 1.13.5-1.el7


[root@dhcp-128-22 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 1.4.3.28-1.el6sam_splice-Headpin
subscription management rules: Unknown
subscription-manager: 1.13.5-1.el7
python-rhsm: 1.13.5-1.el7

Comment 7 qianzhan 2014-11-04 02:59:50 UTC
(In reply to Chris Rog from comment #4)
> Some additional notes from my git commit:
> 
> It looks like the root problem exists outside the scope of subman and/or has
> been handled by a prior update. From what I can tell, the version info is
> just passed through as it is received from the server. That said, aside from
> doing things which don't seem very "pythonic" (ie: type checking), there's
> not a whole lot more we can do to catch bad data being sent by the server.
> 
> In any event, I've added additional tests which should test any type
> reasonable to see in a JSON blob. The version concatenation will still throw
> an exception, but it's already being explicitly handled/expected and logged
> and is doing so by design.

Hello,
I have tracked this bug in RHEL7.1-20141029.0, the value of "subscription management rules" is still "Unknown", but "subscription management server" field is ok now. Do you mean this bug can be verified totally when new SAM server build comes?

Thank you.

Qianqian Zhang

Comment 8 qianzhan 2014-11-10 07:37:54 UTC
As per comment 7, moving to 'ASSIGNED'.

Comment 9 Chris "Ceiu" Rog 2014-12-11 19:15:58 UTC
Sorry for the delay in responding to this.

This is an issue with the SAM server not sending version information for rules. Once the SAM server is updated to return version information for the rules, it will show up as expected in subscription manager.

Comment 10 Devan Goodwin 2014-12-11 19:20:55 UTC
Chris has established this isn't really a problem with Subscription Manager, it's that SAM is intercepting the GET /status API call and returning it's own response. SAM would need to be updated to return the rules version from Candlepin to fix this. 

Given SAM is now in maintenance mode, re-aligning for fixing in Satellite 6.

Comment 11 Devan Goodwin 2014-12-11 19:22:16 UTC
02:19pm <thomasmckay> $ sudo subscription-manager version
02:19pm <thomasmckay> server type: Red Hat Subscription Management
02:19pm <thomasmckay> subscription management server: 2.1.0-Unknown
02:19pm <thomasmckay> subscription management rules: 5.11
02:19pm <thomasmckay> subscription-manager: 1.13.5-1.fc19
02:19pm <thomasmckay> python-rhsm: 1.12.5-1.fc19

This looks to already be fixed in Sat 6, but no fix will be forthcoming for SAM however.


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