Bug 1259884 - Update rhn-client-tools to python3
Update rhn-client-tools to python3
Status: CLOSED CURRENTRELEASE
Product: Spacewalk
Classification: Community
Component: Clients (Show other bugs)
2.3
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Michael Mráka
Ales Dujicek
:
Depends On:
Blocks: 1259426 1286555 1395864 space27
  Show dependency treegraph
 
Reported: 2015-09-03 13:43 EDT by Michael Mráka
Modified: 2017-09-27 15:02 EDT (History)
8 users (show)

See Also:
Fixed In Version: dnf-plugin-spacewalk-2.5.3-1 rhnlib-2.5.82-1 rhn-client-tools-2.5.11-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1395864 (view as bug list)
Environment:
Last Closed: 2017-09-27 15:02:30 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael Mráka 2015-09-03 13:43:09 EDT
Description of problem:
DNF spacewalk plugin fails on Fedora 23 because rhn-client-tools aren't python3 ready.


Version-Release number of selected component (if applicable):
rhn-client-tools-2.4.5-2.fc23
(dnf-plugin-spacewalk-2.4.15-1.fc23.noarch)

How reproducible:


Steps to Reproduce:
1. dnf install rhn-setup
2.
3.

Actual results:
Failed loading plugin: spacewalk


Expected results:
spacewalk plugin loaded

Additional info:
=> /var/log/dnf.log <==
Sep 02 10:49:58 ERROR Failed loading plugin: spacewalk
Sep 02 10:49:58 SUBDEBUG
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/dnf/plugin.py", line 124, in
import_modules
    module = importlib.import_module(name)
  File "/usr/lib64/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/usr/lib/python3.4/site-packages/dnf-plugins/spacewalk.py", line 34, in
<module>
    import up2date_client.up2dateAuth
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 3, in <module>
    import rhnserver
