Bug 1472106

Summary: koji fails with: ImportError: Please install python-krbV to use kerberos.
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: kojiAssignee: Mike McLean <mikem>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: dennis, lsedlar, mhroncok, mikem
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-28 07:55:30 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 Florian Weimer 2017-07-18 06:15:45 UTC
Description of problem:

I cannot cancel tasks using the Koji command line interface.

Version-Release number of selected component (if applicable):

koji-1.13.0-2.fc25.noarch
python-krbV-1.0.90-12.fc25.x86_64

How reproducible:

Always.

Steps to Reproduce:
1. koji cancel-task 20584903

Actual results:

ImportError: Please install python-krbV to use kerberos.

(no further output)

Expected results:

Task is canceled.

Comment 1 Florian Weimer 2017-07-27 10:14:50 UTC
Also reproduces with:

koji build --scratch --arch ppc64le f27 /home/fweimer/src/fedora/glibc/glibc-2.25.90-28.fc27.1.src.rpm

I managed to defeat the anti-debugger trapper and got a backtrace:

Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/koji/__init__.py", line 2102, in krb_login
    if self.gssapi_login(proxyuser=proxyuser):
  File "/usr/lib/python3.5/site-packages/koji/__init__.py", line 2216, in gssapi_login
    if not sinfo:
UnboundLocalError: local variable 'sinfo' referenced before assignment

Comment 2 Florian Weimer 2017-07-27 10:44:07 UTC
Unwinding further, this is caused by another exception which is suppressed:

Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/koji/__init__.py", line 2210, in gssapi_login
    sinfo = self._callMethod('sslLogin', [proxyuser], retry=False)
  File "/usr/lib/python3.5/site-packages/koji/__init__.py", line 2419, in _callMethod
    return self._sendCall(handler, headers, request)
  File "/usr/lib/python3.5/site-packages/koji/__init__.py", line 2332, in _sendCall
    return self._sendOneCall(handler, headers, request)
  File "/usr/lib/python3.5/site-packages/koji/__init__.py", line 2377, in _sendOneCall
    r = self.rsession.post(handler, **callopts)
  File "/usr/lib/python3.5/site-packages/requests/sessions.py", line 518, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/usr/lib/python3.5/site-packages/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3.5/site-packages/requests/sessions.py", line 591, in send
    r = dispatch_hook('response', hooks, r, **kwargs)
  File "/usr/lib/python3.5/site-packages/requests/hooks.py", line 31, in dispatch_hook
    _hook_data = hook(hook_data, **kwargs)
  File "/usr/lib/python3.5/site-packages/requests_kerberos/kerberos_.py", line 297, in handle_response
    return self.handle_response(_r, num_401s=num_401s, **kwargs)
  File "/usr/lib/python3.5/site-packages/requests_kerberos/kerberos_.py", line 304, in handle_response
    _r = self.handle_other(response)
  File "/usr/lib/python3.5/site-packages/requests_kerberos/kerberos_.py", line 227, in handle_other
    "{0}".format(response))
requests_kerberos.exceptions.MutualAuthenticationError: Unable to authenticate <Response [200]>

I am pretty sure I have a valid Kerberos ticket for FEDORAPROJECT.ORG, though.

Comment 3 Florian Weimer 2017-07-27 10:44:49 UTC
For submitting builds, submitting tasks through fedpkg seems to be a workaround for now.

Comment 4 Lubomír Sedlář 2017-07-27 12:46:25 UTC
This looks like this upstream issue: https://pagure.io/koji/issue/519

Comment 5 Miro Hrončok 2017-07-28 07:55:30 UTC
Marking this one as a duplicate, because the other one have more comments. Those are different Fedora versions, but apparently, the same problem.

*** This bug has been marked as a duplicate of bug 1472348 ***