Description of problem: Stack trace when cert file missing: [mulhern@dhcp-25-209 ~]$ bkr whoami Traceback (most recent call last): File "/usr/bin/bkr", line 9, in <module> load_entry_point('bkr.client==22.1', 'console_scripts', 'bkr')() File "/usr/lib/python2.7/site-packages/bkr/client/main.py", line 72, in main return cmd.run(*cmd_args, **cmd_opts.__dict__) File "/usr/lib/python2.7/site-packages/bkr/client/commands/cmd_whoami.py", line 56, in run self.set_hub(**kwargs) File "/usr/lib/python2.7/site-packages/bkr/client/__init__.py", line 71, in set_hub proxy_user=proxy_user) File "/usr/lib/python2.7/site-packages/bkr/client/command.py", line 279, in set_hub self.hub = HubProxy(conf=self.conf, auto_login=auto_login) File "/usr/lib/python2.7/site-packages/bkr/common/hub.py", line 57, in __init__ ssl_context.load_verify_locations(cafile=self._conf['CA_CERT']) IOError: [Errno 2] No such file or directory Exception AttributeError: AttributeError("'HubProxy' object has no attribute '_transport'",) in <bound method HubProxy.__del__ of <bkr.common.hub.HubProxy object at 0x7f45c09a6410>> ignored Version-Release number of selected component (if applicable): 22.1 How reproducible: Always. Steps to Reproduce: 1. Don't actually have a file corresponding to CA_CERT variable in comfig. 2. > bkr whoami 3. Observe stack trace. Actual results: Stack trace. Expected results: Something a little more confidence inspiring and perhaps more informative. No AttributeError. Additional info: Note the AttributeError...it seems like the HubProxy object is not fully constructed, so the __del__ method fails. Maybe necessary to be more conservative there.
I can reproduce the problem. If CA_CERT in the configuration points to a non-existing file I run into the same Traceback.
Took a chance of catching this problem before bkr connects to the hub... not sure if I found the right spot. So patch is up http://gerrit.beaker-project.org/5060
This bug fix is included in beaker-client-23.1-0.git.12.aa72972 which is currently available for download here: https://beaker-project.org/nightlies/release-23/
(In reply to wangdong from comment #6) > [root@dhcp-140-87 tmp]# bkr whoami > Traceback (most recent call last): > File "/usr/bin/bkr", line 9, in <module> > load_entry_point('bkr.client==23.1.git.12.aa72972', 'console_scripts', > 'bkr')() > File "/usr/lib/python2.6/site-packages/bkr/client/main.py", line 83, in > main > return cmd.run(*cmd_args, **cmd_opts.__dict__) > File "/usr/lib/python2.6/site-packages/bkr/client/commands/cmd_whoami.py", > line 56, in run > self.set_hub(**kwargs) > File "/usr/lib/python2.6/site-packages/bkr/client/__init__.py", line 73, > in set_hub > proxy_user=proxy_user) > File "/usr/lib/python2.6/site-packages/bkr/client/command.py", line 282, > in set_hub > self.error('CA_CERT configuration points to non-existing file: %s' % > cacert) > AttributeError: 'BeakerCommandContainer' object has no attribute 'error' Just noticed this... This is not the expected result. Looks like a typo, should be self.parser.error() I think. The expected result is a nice error message saying: CA_CERT configuration points to non-existing file: /etc/whatever not a traceback.
*doh My fault for missing this. New patch: https://gerrit.beaker-project.org/#/c/5123/
This bug fix is included in beaker-client-23.2-0.git.12.5a78967 which is currently available for download here: https://beaker-project.org/nightlies/release-23/
Beaker 23.2 has been released.