ImportError: No module named 'rhnserver'
Comment 1 lau18 2015-12-16 14:30:22 EST
This error is preventing any communications with RHN satellite 5.6 as well.
Comment 2 lau18 2015-12-16 21:08:24 EST
(In reply to lau18 from comment #1)
> This error is preventing any communications with RHN satellite 5.6 as well.
Does anyone know when this defect will be resolved?  With the "plugin" failure,  it's preventing dnf command to perform packages retrieval/update via RHN satellite.
Thanks.
Comment 5 Michael Mráka 2016-01-08 07:10:07 EST
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 lau18 2016-01-08 13:01:15 EST
Any idea of when these fixes are ready for public use?
Comment 7 Michael Mráka 2016-01-12 07:18:47 EST
Updated development packages are in nightly repos
(http://yum.spacewalkproject.org/nightly/).
Comment 9 lau18 2016-01-12 13:25:30 EST
Thank you, Michael. 
Would you provide advice to resolve below package update issues.

Current versions on my system for these three packages are following:
dnf-plugin-spacewalk-2.4.15-1.fc23.noarch                              
rhn-client-tools-2.4.5-2.fc23.noarch                                   
rhnlib-2.5.75-2.fc23.noarch 

Downloaded the latest packages from spacewalkproject.org and got below dependency error on python3-rhnlib, which google couldn't find any reference to it.  Please advise on how to overcome this issue:

[root@daemon3 tmp]# dnf update 'dnf-command(localupdate)' ./dnf-plugin-spacewalk-2.5.2-1.fc23.noarch.rpm  ./rhn-client-tools-2.5.7-1.fc23.noarch.rpm
./rhnlib-.5.81-1.fc23.noarch.rpm                                                 
Failed loading plugin: spacewalk                                                                                   
Last metadata expiration check performed 0:16:56 ago on Tue Jan 12 09:49:30 2016.                                  
No match for argument: dnf-command(localupdate)                                                                    
Error: nothing provides python3-rhnlib >= 2.5.78 needed by rhn-client-tools-2.5.7-1.fc23.noarch.                   
nothing provides python3-rhnlib >= 2.5.78 needed by rhn-client-tools-2.5.7-1.fc23.noarch                           
(try to add '--allowerasing' to command line to replace conflicting packages)

Thanks.
Comment 10 Michael Mráka 2016-01-13 03:49:42 EST
I see. I've forgotten to update comps for Fedora 23 client to push python3-rhnlib there. It's been fixed and package should land in the repo sometime today.

In the meanwhile you can download it directly from koji:
http://koji.spacewalkproject.org/koji/buildinfo?buildID=42621
Comment 11 Pavel Studeník 2016-01-13 08:47:39 EST
Hi,
I installed the packages on Fedora 23 and rhnreg_ks, rhn_check doesn't work

# rhn_check
Traceback (most recent call last):
  File "/usr/sbin/rhn_check", line 50, in <module>
    from up2date_client import up2dateErrors
  File "/usr/share/rhn/up2date_client/up2dateErrors.py", line 54, in <module>
    from dnf.exceptions import Error as PmBaseError
ImportError: No module named dnf.exceptions

I have to install this package yet

dnf install python2-dnf
Comment 12 Pavel Studeník 2016-01-13 10:21:31 EST
I tried to install package by webui and it looks that spacewalk plugin was not loaded.

>> rhn_check -vv

>> tail /var/log/up2date
Traceback (most recent call last):
  File "/usr/sbin/rhn_check", line 369, in __run_action
    (status, message, data) = CheckCli.__do_call(method, params, kwargs)
  File "/usr/sbin/rhn_check", line 362, in __do_call
    retval = method(*params, **kwargs)
  File "/usr/share/rhn/actions/packages.py", line 72, in update
    base = _dnf_base(load_system_repo=True, load_available_repos=True)
  File "/usr/share/rhn/actions/packages.py", line 270, in _dnf_base
    plugin = [p for p in base.plugins.plugins if p.name == 'spacewalk'][0]
<type 'exceptions.IndexError'>: list index out of range

I debugged it and variable plugins is empty.

267         if not base.plugins.plugins and base.conf.plugins:
268             base.plugins.load(base.conf.pluginpath, [])
269             base.plugins.run_init(base)

271             plugin = [p for p in base.plugins.plugins if p.name == 'spacewalk'][0]
272             plugin.activate_channels()
273         if load_available_repos:
(Pdb) base.plugins.plugins 
[]

>> rpm -q dnf-plugin-spacewalk
dnf-plugin-spacewalk-2.5.2-1.fc23.noarch
Comment 14 lau18 2016-01-13 16:12:11 EST
After installing rhnlib-2.5.81-1.fc23.noarch.rpm with "rpm -ivh", hit the same error on python3-rhnlib reported previously when installing rhn-client-tools-2.5.8-1.fc23.noarch:

# dnf install rhn-client-tools-2.5.8-1.fc23.noarch
Failed loading plugin: spacewalk
Last metadata expiration check performed 2:02:24 ago on Wed Jan 13 11:06:09 2016.
Error: nothing provides python3-rhnlib >= 2.5.78 needed by rhn-client-tools-2.5.8-1.fc23.noarch
(try to add '--allowerasing' to command line to replace conflicting packages)

I there a proven way to configure a fc23 system that the dnf-plugin would exchange data with rhn satellite server?

Thanks.
Comment 15 lau18 2016-01-13 17:43:33 EST
To clarify the source of the rhnlib* rhn-client*. rhnlib was from koji and rhn-client-tool* from http://yum.spacewalkproject.org/nightly/.  Is there a newer version of rhn-client-tools somewhere else?
Comment 16 lau18 2016-01-13 20:51:33 EST
Michael,

Please ignore the previous two comments that I made as I didn't see the python3-rhnlib at koji link until now. I'll test the package tomorrow and keep you posted of the result.
Comment 17 lau18 2016-01-14 14:05:52 EST
The dependency error seems to have been resolved by including python3-rhnlib as a part of the "dnf" installation.  However, registering with Red Hat satellite server with "rhnreg_ks" (subset of rhn-setup-2.5.8-1.fc23.noarch pkg) is partially failed where it would register with satellite (systemid and up2date are generated) but unable to access channels that are mapped to the "activationkey". Here is the debug-output with the "Invalid function call" error:

[root@daemon2 ~]# /usr/sbin/rhnreg_ks -vvv --force --norhnsd --activationkey=4-fedora-23-x86-64               
D: rpcServer: Calling XMLRPC registration.welcome_message                                                     
D: opening  db environment /var/lib/rpm cdb:0x401                                                             
D: opening  db index       /var/lib/rpm/Packages 0x400 mode=0x0                                               
D: locked   db index       /var/lib/rpm/Packages                                                              
D: rpcServer: Calling XMLRPC registration.welcome_message                                                     
D: opening  db index       /var/lib/rpm/Providename 0x400 mode=0x0                                            
D: rpcServer: Calling XMLRPC registration.new_system                                                          
D: rpcServer: Calling XMLRPC registration.welcome_message                                                     
D: rpcServer: Calling XMLRPC registration.add_hw_profile                                                      
D: rpcServer: Calling XMLRPC registration.welcome_message                                                     
D: rpcServer: Calling XMLRPC registration.add_packages                                                        
D: opening  db environment /var/lib/rpm cdb:0x401                                                             
D: opening  db index       /var/lib/rpm/Packages 0x400 mode=0x0                                               
D: loading keyring from pubkeys in /var/lib/rpm/pubkeys/*.key                                                 
D: couldn't find any keys in /var/lib/rpm/pubkeys/*.key                                                       
D: loading keyring from rpmdb
D: opening  db index       /var/lib/rpm/Name 0x400 mode=0x0
D:  read h#    1939 Header SHA1 digest: OK (44dfac3a3ed2ad52f6139c5313da593614f56803)
D: added key gpg-pubkey-34ec9cba-54e38751 to keyring
D:  read h#    1940 Header SHA1 digest: OK (683edfac165623e8dbc0b62f22e18dc035e03c41)
D: added key gpg-pubkey-863a853d-4f55f54d to keyring
D:  read h#    1941 Header SHA1 digest: OK (b8e59da323c210f9554a1c1dffc3d9b901a2e142)
D: added key gpg-pubkey-b3516aa3-40e58259 to keyring
D:  read h#    1942 Header SHA1 digest: OK (eec341e72036967f588a1b3cbe7cbf8340842eea)
D: added key gpg-pubkey-26c2112f-43ea6bde to keyring
D:  read h#    1943 Header SHA1 digest: OK (f59550c9f7e74d25fb1171b7f1bc15d966d06b40)
D: added key gpg-pubkey-f6777c67-45e5b1b9 to keyring
D: Using legacy gpg-pubkey(s) from rpmdb
D: opening  db index       /var/lib/rpm/Providename 0x400 mode=0x0
D: closed   db index       /var/lib/rpm/Packages
D: closed   db index       /var/lib/rpm/Providename
D: closed   db index       /var/lib/rpm/Name
D: closed   db environment /var/lib/rpm
Warning: yum-rhn-plugin is not present, could not enable it.D: opening  db environment /var/lib/rpm cdb:0x401
D: opening  db index       /var/lib/rpm/Packages 0x400 mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D: opening  db index       /var/lib/rpm/Providename 0x400 mode=0x0
D: do_call packages.checkNeedUpdate('rhnsd=1',){}
D: Attempt to call an unsupported action packages.checkNeedUpdate('rhnsd=1',)
D: local action status: (6, 'Invalid function call attempted', {})
D: rpcServer: Calling XMLRPC registration.welcome_message
D: closed   db index       /var/lib/rpm/Packages
D: closed   db index       /var/lib/rpm/Providename
D: closed   db environment /var/lib/rpm
D: closed   db index       /var/lib/rpm/Packages
D: closed   db index       /var/lib/rpm/Providename
D: closed   db environment /var/lib/rpm
Comment 18 lau18 2016-01-14 14:33:59 EST
Michael,

Also, before enabling the dnf-plugin-spacewalk, command "dnf repolist" returns nothing, no output. However, after setting enable=1 in /etc/dnf/plugins/spacewalk.conf, it caused the same Traceback on both "dnf repplist" and "dnf update" commands as shown below. Should I NOT enable the dnf-plugin-spacewalk?

[root@daemon2 ~]# dnf repolist
Traceback (most recent call last):
  File "/usr/bin/dnf", line 35, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 198, in user_main
    errcode = main(args)                                                         
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 84, in main      
    return _main(base, args)                                                     
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 117, in _main    
    cli.configure(map(ucd, args))                                                
  File "/usr/lib/python3.4/site-packages/dnf/cli/cli.py", line 1040, in configure
    self.base.plugins.run_config()                                               
  File "/usr/lib/python3.4/site-packages/dnf/plugin.py", line 82, in fn          
    dnf.util.mapall(operator.methodcaller(method), self.plugins)                 
  File "/usr/lib/python3.4/site-packages/dnf/util.py", line 157, in mapall       
    return list(map(fn, *seq))                                                   
  File "/usr/lib/python3.4/site-packages/dnf-plugins/spacewalk.py", line 83, in config
    self.activate_channels(self.cli.demands.sack_activation)                          
  File "/usr/lib/python3.4/site-packages/dnf-plugins/spacewalk.py", line 102, in activate_channels
    login_info = up2date_client.up2dateAuth.getLoginInfo(timeout=self.conf.timeout)               
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 230, in getLoginInfo                  
    login(timeout=timeout)                                                                        
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 194, in login                         
    maybeUpdateVersion()                                                                          
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 55, in maybeUpdateVersion             
    dir = path[:string.rfind(path, "/")]                                                          
AttributeError: 'module' object has no attribute 'rfind'
Comment 19 Pavel Studeník 2016-01-14 14:53:23 EST
Comment 18: I received same traceback and wrote patch for this:

https://github.com/spacewalkproject/spacewalk/pull/339
Comment 20 lau18 2016-01-14 20:23:32 EST
Thank you, Pavel.
When dnf-plugin-spacewalk is enabled, I also see the same Traceback as in your comment 11 using rhn-check and rhn-profile-sync:
[root@daemon2 tmp]# rhn-profile-sync
Traceback (most recent call last):
  File "/usr/sbin/rhn-profile-sync", line 23, in <module>
    from up2date_client import up2dateAuth
  File "/usr/share/rhn/up2date_client/up2dateAuth.py", line 14, in <module>
    from up2date_client import clientCaps
  File "/usr/share/rhn/up2date_client/clientCaps.py", line 9, in <module>
    from up2date_client.capabilities import parseCap
  File "/usr/share/rhn/up2date_client/capabilities.py", line 3, in <module>
    from up2date_client import up2dateErrors
  File "/usr/share/rhn/up2date_client/up2dateErrors.py", line 54, in <module>
    from dnf.exceptions import Error as PmBaseError
ImportError: No module named dnf.exceptions

When will your fix on up2dateAuth.py make it in the next version of rhn-client-tools-2.5.8-1.fc23.noarch package?  In other words, when will I be able to get it from the nightly repos (http://yum.spacewalkproject.org/nightly/)?
Comment 21 Michael Mráka 2016-01-19 07:42:11 EST
More python3 related issues fixed in
commit 9dd0ed406e7c8a7461fd868daecd85b3b3ae7138
    python3 http.client.HTTPMessage doesn't lowercase and group same headers
...
commit 496f49118663528623d075fd4adf5d525d0ec096
    FIX: AttributeError: 'module' object has no attribute 'rfind'
Comment 22 lau18 2016-01-19 20:29:16 EST
Michael,

Using the latest versions of  dnf-plugin-spacewalk-2.5.3-1 rhnlib-2.5.82-1 rhn-client-tools-2.5.9-1, rhnreg_ks failed with missing module.  The same command was working with the previous versions of the packages after manually applied the fix in up2dateAuth.py per Pavel suggested in Comment 19:

[root@daemon2 tmp]# /usr/sbin/rhnreg_ks --force --norhnsd --activationkey=4-fedora-23-x86-64
Traceback (most recent call last):
  File "/usr/sbin/rhnreg_ks", line 37, in <module>
    from up2date_client import rhnreg
  File "/usr/share/rhn/up2date_client/rhnreg.py", line 16, in <module>
    from up2date_client import rhnserver
  File "/usr/share/rhn/up2date_client/rhnserver.py", line 34, in <module>
    from rhn.tb import raise_with_tb
ImportError: No module named 'rhn.tb'
Comment 23 Michael Mráka 2016-01-20 03:50:40 EST
Do you have latest version of all packages?
[root@fedora ~]# rpm -q dnf-plugin-spacewalk rhnlib python3-rhnlib  rhn-client-tools rhn-check rhn-setup rhn-setup-gnome
dnf-plugin-spacewalk-2.5.3-1.fc23.noarch
rhnlib-2.5.81-1.git.36.2ac5a69.fc23.noarch
python3-rhnlib-2.5.82-1.fc23.noarch
rhn-client-tools-2.5.9-1.fc23.noarch
rhn-check-2.5.9-1.fc23.noarch
rhn-setup-2.5.9-1.fc23.noarch
package rhn-setup-gnome is not installed

With the above packages it works for me
[root@fedora ~]# /usr/sbin/rhnreg_ks --force --norhnsd  --activationkey  3-fedora23-x86_64 
Warning: information about network interfaces could not be retrieved on this platform.
[root@fedora ~]# rhn-channel -l
fedora23-x86_64
Comment 24 lau18 2016-01-20 13:13:39 EST
I have all but python3-rhnlib-2.5.81-1.fc23.noarch.rpm because I couldn't find version 2.5.82-1 on neither nightly nor koji sites.
Comment 26 Pavel Studeník 2016-01-21 10:02:32 EST
Hi Michael,

The repository nightly-client doesn't contain package rhnlib and this package is needed for work others apps, which are written for python2. For example rhncfg-..

http://yum.spacewalkproject.org/nightly-client/Fedora/23/x86_64/

The repository contains only package python3-rhnlib
Comment 27 lau18 2016-01-21 16:54:37 EST
With the version 2.5.82-1 of python3-rhnlib, rhnreg_ks worked correctly.  With the dnf-plugin-spacewalk enabled, I could see satellite channels and update packages. I have to manually update the /etc/dnf/plugin/spacewalk.conf to enable it.  Shouldn't the default be enabled (i.e. enabled = 1)?

One problem appeared as I executed rhn-channel:

[root@daemon2 plugins]# rhn-channel -l 
An error has occurred:                 
<class 'TypeError'>
See /var/log/up2date for more information

[Thu Jan 21 13:44:15 2016] up2date
Traceback (most recent call last):
  File "/usr/sbin/rhn-channel", line 242, in <module>
    main()
  File "/usr/sbin/rhn-channel", line 226, in main
    list_channels()
  File "/usr/sbin/rhn-channel", line 203, in list_channels
    for channel in sorted(channels):
<class 'TypeError'>: unorderable types: rhnChannel() < rhnChannel()

[Thu Jan 21 13:44:54 2016] up2date
Traceback (most recent call last):
  File "/usr/sbin/rhn-channel", line 242, in <module>
    main()
  File "/usr/sbin/rhn-channel", line 226, in main
    list_channels()
  File "/usr/sbin/rhn-channel", line 203, in list_channels
    for channel in sorted(channels):
<class 'TypeError'>: unorderable types: rhnChannel() < rhnChannel()

Thanks.
Comment 28 lau18 2016-01-27 13:57:42 EST
Any update on the rhn-channel traceback?
Comment 29 Pavel Studeník 2016-01-29 10:13:06 EST
I installed package rhn-setup-2.5.10-1.fc23.noarch and rhn-channel works

# dnf install http://yum.spacewalkproject.org/nightly-client/Fedora/23/x86_64/spacewalk-client-repo-2.5-3.fc23.noarch.rpm

(enable nightly repo)

# dnf install rhn-setup

# rhn-channel -l
fedora-23-x86_64
Comment 30 lau18 2016-01-29 15:45:40 EST
Still see the same TypeError after configured the nightly repo.  Here is a list of rpm from the repo that are installed on the system:

[root@daemon2 yum.repos.d]# rpm -qa|egrep "rhn|spacewalk"
rhn-setup-2.5.10-1.fc23.noarch
rhn-check-2.5.10-1.fc23.noarch
spacewalk-client-repo-2.5-3.fc23.noarch
dnf-plugin-spacewalk-2.5.3-1.fc23.noarch
rhnlib-2.5.83-1.fc23.noarch
rhnsd-5.0.18-1.fc23.x86_64
rhn-client-tools-2.5.10-1.fc23.noarch
python3-rhnlib-2.5.83-1.fc23.noarch

Is one of the rpms out of date or I need to installl more packages?

[root@daemon2 yum.repos.d]# rhn-channel -l
An error has occurred:
<class 'TypeError'>
See /var/log/up2date for more information
[root@daemon2 yum.repos.d]# tail /var/log/up2date
[Fri Jan 29 12:43:29 2016] up2date
Traceback (most recent call last):
  File "/usr/sbin/rhn-channel", line 242, in <module>
    main()
  File "/usr/sbin/rhn-channel", line 226, in main
    list_channels()
  File "/usr/sbin/rhn-channel", line 203, in list_channels
    for channel in sorted(channels):
<class 'TypeError'>: unorderable types: rhnChannel() < rhnChannel()
Comment 31 Pavel Studeník 2016-02-04 07:46:05 EST
It looks rather interesting.

# rhn-channel -l
fedora-23-x86_64

# rpm -qa|egrep "rhn|spacewalk"
rhn-client-tools-2.5.10-1.fc23.noarch
spacewalk-client-repo-2.5-3.fc23.noarch
python3-rhnlib-2.5.83-1.fc23.noarch
dnf-plugin-spacewalk-2.5.3-1.fc23.noarch
rhnsd-5.0.18-1.fc23.x86_64
rhn-setup-2.5.10-1.fc23.noarch
rhn-check-2.5.10-1.fc23.noarch

# diff list.1 list.2 
4a5
> rhnlib-2.5.83-1.fc23.noarch

You can remove rhnlib (or install new from brew)
Comment 32 lau18 2016-02-04 13:21:54 EST
Same TypeError still there after removing the rhnlib-2.5.83-1.fc23.noarch.

Where is "brew" for getting the latest rhnlib?

Thanks.
Comment 33 lau18 2016-02-04 13:25:05 EST
Could the error be that the fact my fc23 is registered with an RHN Satellite 5.6 and you might be talking to a different content server?
Comment 34 Pavel Studeník 2016-02-05 04:26:36 EST
I tried to register fedora23 to Satellite 5.6 and it works correct by me.

And what does the command "dnf repolist" show ? 

>> dnf repolist
This system is receiving updates from Spacewalk server.
Last metadata expiration check performed 0:03:48 ago on Fri Feb  5 04:03:02 2016.
repo id
fedora-23-x86_64 (x86_64)
spacewalk-client-nightly

# rhn-channel -l
fedora-23-x86_64
Comment 35 lau18 2016-02-05 13:19:52 EST
>> dnf repolist
This system is receiving updates from Spacewalk server.
Last metadata expiration check performed 1 day, 0:02:37 ago on Thu Feb  4 10:13:24 2016.
repo id                             repo name                                                             status
fedora-23-updates-x86-64            Fedora Updates (v.23 for 64-bit x86_64)                               36,383
fedora-23-x86_64                    Fedora (v.23 for 64-bit x86_64)                                       46,074
llnl-fedora-23-x86_64               Institutional Software for Fedora (v.23 for 64-bit x86_64)                14
spacewalk-client-nightly            Spacewalk Client Tools nightly                                            23

As I tried -L option, it gave me a different error.  Do these errors provide any clues?

>>[root@daemon2 lau18]# rhn-channel -v -l
An error has occurred:
<class 'TypeError'>
See /var/log/up2date for more information
[root@daemon2 lau18]# tail /var/log/up2date
[Fri Feb  5 10:15:31 2016] up2date
Traceback (most recent call last):
  File "/sbin/rhn-channel", line 242, in <module>
    main()
  File "/sbin/rhn-channel", line 226, in main
    list_channels()
  File "/sbin/rhn-channel", line 203, in list_channels
    for channel in sorted(channels):
<class 'TypeError'>: unorderable types: rhnChannel() < rhnChannel()

>>[root@daemon2 lau18]# rhn-channel -L
An error has occurred:
<class 'io.UnsupportedOperation'>
See /var/log/up2date for more information
[root@daemon2 lau18]# tail /var/log/up2date
  File "/sbin/rhn-channel", line 242, in <module>
    main()
  File "/sbin/rhn-channel", line 232, in main
    list_available_channels(credentials)
  File "/sbin/rhn-channel", line 209, in list_available_channels
    channels = get_available_channels(credentials.user, credentials.password)
  File "/sbin/rhn-channel", line 56, in __getattr__
    tty = open("/dev/tty", "r+")
<class 'io.UnsupportedOperation'>: File or stream is not seekable.

The /dev/tty looked normal to me:
[root@daemon2 lau18]# !ls
ls -l /dev/tty
crw-rw-rw- 1 root tty 5, 0 Feb  5 10:13 /dev/tty
Comment 36 Pavel Studeník 2016-02-09 08:57:50 EST
I found reproducer for the command with "-L". But it different problem

# rhn-channel -L
...
tty = open("/dev/tty", "r+")
<class 'io.UnsupportedOperation'>: File or stream is not seekable.

I crated patch for it - commit f1c844ca224b6a88af3d4679cd8431f916bd4532
Comment 37 Pavel Studeník 2016-02-09 09:56:51 EST
Finally I found the problem of first situation comment 27

# rhn-channel -l
fedora-23-x86_64

# rhn-channel -L
spacewalk-nightly-fedora-23

# rhn-channel -a -c spacewalk-nightly-fedora-23

# rhn-channel -l
<class 'TypeError'>

# /var/log/up2date
  File "/usr/sbin/rhn-channel", line 201, in list_channels
    for channel in sorted(channels):
<class 'TypeError'>: unorderable types: rhnChannel() < rhnChannel()


commit 5a33d6f13a3a1ca25f6c1c4315100241584188aa
Comment 38 lau18 2016-02-09 13:02:21 EST
Pavel,

Not quite sure how to interpret your last comment. Does it mean you have fixed the "TypeError" or you now see the error?

As for the patch that fixed the "/dev/tty", what rpms will I require for the fix?
Comment 39 Michael Mráka 2016-02-12 02:59:21 EST
Issues from comment #36 and #37 fixed in
commit b1a12fc6a395cfc61c4c73f0476c7cf3e7ae4221
    1259884 - fixed missing method for sorting 
commit e6ad99c0f23187cf50036d967ffb94eddd411bab
    1259884 - open terminal for write only
Comment 40 lau18 2016-02-18 18:49:48 EST
The "rhn-channel -l" is working after updated below three packages on my system:
rhn-check-2.5.11-1.fc23.noarch.rpm         
rhn-setup-2.5.11-1.fc23.noarch.rpm
rhn-client-tools-2.5.11-1.fc23.noarch.rpm

Unlike Pavel's example, rhn-channel -L would prompt for user name and password and then didn't output any available channel data:

# rhn-channel -L -v
Username: lau18
Password:

#

Other than that, everything seems to be working.

Thanks.
Comment 41 Ales Dujicek 2016-11-24 10:39:22 EST
I tested Fedora 24 as Spacewalk client:

installation of rhn-setup 
  ok
registration to SW, activation key
  ok
dnf repolist, dnf install from sw repo
  ok
  we know that dnf has some troubles with spacewalk eg. bz1236609
rhn-channel -l, -L, -a , -r
  ok
rhncfg-client diff, get, list, verify
  ok
rhn-actions-control
  ok
rhn-profile-sync
  ok
rhn_check
  ok

spacewalk-abrt
  produces AVC error - created bug bz1398376
  otherwise works

osad
  service does not start - AVC bz1397333
  works in permissive mode


I tried to retest all issues mentioned in previous comments - and it looks ok
issues what I hit are tracked in separate bzs
VERIFIED
Comment 42 Eric Herget 2017-09-27 15:02:30 EDT
Spacewalk 2.7 has been released.

https://github.com/spacewalkproject/spacewalk/wiki/ReleaseNotes27

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