Bug 997637

Summary: rhn-profile-sync throws "exceptions.TypeError: refresh() takes no arguments (1 given)" due to code in rhn-virtualization-host
Product: Red Hat Enterprise Linux 6 Reporter: Stephen Herr <sherr>
Component: rhn-client-toolsAssignee: Milan Zázrivec <mzazrivec>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4CC: cperry, jhutar, lpramuk, mkollar, ndevos, tlestach
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rhn-client-tools-1.0.0.1-11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 919432 Environment:
Last Closed: 2013-11-21 23:15:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 919432    
Bug Blocks:    

Description Stephen Herr 2013-08-15 20:37:27 UTC
+++ This bug was initially created as a clone of Bug #919432 +++

Description of problem:
rhn-profile-sync throws "exceptions.TypeError: refresh() takes no arguments (1 given)" traceback due to code in rhn-virtualization-host.


Version-Release number of selected component (if applicable):
rhn-virtualization-host-5.4.34-4.el5sat
rhn-client-tools-0.4.20-86.el5.noarch


How reproducible:
always


Steps to Reproduce:
1. # rhn-profile-sync


Actual results:
# tail /var/log/up2date
[...]
[Fri Mar  8 00:32:54 2013] up2date successfully retrieved authentication token from up2date server
[Fri Mar  8 00:32:54 2013] up2date Updating package profile
[Fri Mar  8 00:32:59 2013] up2date 
Traceback (most recent call last):
  File "/usr/sbin/rhn-profile-sync", line 54, in ?
    cli.run()
  File "/usr/share/rhn/up2date_client/rhncli.py", line 66, in run
    sys.exit(self.main() or 0)
  File "/usr/sbin/rhn-profile-sync", line 49, in main
    support.refresh(True)
exceptions.TypeError: refresh() takes no arguments (1 given)

[Fri Mar  8 00:33:04 2013] up2date updateLoginInfo() login info
[...]


Expected results:
No traceback in /var/log/up2date and rhn-profile-sync exits with reasonable exit code.

--- Additional comment from Michael Mráka on 2013-03-08 08:06:49 EST ---

Stephen,

this seems to be connected with your commit 75d403e1d5b463635e64336dc466b32b85d980cc.

--- Additional comment from Jan Hutař on 2013-03-08 08:10:41 EST ---

Noticed during investigation of:

/CoreOS/rhn-client-tools/Sanity/investigate-logs
https://beaker.engineering.redhat.com/recipes/817848#task11321896
http://tttt.usersys.redhat.com/Automation/Tests.html#CoreOS_rhn-client-tools_Sanity_investigate-logs

Looks like this change for bug 839776 can be related:

spacewalk.git: 75d403e1d5b463635e64336dc466b32b85d980cc
satellite.git: 9231a402a62349269c1572d33c0069df7129e038

--- Additional comment from Stephen Herr on 2013-03-28 14:38:20 EDT ---

Huh, the rhn-virtualization package appears to not have been updated for RHEL 5. You will run into this error anytime you run rhn-profile-sync with rhn-virtualization installed on a RHEL 5 system. 

We need to update rhn-virtualization and release new rhn-virtualization and rhn-client-tools packages to fix this.

--- Additional comment from Stephen Herr on 2013-03-28 14:54:38 EDT ---

Oh, never mind, I was looking in the wrong place for the rhn-virtualization changes.

So rhn-virtualization should be version rhn-virtualization-5.4.34-3-sat or higher in order to avoid this error, which it is.

rhn-client-tools has correctly conflicted with lower versions of rhn-virtualization since rhn-client-tools-0.4.20-77, so that should be fine too.

I don't understand how you are getting this error if you really have the package versions installed that you say you do. Can you still reproduce the error?

--- Additional comment from Niels de Vos on 2013-04-23 04:23:34 EDT ---

I just hit this Bug on RHEL-6.4 registered to RHN Classic using rhn-client-tools-1.0.0.1-4.el6.noarch. Should this Bug be cloned to RHEL-6.4/rhn-client-tools?

