Red Hat Bugzilla – Bug 1286555
Python exception when using dnf command
Last modified: 2016-12-20 11:25:50 EST
Description of problem:
I'm using Spacewalk to manage my Fedora/Centos assets. Since the introduction of DNF in fedora 22 a special plugin 'DNF for spacewalk' has been introduced.
I try to use it but gives me a python exception when I want to register my host to the spacewalk server:
Version-Release number of selected component (if applicable):
dbus-python.x86_64 1.2.0-12.fc23 dnf-plugin-spacewalk.noarch 2.4.15-1.fc23 gnupg.x86_64 1.4.19-3.fc23
libusb.x86_64 1:0.1.5-6.fc23 newt-python.x86_64 0.52.18-3.fc23 pyOpenSSL.noarch 0.15.1-1.fc23
python-cffi.x86_64 1.1.2-3.fc23 python-cryptography.x86_64 1.0.2-2.fc23 python-dmidecode.x86_64 3.12.2-1.fc23
python-enum34.noarch 1.0.4-2.fc23 python-ethtool.x86_64 0.11-5.fc23 python-gobject-base.x86_64 3.18.2-1.fc23
python-hwdata.noarch 1.10.1-4.fc23 python-idna.noarch 2.0-1.fc23 python-ipaddress.noarch 1.0.7-4.fc23
python-libxml2.x86_64 2.9.3-1.fc23 python-ply.noarch 3.6-2.fc23 python-pyasn1.noarch 0.1.8-1.fc23
python-pycparser.noarch 2.14-3.fc23 python-six.noarch 1.9.0-3.fc23 rhn-check.noarch 2.4.5-2.fc23
rhn-client-tools.noarch 2.4.5-2.fc23 rhn-setup.noarch 2.4.5-2.fc23 rhnlib.noarch 2.5.75-2.fc23
rhnsd.x86_64 5.0.15-2.fc23 rpm-python.x86_64 4.13.0-0.rc1.7.fc23
Steps to Reproduce:
1. dnf -y install rhn-set
2. rhnreg_ks --serverUrl=http://myserver/XMLRPC --username=xxx --password=xxx --activationkey=xxxxx
Traceback (most recent call last):
File "/sbin/rhnreg_ks", line 33, in <module>
from up2date_client import rhnreg
File "/usr/share/rhn/up2date_client/rhnreg.py", line 14, in <module>
File "/usr/share/rhn/up2date_client/up2dateUtils.py", line 11, in <module>
File "/usr/share/rhn/up2date_client/up2dateErrors.py", line 49, in <module>
from dnf.exceptions import Error as PmBaseError
ImportError: No module named dnf.exceptions
This is because dnf on Fedora 23 is python3 based by default while spacewalk client libraries (rhn-client-tools) are python2 based.
See bug #1259884.
You may workaround this by installing python2-dnf-1.1.4-1.fc23.noarch
and running dnf-2.
Michael, spacewalk registration works well with that workaround but dnf (dnf-2) is still sending a warning related to spacewalk plugin:
[root@f23 ~]# dnf-2 -y install krb5-devel pam_krb5 krb5-libs krb5-workstation Failed loading plugin: spacewalk Last metadata expiration check performed 0:07:59 ago on Mon Nov 16 16:12:24 2015.
Package pam_krb5-2.4.9-5.fc23.x86_64 is already installed, skipping.
Package krb5-libs-1.13.2-13.fc23.x86_64 is already installed, skipping.
Package Arch Version Repository Size
keyutils-libs-devel x86_64 1.5.9-7.fc23 fedora 45 k
krb5-devel x86_64 1.13.2-13.fc23 fedora-updates 648 k
krb5-workstation x86_64 1.13.2-13.fc23 fedora-updates 774 k
libcom_err-devel x86_64 1.42.13-3.fc23 fedora 35 k
Anyway, package installation works well.
Michael LE GAL
In fact, after removing std fedora repo in /etc/yum.repos.d, I got the following error:
[root@f23 ~]# rhn-channel --list
[root@f23 ~]# dnf-2 update
Failed loading plugin: spacewalk
Error: There are no enabled repos.
Michael LE GAL
Error message when registering a host:
/usr/share/rhn/up2date_client/hardware_gudev.py:16: PyGIWarning: GUdev was imported without specifying a version first. Use gi.require_version('GUdev', '1.0') b from gi.repository import GUdev
Failed loading plugin: spacewalk
Fixed in upstream via
1259884, 1286555 - make octal numbers python3 compatible
1259884, 1286555 - recover from python3 pickle error when runing back in python2
1259884, 1286555 - build python3 version of rhnlib
1259884, 1286555 - use python3 compatible print syntax
*** Bug 1259426 has been marked as a duplicate of this bug. ***
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora 'version'
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.
Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 23 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
Thank you for reporting this bug and we are sorry it could not be fixed.