This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 372771 - After upgrade to RHEL 5.1, rhn_register against Satellite fails
After upgrade to RHEL 5.1, rhn_register against Satellite fails
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rhn-client-tools (Show other bugs)
5.1
All Linux
urgent Severity medium
: rc
: ---
Assigned To: Pradeep Kilambi
: ZStream
Depends On:
Blocks: 382571
  Show dependency treegraph
 
Reported: 2007-11-09 09:27 EST by Jan Pazdziora
Modified: 2008-05-21 12:51 EDT (History)
4 users (show)

See Also:
Fixed In Version: RHBA-2008-0362
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-21 12:51:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Jan Pazdziora 2007-11-09 09:27:11 EST
Description of problem:

After upgrading my RHEL 5 GA to RHEL 5.1, rhn_register fails.

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

rhn-setup-0.4.16-1.el5

How reproducible:

Deterministic.

Steps to Reproduce:
1. Install RHEL 5 GA.
2. Register to RHN Satellite.
3. Upgrade to RHEL 5.1.
4. Try to re-register, running rhn_register.
5. Confirm Yes, Continue on the first page.
  
Actual results:

An error has occurred:
                      exceptions.TypeError
                                          See /var/log/up2date for more information

and the log file has

[Fri Nov  9 14:58:31 2007] rhn_register 
Traceback (most recent call last):
  File "/usr/sbin/rhn_register", line 79, in ?
    app.run()
  File "/usr/share/rhn/up2date_client/rhncli.py", line 65, in run
    sys.exit(self.main() or 0)
  File "/usr/sbin/rhn_register", line 64, in main
    ui.main()
  File "/usr/share/rhn/up2date_client/tui.py", line 1850, in main
    tui = Tui(screen)
  File "/usr/share/rhn/up2date_client/tui.py", line 1556, in __init__
    self.serverType = rhnreg.getServerType()
  File "/usr/share/rhn/up2date_client/rhnreg.py", line 643, in getServerType
    if host in ['xmlrpc.rhn.redhat.com', 'rhn.redhat.com'] or \
exceptions.TypeError: iterable argument required

in it.

Expected results:

No error, nice registration (re-registration).

Additional info:
Comment 1 Jan Pazdziora 2007-11-09 09:34:19 EST
The faulty code in rhnreg.py is:

    hosted_whitelist = cfg['hostedWhitelist']

    if host in ['xmlrpc.rhn.redhat.com', 'rhn.redhat.com'] or \
       host in hosted_whitelist:
        return 'hosted'
    else:
        return 'satellite'

It assumes there is this option hostedWhitelist specified in
/etc/sysconfig/rhn/up2date. Which it is for new installations and normal
upgrades, but not if you've kickstarted your RHEL 5 GA from Satellite or changed
the up2date file -- the new one is then created as up2date.rpmnew.
Comment 2 RHEL Product and Program Management 2007-11-09 09:34:31 EST
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 3 RHEL Product and Program Management 2007-11-09 09:35:32 EST
This bugzilla has Keywords: Regression.  

Since no regressions are allowed between releases, 
it is also being proposed as a blocker for this release.  

Please resolve ASAP.
Comment 4 Jan Pazdziora 2007-11-09 09:38:16 EST
So, we have workaround -- add 

hostedWhitelist=

to /etc/sysconfig/rhn/up2date.

Lowering Priority to high.
Comment 5 Jan Pazdziora 2007-11-09 09:39:29 EST
And we need to apply patch similar to the following one to the code:

--- /usr/share/rhn/up2date_client/rhnreg.py.orig        2007-11-09
15:10:01.000000000 -0500
+++ /usr/share/rhn/up2date_client/rhnreg.py     2007-11-09 15:11:09.000000000 -0500
@@ -641,7 +641,7 @@
     hosted_whitelist = cfg['hostedWhitelist']
     
     if host in ['xmlrpc.rhn.redhat.com', 'rhn.redhat.com'] or \
-       host in hosted_whitelist:
+       hosted_whitelist is not None and host in hosted_whitelist:
         return 'hosted'
     else:
         return 'satellite'
Comment 7 Pradeep Kilambi 2007-11-09 11:06:30 EST
Ok reproduced the issue on a freshly installed RHEL 5 GA client.

From my tests looks like the issue occurs only when the client is trying to
register to satellites. rhn_register and rhnreg_ks work fine against hosted. I
applied the above patch and re tried and things seems to be working well now
against sat as well as hosted..

- rhn_register works as expected against hosted and satellites (with Jan's patch)

- rhnreg_ks works as expected against hosted and satellites.

I think we can go ahead with the patch Jan proposed here.. 

Comment 9 Pradeep Kilambi 2007-11-13 14:57:58 EST
can we get 5.1.z flag set for this as soon as possible. We need that to create
the z-stream branch for 5.1.z
Comment 11 Pradeep Kilambi 2007-12-04 14:02:40 EST
test plan:

1. grab a freshly kickstarted RHEl-5 GA

2. rhn_register against satellite

3. Should not through any exception and register successfully
Comment 12 Jan Pazdziora 2007-12-04 14:59:09 EST
Ummm. The test plan should continue.

4. Upgrade your RHEL 5 with all the latest erratas.

5. Try to re-rhn_register the system to that Satellite.

It's the second rhn_register which failed, for package shipped in RHEL 5.1.
Comment 16 errata-xmlrpc 2008-05-21 12:51:10 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0362.html

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