Bug 1331494 - warning message when dnf-plugin-spacewalk is used
Summary: warning message when dnf-plugin-spacewalk is used
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Clients
Version: 2.4
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Ondrej Gajdusek
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
: 1391582 1409333 (view as bug list)
Depends On:
Blocks: spacewalk-review space27
TreeView+ depends on / blocked
 
Reported: 2016-04-28 16:32 UTC by Slava
Modified: 2017-09-27 19:08 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-09-27 19:08:41 UTC
Embargoed:


Attachments (Terms of Use)
DNF log (34.91 KB, text/plain)
2016-04-28 16:42 UTC, Slava
no flags Details
DNF upgraded vm log (2.77 KB, text/plain)
2016-04-28 16:54 UTC, Slava
no flags Details
DNF log update (79.81 KB, text/plain)
2016-05-09 14:45 UTC, Slava
no flags Details
DNF messages log (2.47 KB, text/plain)
2016-05-09 15:45 UTC, Slava
no flags Details

Description Slava 2016-04-28 16:32:12 UTC
Description of problem:
When register with in spacewalk on fedora 22 with rhnreg_ks warning message is show up 

Warning: yum-rhn-plugin is not present, could not enable it.Librepo version: 1.7.16 with CURL_GLOBAL_ACK_EINTR support (libcurl/7.40.0 NSS/3.18 Basic ECC zlib/1.2.8 libidn/1.29 libssh2/1.5.0)

 

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

[root@ca01ts00-client192 ~]# rpm -qa | grep dnf
dnf-plugin-spacewalk-2.4.15-1.fc22.noarch

How reproducible:
always on fedora 22 and dnf

Steps to Reproduce:
1. install fedora 22
2. register system to spacewalk with command rhnreg_ks


Actual results:

[root@ca01ts00-client192 ~]# rhnreg_ks --serverUrl=https://spacewalkproxy.com/XMLRPC --sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT --activationkey=2-F22-default-yum-repository --force


Expected results:
Working registration.


Additional info:
related bug report:

https://bugzilla.redhat.com/show_bug.cgi?id=1229376

Comment 1 Slava 2016-04-28 16:42:06 UTC
Also might be related that dnf can't pull any repository metadata. Look like it breaks registration, because we have vm's which upgraded from 21 to 22 and they was previously registered to spacewalk and we don't see any issues on them dnf works ok, only new f22 installations are affected. See attached dnf log

Comment 2 Slava 2016-04-28 16:42:30 UTC
Created attachment 1151949 [details]
DNF log

Comment 3 Slava 2016-04-28 16:54:21 UTC
Please attached log from vm which was upgraded from 21 to 22.

Comment 4 Slava 2016-04-28 16:54:49 UTC
Created attachment 1151953 [details]
DNF upgraded vm log

Comment 5 Slava 2016-05-04 15:39:00 UTC
Hello Everyone,
Is possible at least get some help to understand sense of the issue and what possible fixes or workaround. I know that it is no real SLA in Open Source projects, but we ready do some contribution to get issue checked that we can unblock our project.

Thank you for any help.

Comment 6 Tomáš Kašpárek 2016-05-09 09:24:00 UTC
Hello Slava,

this should be fixed in spacewalk client nightly repositories.

To enable spacewalk-client nightly repositories please run:
rpm -Uvh http://yum.spacewalkproject.org/nightly-client/Fedora/22/x86_64/spacewalk-client-repo-2.5-3.fc22.noarch.rpm
sed -i 's/enabled=0/enabled=1/' /etc/yum.repos.d/spacewalk-client-nightly.repo
sed -i 's/enabled=1/enabled=0/' /etc/yum.repos.d/spacewalk-client.repo

I didn't see the problem you've encountered while I was using nightly repositories, could you please try that and let me know whether it fixes your problem?

Thanks,
Tomas

Comment 7 Slava 2016-05-09 14:45:18 UTC
Hello Everyone,
I tried upgrade to version dnf-plugin-spacewalk-2.5.5-1.fc22.noarch from night repo and result the same. Please see attached dnf log

Comment 8 Slava 2016-05-09 14:45:48 UTC
Created attachment 1155356 [details]
DNF log update

