Bug 580118 - [RFE] krb5 ticket expired traceback
Summary: [RFE] krb5 ticket expired traceback
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: command line
Version: 0.5
Hardware: All
OS: Linux
low
medium
Target Milestone: 0.16
Assignee: Dan Callaghan
QA Contact:
URL:
Whiteboard: CommandLineEnhancement
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-07 14:17 UTC by Chris Ward
Modified: 2018-02-06 00:41 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-03-17 03:01:37 UTC
Embargoed:


Attachments (Terms of Use)

Description Chris Ward 2010-04-07 14:17:50 UTC
Description of problem:

When krb5 credentials have expired, beaker commandline tool fails with a python exception

#####
$> bkr list-labcontrollers
Traceback (most recent call last):
  File "/usr/bin/bkr", line 7, in ?
    sys.exit(
  File "/usr/lib/python2.4/site-packages/bkr/client/main.py", line 32, in main
    return parser.run()
  File "/usr/lib/python2.4/site-packages/kobo/cli.py", line 203, in run
    cmd.run(*cmd_args, **cmd_kwargs)
  File "/usr/lib/python2.4/site-packages/bkr/client/commands/cmd_list_labcontrollers.py", line 20, in run
    self.set_hub(username, password)
  File "/usr/lib/python2.4/site-packages/kobo/client/__init__.py", line 58, in set_hub
    self.hub = HubProxyClass(conf=conf)
  File "/usr/lib/python2.4/site-packages/kobo/client/__init__.py", line 124, in __init__
    self._login(verbose=self._conf.get("DEBUG_XMLRPC"))
  File "/usr/lib/python2.4/site-packages/kobo/client/__init__.py", line 175, in _login
    login_method()
  File "/usr/lib/python2.4/site-packages/kobo/client/__init__.py", line 257, in _login_krbv
    (ac, req) = ctx.mk_req(server=sprinc, client=cprinc, auth_context=ac, ccache=ccache, options=krbV.AP_OPTS_MUTUAL_REQUIRED)
krbV.Krb5Error: (-1765328352, 'Ticket expired')
#####

This exception should be caught and a nicer non-python-exception-traceback should be printed to the screen. ie 'Your kerberos ticket has expired. Please update your credentials by running kinit' or something to that effect



Version-Release number of selected component (if applicable):
beaker.noarch 0:0.5.17-2.el5


Steps to Reproduce:
setup ~/.beaker to use krb5. let your creditials expire. try to run bkr list-labcontrollers (for example). see the ugly traceback

Expected results:
nice, even helpful error message

Comment 1 Bill Peck 2010-04-07 14:29:33 UTC
Adding dmach to the cc list since I believe this comes from kobo.

Daniel,  Any thoughts?

Comment 3 Michal Nowak 2010-06-10 08:22:32 UTC
Similar one comes from `bkr distros-list`. Do we have a fix?

Comment 4 Daniel Mach 2010-06-10 10:47:42 UTC
(In reply to comment #1)
> Adding dmach to the cc list since I believe this comes from kobo.
> 
> Daniel,  Any thoughts?    

Yes it comes from kobo.
You should catch the exception in parser.run() (bkr/client/main.py)
I think masking exceptions directly in kobo is a really bad thing.

Comment 5 Nick Coghlan 2012-10-17 04:35:47 UTC
Bulk reassignment of issues as Bill has moved to another team.

Comment 7 Dan Callaghan 2013-10-14 01:03:25 UTC
(In reply to Daniel Mach from comment #4)
> You should catch the exception in parser.run() (bkr/client/main.py)

Here is a patch to make Beaker do exactly that:

http://gerrit.beaker-project.org/2356

> I think masking exceptions directly in kobo is a really bad thing.

... but (ironically) my patch has no effect because kobo now discards the Kerberos exception from login instead of raising it.

Comment 8 Dan Callaghan 2014-02-20 04:59:54 UTC
We can fix this within Beaker now that we aren't using kobo-client.

Comment 9 Dan Callaghan 2014-02-25 01:28:41 UTC
On Gerrit: http://gerrit.beaker-project.org/2356

Comment 13 Dan Callaghan 2014-03-17 03:01:37 UTC
Beaker 0.16.0 has been released.


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