# rhn-profile-sync -v
Updating package profile...
Updating hardware profile...
Updating virtualization profile...
An error has occurred:
<type 'exceptions.TypeError'>
See /var/log/up2date for more information

And in /var/log/up2date:
[Tue Apr 23 10:05:55 2013] up2date updateLoginInfo() login info
[Tue Apr 23 10:05:55 2013] up2date logging into up2date server
[Tue Apr 23 10:05:56 2013] up2date successfully retrieved authentication token from up2date server
[Tue Apr 23 10:05:56 2013] up2date Updating package profile
[Tue Apr 23 10:06:19 2013] up2date 
Traceback (most recent call last):
  File "/usr/sbin/rhn-profile-sync", line 56, in <module>
    cli.run()
  File "/usr/share/rhn/up2date_client/rhncli.py", line 84, in run
    sys.exit(self.main() or 0)
  File "/usr/sbin/rhn-profile-sync", line 51, in main
    support.refresh(True)
<type 'exceptions.TypeError'>: refresh() takes no arguments (1 given)

--- Additional comment from Jan Hutař on 2013-05-29 04:40:23 EDT ---

I do confirm I do see this with (versions taken from various Beaker logs but IIRC we are not doing any updates on the way through that job, so they should be correct):

rhn-client-tools-0.4.20.1-4.noarch
rhn-virtualization-host-5.4.34-5.el5sat.noarch

It is in (RHEL5.10-Server-20130522.2 x86_64):

https://beaker.engineering.redhat.com/recipes/894190#task12762006

--- Additional comment from Stephen Herr on 2013-08-14 15:57:27 EDT ---

I still cannot reproduce:

# rpm -q rhn-client-tools
rhn-client-tools-0.4.20.1-4
# rpm -q rhn-virtualization-host
rhn-virtualization-host-5.4.34-5.el5sat
# rhn-profile-sync -v
Updating package profile...
Updating hardware profile...
Updating virtualization profile...
#

Can someone please verify what the package versions are when they encounter this error?

--- Additional comment from Stephen Herr on 2013-08-14 16:04:11 EDT ---

(In reply to Niels de Vos from comment #5)
> I just hit this Bug on RHEL-6.4 registered to RHN Classic using
> rhn-client-tools-1.0.0.1-4.el6.noarch. Should this Bug be cloned to
> RHEL-6.4/rhn-client-tools?
> 

What version of rhn-virtualization-host do you have installed? If you update it to the latest does that solve the problem?

--- Additional comment from Stephen Herr on 2013-08-15 16:33:59 EDT ---

The problem here, as far as I can see, is that rhn-client-tools does not *correctly* mark itself as conflicting with rhn-virtualization-host.

RHEL 5 and 6 rhn-client-tools have a line in the spec file:
Conflicts: rhn-virtualization < 5.4.34-3

but that should be:
Conflicts: rhn-virtualization-host < 5.4.34-3

In both cases (RHEL 5 and 6) the latest rhn-client-tools works fine with the latest rhn-virtualization-host, so one could make the argument that this bug is already fixed and should be closed currentrelease. However, it would be nice if the packages did not let you install old incompatible versions and get into this situation.

Unfortunately the fix would be to correct rhn-client-tools' conflicts statements, which means this is a RHEL bug against the rhn-client-tools component, not a Satellite bug. I will change components accordingly, and also create a clone for RHEL 6.

Comment 4 Lukas Pramuk 2013-10-29 17:54:59 UTC
VERIFIED. rhn-client-tools-1.0.0.1-16.el6.noarch


REPRO:
# rpm -q --conflicts rhn-client-tools | grep virt 
rhn-virtualization < 5.4.34-3

vs.

FIX:
# rpm -q --conflicts rhn-client-tools | grep virt
rhn-virtualization-host < 5.4.34-3

Comment 5 errata-xmlrpc 2013-11-21 23:15:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1702.html