Bug 1284120
Summary: | Traceback "KeyError: 'rules-version'" is thrown when calling subscription-manager version | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | John Sefler <jsefler> |
Component: | subscription-manager | Assignee: | candlepin-bugs |
Status: | CLOSED ERRATA | QA Contact: | John Sefler <jsefler> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 6.8 | CC: | alikins, bcourt, csnyder, tlavigne |
Target Milestone: | rc | Keywords: | Regression, 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-05-10 20:38:14 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
John Sefler
2015-11-20 22:22:31 UTC
Looks like version command is expecting the self.server_versions dict to be setup, but the request hasn't happened yet. With some extra logging and threadName in log format: 2015-11-30 16:50:27,980 [INFO] subscription-manager:31788:MainThread @connection.py:788 - Connection built: host=grimlock.usersys.redhat.com port=8443 handler=/candlepin auth=none 2015-11-30 16:50:27,993 [DEBUG] subscription-manager:31788:MainThread @managercli.py:2613 - self.server_versions {'candlepin': 'Unknown', 'server-type': 'Unknown'} 2015-11-30 16:50:28,018 [DEBUG] subscription-manager:31788:ServerVersionThread @connection.py:482 - Loaded CA certificates from /etc/rhsm/ca/: candlepin-grimlock.pem, redhat-uep.pem, bundle.pem, ca_bundle.pem 2015-11-30 16:50:28,019 [DEBUG] subscription-manager:31788:ServerVersionThread @connection.py:530 - Making request: GET /candlepin/ 2015-11-30 16:50:28,042 [DEBUG] subscription-manager:31788:ServerVersionThread @connection.py:562 - Response: status=200, requestUuid=31356c8a-97c9-44c5-88be-bf9b57dc8dfb 2015-11-30 16:50:28,043 [DEBUG] subscription-manager:31788:ServerVersionThread @connection.py:805 - Server supports the following resources: {'': '/', 'guestids': '/consumers/{consumer_uuid}/guestids', 'cdn': '/cdn', 'content_overrides': '/consumers/{consumer_uuid}/content_overrides', 'hypervisors': '/hypervisors', 'serials': '/serials', 'deleted_consumers': '/deleted_consumers', 'consumers': '/consumers', 'content': '/content', 'entitlements': '/entitlements', 'consumertypes': '/consumertypes', 'status': '/status', 'jobs': '/jobs', 'users': '/users', 'subscriptions': '/subscriptions', 'rules': '/rules', 'distributor_versions': '/distributor_versions', 'statistics/generate': '/statistics/generate', 'pools': '/pools', 'atom': '/atom', 'owners': '/owners', 'roles': '/roles', 'admin': '/admin', 'events': '/events', 'products': '/products', 'activation_keys': '/activation_keys', 'crl': '/crl'} 2015-11-30 16:50:28,046 [DEBUG] subscription-manager:31788:ServerVersionThread @connection.py:482 - Loaded CA certificates from /etc/rhsm/ca/: candlepin-grimlock.pem, redhat-uep.pem, bundle.pem, ca_bundle.pem 2015-11-30 16:50:28,046 [DEBUG] subscription-manager:31788:ServerVersionThread @connection.py:530 - Making request: GET /candlepin/status 2015-11-30 16:50:28,062 [DEBUG] subscription-manager:31788:ServerVersionThread @connection.py:562 - Response: status=200, requestUuid=4f555cc7-0eeb-4acb-a16b-24b5cdcbe194 2015-11-30 16:50:28,063 [INFO] subscription-manager:31788:ServerVersionThread @managercli.py:368 - Server Versions: {'rules-version': '5.18', 'candlepin': '2.0.9-1', 'server-type': 'Red Hat Subscription Management'} 2015-11-30 16:50:28,084 [ERROR] subscription-manager:31788:MainThread @managercli.py:165 - exception caught in subscription-manager 2015-11-30 16:50:28,084 [ERROR] subscription-manager:31788:MainThread @managercli.py:166 - 'rules-version' Traceback (most recent call last): File "bin/subscription-manager", line 86, in <module> sys.exit(abs(main() or 0)) File "bin/subscription-manager", line 77, in main return managercli.ManagerCLI().main() File "/home/adrian/src/subscription-manager/src/subscription_manager/managercli.py", line 2686, in main return CLI.main(self) File "/home/adrian/src/subscription-manager/src/subscription_manager/cli.py", line 160, in main return cmd.main() File "/home/adrian/src/subscription-manager/src/subscription_manager/managercli.py", line 501, in main return_code = self._do_command() File "/home/adrian/src/subscription-manager/src/subscription_manager/managercli.py", line 2616, in _do_command print (_("subscription management rules: %s") % self.server_versions["rules-version"]) KeyError: 'rules-version' Reverting 315d08e880dd07178722e5b6d2c57268a43fc15d (threading the version check) likely fixes it with the downside of reintroducing 976859 Adding a default value for 'rules-version' also avoid traceback, but also makes version command fail to show the server version when it can eventually. Verifying Version... [root@jsefler-6 ~]# rpm -q subscription-manager python-rhsm subscription-manager-1.16.8-5.el6.x86_64 python-rhsm-1.16.6-1.el6.x86_64 [root@jsefler-6 ~]# rpm -q subscription-manager --changelog | grep 976859 - 976859: Only check server version if asked. (alikins) [root@jsefler-6 ~]# subscription-manager version server type: Red Hat Subscription Management subscription management server: 2.0.10-1 subscription management rules: 5.19 subscription-manager: 1.16.8-5.el6 python-rhsm: 1.16.6-1.el6 VERIFIED: No more traceback when calling subscription-manager version 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. https://rhn.redhat.com/errata/RHBA-2016-0797.html |