Bug 1033741

Summary: Error in repos dialog. Please see /var/log/rhsm/rhsm.log
Product: Red Hat Enterprise Linux 7 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: John Sefler <jsefler>
Status: CLOSED CURRENTRELEASE QA Contact: John Sefler <jsefler>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.0CC: ckozak, mstead
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 10:06:03 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:
Bug Depends On:    
Bug Blocks: 863175    
Attachments:
Description Flags
expected repo-override gui window after registering without having any subscriptions attached. none

Description John Sefler 2013-11-22 18:27:49 UTC
Description of problem:

I am encountering a traceback in rhsm.log when I click the System/Repositories menu item from the subscription-manager-gui.  Not always reproducible!  See reproducer steps.


Version-Release number of selected component (if applicable):
[root@jsefler-7 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.8.33-1
subscription-manager: 1.10.7-1.el7
python-rhsm: 1.10.6-1.el7


How reproducible:
not always


Steps to Reproduce:
1. You must already have a valid secondary candlepin ca cert in /etc/rhsm/ca/ in additions to the defaults.  In my case, I have...
[root@jsefler-7 ~]# ls /etc/rhsm/ca/
candlepin-stage.pem  jsefler-f14-candlepin.pem  redhat-uep.pem

2. enforce the original default server configurations...
[root@jsefler-7 ~]# subscription-manager config --server.hostname=subscription.rhn.redhat.com --server.port=443 --server.prefix=/subscription

3. start the subscription-manager-gui and click Register and enter your secondary candlpin server url in the "I will register with:" field and get yourself registered.

4. Click System/Repositories

BANG!
Error in repos dialog. Please see /var/log/rhsm/rhsm.log

[root@jsefler-7 ~]# tail -f /var/log/rhsm/rhsm.log
2013-11-22 13:08:53,649 [DEBUG] subscription-manager-gui @connection.py:412 - Loaded CA certificates from /etc/rhsm/ca/: jsefler-f14-candlepin.pem, candlepin-stage.pem, redhat-uep.pem
2013-11-22 13:08:53,651 [DEBUG] subscription-manager-gui @connection.py:444 - Making request: GET /subscription/consumers/354a4712-ed9d-40db-98e2-42bff456f98a/content_overrides
2013-11-22 13:08:54,024 [ERROR] subscription-manager-gui @cache.py:216 - tlsv1 alert unknown ca
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/cache.py", line 211, in load_status
    self._sync_with_server(uep, uuid)
  File "/usr/share/rhsm/subscription_manager/cache.py", line 325, in _sync_with_server
    self.server_status = uep.getContentOverrides(consumer_uuid)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 1058, in getContentOverrides
    return self.conn.request_get(method)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 548, in request_get
    return self._request("GET", method)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 451, in _request
    conn.request(request_type, handler, body=body, headers=headers)
  File "/usr/lib64/python2.7/httplib.py", line 973, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib64/python2.7/httplib.py", line 1007, in _send_request
    self.endheaders(body)
  File "/usr/lib64/python2.7/httplib.py", line 969, in endheaders
    self._send_output(message_body)
  File "/usr/lib64/python2.7/httplib.py", line 829, in _send_output
    self.send(msg)
  File "/usr/lib64/python2.7/httplib.py", line 791, in send
    self.connect()
  File "/usr/lib64/python2.7/site-packages/M2Crypto/httpslib.py", line 58, in connect
    sock.connect((self.host, self.port))
  File "/usr/lib64/python2.7/site-packages/M2Crypto/SSL/Connection.py", line 185, in connect
    ret = self.connect_ssl()
  File "/usr/lib64/python2.7/site-packages/M2Crypto/SSL/Connection.py", line 178, in connect_ssl
    return m2.ssl_connect(self.ssl, self._timeout)
SSLError: tlsv1 alert unknown ca
2013-11-22 13:08:54,029 [ERROR] subscription-manager-gui @cache.py:218 - Consumer certificate is invalid
2013-11-22 13:08:54,030 [ERROR] subscription-manager-gui @utils.py:75 - 'NoneType' object is not iterable
Traceback (most recent call last):
  File "/usr/share/rhsm/subscription_manager/gui/managergui.py", line 332, in _repos_item_clicked
    self.repos_dialog.show()
  File "/usr/share/rhsm/subscription_manager/gui/reposgui.py", line 131, in show
    self._load_data()
  File "/usr/share/rhsm/subscription_manager/gui/reposgui.py", line 136, in _load_data
    current_overrides = self.overrides.get_overrides(self.identity.uuid) or []
  File "/usr/share/rhsm/subscription_manager/overrides.py", line 29, in get_overrides
    return self._build_from_json(self.cache.load_status(self.cp, consumer_uuid))
  File "/usr/share/rhsm/subscription_manager/overrides.py", line 62, in _build_from_json
    return [Override.from_json(override_dict) for override_dict in override_json]
TypeError: 'NoneType' object is not iterable



Additional Notes:
WORKAROUND is to kill the subscription-manager-gui when this happens and restart it.  Then choosing the System/Repositories menu item will work.

Comment 1 Michael Stead 2013-11-26 19:46:27 UTC
This bug has nothing to do with the ca certs themselves and can be reproduced without copying multiple ca certs into /etc/rhsm/ca

By following John's steps from step 2 onward, I am able to reproduce every time without the additional ca cert.

I've found the issue and fix will be in master soon.

Comment 2 Michael Stead 2013-11-27 12:54:00 UTC
Patch waiting on review:

https://github.com/candlepin/subscription-manager/pull/831

Comment 3 Michael Stead 2013-12-02 18:20:24 UTC
Available in:

subscription-manager-1.10.8-1+

Comment 5 John Sefler 2013-12-06 20:39:56 UTC
Created attachment 833769 [details]
expected repo-override gui window after registering without having any subscriptions attached.

Verifying Version...
[root@jsefler-7 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 0.8.33-1
subscription-manager: 1.10.8-1.el7
python-rhsm: 1.10.8-1.el7
[root@jsefler-7 ~]# 
[root@jsefler-7 ~]# ls /etc/rhsm/ca/
candlepin-stage.pem  jsefler-f14-candlepin.pem  redhat-uep.pem
[root@jsefler-7 ~]# subscription-manager config --server.hostname=subscription.rhn.redhat.com --server.port=443 --server.prefix=/subscription
[root@jsefler-7 ~]# subscription-manager-gui&
[1] 12851
[root@jsefler-7 ~]# tail -f /var/log/rhsm/rhsm.log

2013-12-06 15:29:47,853 [DEBUG] subscription-manager-gui @connection.py:412 - Loaded CA certificates from /etc/rhsm/ca/: jsefler-f14-candlepin.pem, candlepin-stage.pem, redhat-uep.pem
2013-12-06 15:29:47,855 [DEBUG] subscription-manager-gui @connection.py:444 - Making request: GET /candlepin/consumers/5158f47c-91ed-4db0-ad8f-81b54f7ea2de/content_overrides
2013-12-06 15:29:48,036 [DEBUG] subscription-manager-gui @connection.py:467 - Response: status=200, requestUuid=3d057e62-5ec6-47d0-9711-da1f2b3ad07c
2013-12-06 15:29:48,040 [DEBUG] subscription-manager-gui @cache.py:284 - Started thread to write cache: /var/lib/rhsm/cache/content_overrides.json
2013-12-06 15:29:48,046 [DEBUG] subscription-manager-gui @connection.py:412 - Loaded CA certificates from /etc/rhsm/ca/: jsefler-f14-candlepin.pem, candlepin-stage.pem, redhat-uep.pem
2013-12-06 15:29:48,048 [DEBUG] subscription-manager-gui @connection.py:444 - Making request: GET /candlepin/
2013-12-06 15:29:48,142 [DEBUG] subscription-manager-gui @connection.py:467 - Response: status=200, requestUuid=55371b80-1a67-4f5d-8f75-13d6c987dc3f
2013-12-06 15:29:48,146 [DEBUG] subscription-manager-gui @connection.py:680 - Server supports the following resources:
2013-12-06 15:29:48,147 [DEBUG] subscription-manager-gui @connection.py:681 - {'': '/', 'cdn': '/cdn', 'content_overrides': '/consumers/{consumer_uuid}/content_overrides', 'hypervisors': '/hypervisors', 'serials': '/serials', 'deleted_consumers': '/deleted_consumers', 'consumers': '/consumers', 'migrations': '/migrations', 'content': '/content', 'entitlements': '/entitlements', 'events': '/events', 'status': '/status', 'jobs': '/jobs', 'users': '/users', 'subscriptions': '/subscriptions', 'rules': '/rules', 'distributor_versions': '/distributor_versions', 'statistics/generate': '/statistics/generate', 'activation_keys': '/activation_keys', 'atom': '/atom', 'owners': '/owners', 'roles': '/roles', 'admin': '/admin', 'products': '/products', 'pools': '/pools', 'consumertypes': '/consumertypes', 'crl': '/crl'}
2013-12-06 15:29:48,149 [DEBUG] subscription-manager-gui @connection.py:412 - Loaded CA certificates from /etc/rhsm/ca/: jsefler-f14-candlepin.pem, candlepin-stage.pem, redhat-uep.pem
2013-12-06 15:29:48,150 [DEBUG] subscription-manager-gui @connection.py:444 - Making request: GET /candlepin/consumers/5158f47c-91ed-4db0-ad8f-81b54f7ea2de/release
2013-12-06 15:29:48,293 [DEBUG] subscription-manager-gui @connection.py:467 - Response: status=200, requestUuid=d81f22ee-0e78-4aac-95f7-ce758b611efb


VERIFIED: No longer encounter "Error in repos dialog. Please see /var/log/rhsm/rhsm.log" when opening the System/Repositories dialog.

Comment 6 Ludek Smid 2014-06-13 10:06:03 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.