Bug 1286555 - Python exception when using dnf command
Summary: Python exception when using dnf command
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf-plugin-spacewalk
Version: 23
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1259426 (view as bug list)
Depends On: 1259884 1395864
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-30 09:02 UTC by Michael LE GAL
Modified: 2016-12-20 16:25 UTC (History)
2 users (show)

Fixed In Version: dnf-plugin-spacewalk-2.5.1-1 rhnlib-2.5.78-1 rhn-client-tools-2.5.5-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-20 16:25:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Michael LE GAL 2015-11-30 09:02:00 UTC
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        


How reproducible:


Steps to Reproduce:
1. dnf -y install rhn-set
2. rhnreg_ks --serverUrl=http://myserver/XMLRPC --username=xxx --password=xxx --activationkey=xxxxx


Actual results:
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>
    import up2dateUtils
  File "/usr/share/rhn/up2date_client/up2dateUtils.py", line 11, in <module>
    import up2dateErrors
  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


Expected results:

Server registered


Additional info:

Comment 1 Michael Mráka 2015-11-30 12:42:01 UTC
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.

Comment 2 Michael LE GAL 2015-11-30 13:27:47 UTC
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.
Dependencies resolved.
=======================================================================================================================================
 Package                              Arch                    Version                            Repository                       Size
=======================================================================================================================================
Installing:
 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.

Regards,

Michael LE GAL

Comment 3 Michael LE GAL 2015-11-30 15:45:40 UTC
In fact, after removing std fedora repo in /etc/yum.repos.d, I got the following error:

[root@f23 ~]# rhn-channel --list
fedora23-base-x86_64
fedora23-updates-x86_64
fedora23-server-x86_64

[root@f23 ~]# dnf-2 update
Failed loading plugin: spacewalk
Error: There are no enabled repos.

Best regards,

Michael LE GAL

Comment 4 Michael LE GAL 2015-12-14 16:18:43 UTC
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

Regards,

Michael.

Comment 5 Michael Mráka 2016-01-08 12:10:54 UTC
Fixed in upstream via
commit 3579da38e2efb88cec0f6c5f7f6054b9274a095d
    1259884, 1286555 - make octal numbers python3 compatible
commit ab6e4863537fcce975939872f9daa45979eec65a
    1259884, 1286555 - recover from python3 pickle error when runing back in python2
...
commit 9aad1b15b32fbe877288636bc8dd312bd644a028
    1259884, 1286555 - build python3 version of rhnlib
commit 559ac8941e7e8f09599a168cc5fc706ac2779f10
    1259884, 1286555 - use python3 compatible print syntax

Comment 6 Michael Mráka 2016-02-12 07:14:44 UTC
*** Bug 1259426 has been marked as a duplicate of this bug. ***

Comment 7 Fedora End Of Life 2016-11-24 13:50:21 UTC
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'
of '23'.

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.

Comment 8 Fedora End Of Life 2016-12-20 16:25:50 UTC
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
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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