Fail to import koji.ssl.SSLCommon from python3-koji, then find koji Python 2 and 3 packages have different file list.
koji.ssl.SSLCommon
The problems from following list are
__pycache__/
koji/ssl/
koji/
python2-koji
Koji Version:
$ rpm -q --list python3-koji /usr/lib/python3.5/site-packages/koji /usr/lib/python3.5/site-packages/koji/__init__.py /usr/lib/python3.5/site-packages/koji/c /usr/lib/python3.5/site-packages/koji/__pycache__/__init__.cpython-35.opt-1.pyc /usr/lib/python3.5/site-packages/koji/__pycache__/__init__.cpython-35.pyc /usr/lib/python3.5/site-packages/koji/__pycache__/plugin.cpython-35.opt-1.pyc /usr/lib/python3.5/site-packages/koji/__pycache__/plugin.cpython-35.pyc /usr/lib/python3.5/site-packages/koji/__pycache__/util.cpython-35.opt-1.pyc /usr/lib/python3.5/site-packages/koji/__pycache__/util.cpython-35.pyc /usr/lib/python3.5/site-packages/koji/plugin.py /usr/lib/python3.5/site-packages/koji/util.py /usr/lib/python3.5/site-packages/koji_cli /usr/lib/python3.5/site-packages/koji_cli/__init__.py /usr/lib/python3.5/site-packages/koji_cli/__pycache__ /usr/lib/python3.5/site-packages/koji_cli/__pycache__/__init__.cpython-35.opt-1.pyc /usr/lib/python3.5/site-packages/koji_cli/__pycache__/__init__.cpython-35.pyc /usr/lib/python3.5/site-packages/koji_cli/__pycache__/commands.cpython-35.opt-1.pyc /usr/lib/python3.5/site-packages/koji_cli/__pycache__/commands.cpython-35.pyc /usr/lib/python3.5/site-packages/koji_cli/__pycache__/lib.cpython-35.opt-1.pyc /usr/lib/python3.5/site-packages/koji_cli/__pycache__/lib.cpython-35.pyc /usr/lib/python3.5/site-packages/koji_cli/commands.py /usr/lib/python3.5/site-packages/koji_cli/lib.py $ rpm -q --list python2-koji /usr/lib/python2.7/site-packages/koji /usr/lib/python2.7/site-packages/koji/__init__.py /usr/lib/python2.7/site-packages/koji/__init__.pyc /usr/lib/python2.7/site-packages/koji/__init__.pyo /usr/lib/python2.7/site-packages/koji/auth.py /usr/lib/python2.7/site-packages/koji/auth.pyc /usr/lib/python2.7/site-packages/koji/auth.pyo /usr/lib/python2.7/site-packages/koji/compatrequests.py /usr/lib/python2.7/site-packages/koji/compatrequests.pyc /usr/lib/python2.7/site-packages/koji/compatrequests.pyo /usr/lib/python2.7/site-packages/koji/context.py /usr/lib/python2.7/site-packages/koji/context.pyc /usr/lib/python2.7/site-packages/koji/context.pyo /usr/lib/python2.7/site-packages/koji/daemon.py /usr/lib/python2.7/site-packages/koji/daemon.pyc /usr/lib/python2.7/site-packages/koji/daemon.pyo /usr/lib/python2.7/site-packages/koji/db.py /usr/lib/python2.7/site-packages/koji/db.pyc /usr/lib/python2.7/site-packages/koji/db.pyo /usr/lib/python2.7/site-packages/koji/plugin.py /usr/lib/python2.7/site-packages/koji/plugin.pyc /usr/lib/python2.7/site-packages/koji/plugin.pyo /usr/lib/python2.7/site-packages/koji/policy.py /usr/lib/python2.7/site-packages/koji/policy.pyc /usr/lib/python2.7/site-packages/koji/policy.pyo /usr/lib/python2.7/site-packages/koji/server.py /usr/lib/python2.7/site-packages/koji/server.pyc /usr/lib/python2.7/site-packages/koji/server.pyo /usr/lib/python2.7/site-packages/koji/ssl /usr/lib/python2.7/site-packages/koji/ssl/SSLCommon.py /usr/lib/python2.7/site-packages/koji/ssl/SSLCommon.pyc /usr/lib/python2.7/site-packages/koji/ssl/SSLCommon.pyo /usr/lib/python2.7/site-packages/koji/ssl/SSLConnection.py /usr/lib/python2.7/site-packages/koji/ssl/SSLConnection.pyc /usr/lib/python2.7/site-packages/koji/ssl/SSLConnection.pyo /usr/lib/python2.7/site-packages/koji/ssl/__init__.py /usr/lib/python2.7/site-packages/koji/ssl/__init__.pyc /usr/lib/python2.7/site-packages/koji/ssl/__init__.pyo /usr/lib/python2.7/site-packages/koji/tasks.py /usr/lib/python2.7/site-packages/koji/tasks.pyc /usr/lib/python2.7/site-packages/koji/tasks.pyo /usr/lib/python2.7/site-packages/koji/util.py /usr/lib/python2.7/site-packages/koji/util.pyc /usr/lib/python2.7/site-packages/koji/util.pyo /usr/lib/python2.7/site-packages/koji_cli /usr/lib/python2.7/site-packages/koji_cli/__init__.py /usr/lib/python2.7/site-packages/koji_cli/__init__.pyc /usr/lib/python2.7/site-packages/koji_cli/__init__.pyo /usr/lib/python2.7/site-packages/koji_cli/commands.py /usr/lib/python2.7/site-packages/koji_cli/commands.pyc /usr/lib/python2.7/site-packages/koji_cli/commands.pyo /usr/lib/python2.7/site-packages/koji_cli/lib.py /usr/lib/python2.7/site-packages/koji_cli/lib.pyc /usr/lib/python2.7/site-packages/koji_cli/lib.pyo
Are you importing koji.ssl.SSLCommon directly?? If so, why?
If, otoh, the koji command itself is giving you this error, then please tell us what you did so we can try to replicate it.
Please note that python3 support is currently limited to the client and core portions of the library. So, python3-koji does not include everything that python2-koji does.
Parts of the library that are really only needed by builder or hub code are not yet ported.
Other parts of the library are essentially unportable and will never be available for py3. Notably koji.ssl and the old kerberos auth. Everyone should be using python-requests by now anyway, and folks using python3 will need to rely on gssapi auth for a kerberos based authentication.
koji.ssl
Also note: #467
@mikem rpkg still has code to call ssl_login and catch koji.ssl.SSLCommon.SSL.Error to detect failure.
ssl_login
koji.ssl.SSLCommon.SSL.Error
Does koji raise any its own error when SSL failure from ssl_login? Or, I just need to catch underlying SSL error, and is requests.exceptions.SSLError the one that should be caught?
requests.exceptions.SSLError
ssl_login should work without koji.ssl. Can you provide more detail:
We are planning to remove the old ssl code next release, and currently we only hit that codepath if the requests module is missing or if the use_old_ssl option is enabled. I think you can safely not worry about catching koji.ssl.SSLCommon.SSL.Error anymore.
If you're paranoid, you can wrap the import in a try..except and only catch that exception if it exists (see how we use is_cert_error, is_conn_error, and is_requests_cert_error for examples of that ).
Can we also remove the code that supports python-krbV? That's tripping people up quite a bit, too.
Can we also remove the code that supports python-krbV?
Not anytime soon. The ssl auth is done more or less the same either way, but the old krb auth is completely different from gssapi. Dropping it breaks new clients connecting to old servers and breaks old clients connecting to new servers. I think we need more work on gssapi auth (particularly docs) before we can force krb auth users to change.
@mikem
I got that import error while trying to run rpkg tests in Python 3. I'm using Fedora 25.
ssl relative code is here from line https://pagure.io/rpkg/blob/master/f/pyrpkg/init.py#_343. What it does is trying to catch error of revoked or expired certificate, and then tell user login fails.
I think the part of code handling SSL auth type should be out-dated. For now, how does ssl_login raise error to indicate login failure and the certificate is revoked or expired?
I get answer from is_cert_error and is_requests_cert_error. Thank you very much.
is_cert_error
is_requests_cert_error
Does this resolve your issue then?
Yes. Thank you. I'll close this issue.
Metadata Update from @cqi: - Issue close_status updated to: Invalid - Issue status updated to: Closed (was: Open)
This issue has been migrated to Fedora Forge: https://forge.fedoraproject.org/koji/koji/issues/517
Please continue any further discussion there.