Bug 1304436

Summary: unknown error and traceback when the login cert get deleted somehow
Product: Red Hat Update Infrastructure for Cloud Providers Reporter: Irina Gulina <igulina>
Component: ToolsAssignee: RHUI Bug List <rhui-bugs>
Status: CLOSED NEXTRELEASE QA Contact: Vratislav Hutsky <vhutsky>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.0.0CC: jboutaud, pcreech, tsanders
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: 2021-07-23 06:28:53 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:

Description Irina Gulina 2016-02-03 15:44:09 UTC
Description of problem:

If the user is logged into rhui-manager and the cert get deleted somehow, any further user's commands will return an unknown error with a traceback in logs. 


Version-Release number of selected component (if applicable):
>> rpm -qa '*rhui*'
rh-amazon-rhui-client-rhs30-2.2.124-1.el7.noarch
rhui-installer-base-0.0.24-1.el7ui.noarch
rh-rhui-tools-libs-pre.3.0.16-1.el7ui.noarch
rhui-installer-0.0.24-1.el7ui.noarch
rh-rhui-tools-pre.3.0.16-1.el7ui.noarch
rhui-default-ca-1.0-1.noarch
rh-amazon-rhui-client-2.2.118-1.el7.noarch

RHUI ISO 20151013

How reproducible:
always

Steps to Reproduce:
1. open two terminal windows
2. log into rhui-manager in both terminal windows
3. logout in one of them (i.e. the cert will be deleted)
4. try to list the custom repos or make any other request in the second terminal window, get an error and a traceback

Actual results:

An unexpected error has occurred during the last operation.
More information can be found in /root/.rhui/rhui.log.

2016-02-03 10:36:54,435 - <class 'M2Crypto.SSL.SSLError'>
2016-02-03 10:36:54,435 - Unexpected error caught at the shell level
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/rhui/tools/shell.py", line 88, in safe_listen
    self.listen(clear=first_run)
  File "/usr/lib/python2.7/site-packages/rhui/tools/shell.py", line 122, in listen
    Shell.listen(self)
  File "/usr/lib/python2.7/site-packages/rhui/common/shell.py", line 186, in listen
    item.func(*args, **item.kwargs)
  File "/usr/lib/python2.7/site-packages/rhui/tools/screens/repo.py", line 61, in list
    redhat_repos = self.pulp.redhat_repo_list()
  File "/usr/lib/python2.7/site-packages/rhui/tools/pulp_api.py", line 248, in redhat_repo_list
    response = self.repo_group_api.repo_group(GROUP_RED_HAT)
  File "/usr/lib/python2.7/site-packages/pulp/bindings/repo_groups.py", line 93, in repo_group
    return self.server.GET(path)
  File "/usr/lib/python2.7/site-packages/pulp/bindings/server.py", line 91, in GET
    return self._request('GET', path, queries)
  File "/usr/lib/python2.7/site-packages/pulp/bindings/server.py", line 147, in _request
    response_code, response_body = self.server_wrapper.request(method, url, body)
  File "/usr/lib/python2.7/site-packages/pulp/bindings/server.py", line 306, in request
    ssl_context.load_cert(self.pulp_connection.cert_filename)
  File "/usr/lib64/python2.7/site-packages/M2Crypto/SSL/Context.py", line 76, in load_cert
    m2.ssl_ctx_use_cert(self.ctx, certfile)
SSLError: No such file or directory



Expected results:
A helpful message maybe like: "The user certificate wasn't found. Please logout and login again."

Comment 4 Patrick Creech 2016-10-31 17:45:26 UTC
After evaluating the situation, there is a large amount of code changes required at this time to intercept all the places this could happen.  

I'm proposing backlogging this issue until we have a more robust exception handling system in place.