Comment 9 Slava 2016-05-09 15:44:34 UTC
I so some python exception, please see attached log.

Comment 10 Slava 2016-05-09 15:45:14 UTC
Created attachment 1155393 [details]
DNF messages log

Comment 11 Tomáš Kašpárek 2016-05-10 12:38:02 UTC
Hello,

unfortunately with spacewalk-client-nightly repositories I am not able to reproduce either:

Warning: yum-rhn-plugin is not present, could not enable it.

during registration and I am also able to run 'dnf makecache' as mentioned in comment#10.
Could you please provide me some pointers so I am able to reproduce the issue you're encountering as currently everything works for me just fine.

Comment 12 Slava 2016-05-10 13:15:41 UTC
Hello,
All our registrations going through spacewalk proxy.  We registering with command, which point to spacewalk proxy. 

rhnreg_ks --serverUrl=https://ca01sprx00.adm.qa/XMLRPC --sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT --activationkey=2-F22-default-yum-repository  

And get this error

[root@ca01ts00-client192 ~]# dnf makecache
Traceback (most recent call last):
  File "/usr/bin/dnf", line 36, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 185, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 84, in main
    return _main(base, args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 134, in _main
    cli.run()
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1077, in run
    return self.command.run(self.base.extcmds)
  File "/usr/lib/python2.7/site-packages/dnf/cli/commands/makecache.py", line 87, in run
    self.base.fill_sack() # performs the md sync
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 238, in fill_sack
    self._add_repo_to_sack(r.id)
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 100, in _add_repo_to_sack
    repo.load()
  File "/usr/lib/python2.7/site-packages/dnf/repo.py", line 783, in load
    handle = self._handle_new_remote(tmpdir)
  File "/usr/lib/python2.7/site-packages/dnf-plugins/spacewalk.py", line 267, in _handle_new_remote
    self.add_http_headers(handle)
  File "/usr/lib/python2.7/site-packages/dnf-plugins/spacewalk.py", line 250, in add_http_headers
    if not header in self.login_info:
TypeError: argument of type 'NoneType' is not iterable

Comment 13 Slava 2016-05-10 13:50:09 UTC
Here some exception which might help to find the issue. In this case the repository adm-fc22-certs-qa don't have any rpm 


[root@ca01ts00-client192 Python-2016-04-28-09:03:53-28998]# cat backtrace
spacewalk.py:249:add_http_headers:AttributeError: 'NoneType' object has no attribute 'has_key'

Traceback (most recent call last):
  File "/usr/bin/dnf", line 36, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 185, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 84, in main
    return _main(base, args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 134, in _main
    cli.run()
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1077, in run
    return self.command.run(self.base.extcmds)
  File "/usr/lib/python2.7/site-packages/dnf/cli/commands/makecache.py", line 87, in run
    self.base.fill_sack() # performs the md sync
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 238, in fill_sack
    self._add_repo_to_sack(r.id)
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 100, in _add_repo_to_sack
    repo.load()
  File "/usr/lib/python2.7/site-packages/dnf/repo.py", line 783, in load
    handle = self._handle_new_remote(tmpdir)
  File "/usr/lib/python2.7/site-packages/dnf-plugins/spacewalk.py", line 266, in _handle_new_remote
    self.add_http_headers(handle)
  File "/usr/lib/python2.7/site-packages/dnf-plugins/spacewalk.py", line 249, in add_http_headers
    if not self.login_info.has_key(header):
AttributeError: 'NoneType' object has no attribute 'has_key'

Local variables in innermost frame:
header: u'X-RHN-Server-Id'
self: <SpacewalkRepo adm-fc22-certs-qa>
handle: <dnf.repo._Handle object at 0x7fbbba9e46e0>
http_headers: []

Comment 14 Pavel Studeník 2016-05-10 14:09:37 UTC
It looks as old package. I installed package dnf-plugin-spacewalk from nightly repo [1]:

>> rpm -qf /usr/lib/python2.7/site-packages/dnf-plugins/spacewalk.py
dnf-plugin-spacewalk-2.5.5-1.fc22.noarch

>> vim /usr/lib/python2.7/site-packages/dnf-plugins/spacewalk.py
        ...
        for header in self.needed_headers: 
            if not header in self.login_info:  # <<<<<<<<
                error = MISSING_HEADER % header 
                raise dnf.Error.RepoError(error) 

[1] http://yum.spacewalkproject.org/nightly-client/Fedora/22/x86_64/

Comment 15 Slava 2016-05-10 14:19:47 UTC
That what we have installed.

[root@ca01ts00-client192 abrt]# rpm -qa | grep dnf
python-dnf-plugins-core-0.1.8-1.fc22.noarch
python-dnf-1.0.0-1.fc22.noarch
python-dnf-plugins-extras-migrate-0.0.7-1.fc22.noarch
dnf-conf-1.0.0-1.fc22.noarch
python-dnf-plugins-extras-common-0.0.7-1.fc22.noarch
dnf-plugin-spacewalk-2.5.5-1.fc22.noarch           >>>>>>>>>>>>>> Here the same verrsion
dnf-yum-1.0.0-1.fc22.noarch
dnf-langpacks-0.9.1-1.fc22.noarch
dnf-plugins-core-0.1.8-1.fc22.noarch
dnf-1.0.0-1.fc22.noarch

Comment 16 Slava 2016-05-10 14:23:11 UTC
My colleague bryan did some  investigation to help find the issue here his comment.



     def add_http_headers(self, handle):
        http_headers = []
        if not self.login_info:
            logger.error("%s\n%s", NOT_REGISTERED_ERROR, RHN_DISABLED)
            self.login_info = opts.get('login_info')
 we added the following :

    def add_http_headers(self, handle):
        http_headers = []
        if not self.login_info:
            logger.error("%s\n%s", NOT_REGISTERED_ERROR, RHN_DISABLED)
            return
    def add_http_headers(self, handle):
        http_headers = []
        # we added this code which gets rid of the exception
        if not self.login_info:
            logger.error("%s\n%s", NOT_REGISTERED_ERROR, RHN_DISABLED)
            return


however, because self.login_info is None, we cannot retrieve the repository metadata

Comment 17 Slava 2016-05-10 14:33:05 UTC
Small correction from Bryan

def add_http_headers(self, handle):
        http_headers = []

        # we added this code bellow which gets rid of the exception <<<<

        if not self.login_info:
            logger.error("%s\n%s", NOT_REGISTERED_ERROR, RHN_DISABLED)
            return


however, because self.login_info is None, we cannot retrieve the repository metadata

Comment 18 Slava 2016-05-19 13:44:11 UTC
Hello Everyone,
I just want to know if provided information was useful and if any progress was made on issue ?

Comment 19 Pavel Studeník 2016-12-05 14:19:47 UTC
New packages are available in Spacewalk repository. http://yum.spacewalkproject.org/2.6-client/

I don't see this warning on system during registration.

Comment 20 Fermulator 2016-12-31 21:53:53 UTC
I'm running the latest client packages (just installed late-this month), and ran into the same issue still.

https://bugzilla.redhat.com/show_bug.cgi?id=1409333

Comment 21 Ondrej Gajdusek 2017-06-13 17:46:09 UTC
I am using dnf-plugin-spacewalk-2.7.7-1.fc24.noarch (latest nightly version) and I am not able to reproduce this with running dnf makecache. 
It needs to be underlined that we are building packages only for Fedora 24 and 25 at this moment. So if you are trying to download the latest package for Fedora 22 which is dnf-plugin-spacewalk-2.5.8-1.fc22.noarch you will probably run into this issue.
As Tomas Mentioned in comment 11 and Pavel mentioned in comment 14 it looks you are using old package.
Fermulator, yes if you are using dnf-plugin-spacewalk-2.6.3-1.fc24.noarch which is the latest stable version, you will surely run into this issue. Try to install nightly packages, it should fix this problem.

Comment 22 Ondrej Gajdusek 2017-06-13 17:49:42 UTC
*** Bug 1409333 has been marked as a duplicate of this bug. ***

Comment 24 Ondrej Gajdusek 2017-08-27 12:11:19 UTC
*** Bug 1391582 has been marked as a duplicate of this bug. ***

Comment 25 Eric Herget 2017-09-27 19:08:41 UTC
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.