Bug 810399 - Firstboot crashes when already registered to rhsm
Firstboot crashes when already registered to rhsm
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager (Show other bugs)
6.3
Unspecified Unspecified
unspecified Severity high
: rc
: ---
Assigned To: Adrian Likins
Entitlement Bugs
:
Depends On:
Blocks: 738066
  Show dependency treegraph
 
Reported: 2012-04-05 17:01 EDT by J.C. Molet
Modified: 2012-06-20 09:09 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 09:09:02 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 J.C. Molet 2012-04-05 17:01:13 EDT
Description of problem:
If you had registered subscription-manager before starting firstboot (via cli or in a kickstart) firstboot will throw an exception and crash.

Version-Release number of selected component (if applicable):
subscription-manager-gnome-1.0.0-1.git.2.711e916.el6.x86_64
subscription-manager-firstboot-1.0.0-1.git.2.711e916.el6.x86_64
python-rhsm-1.0.0-1.git.1.873e09b.el6.noarch
subscription-manager-migration-data-1.12.1.2-1.git.0.9e244c8.el6.noarch
subscription-manager-migration-1.0.0-1.git.2.711e916.el6.x86_64
subscription-manager-1.0.0-1.git.2.711e916.el6.x86_64

How reproducible:
always


Steps to Reproduce:
1.  register subscription manager via cli:  subscription-manager register --username=testuser1 --password=password --org=admin 
    or via the appropriate commands in a kickstart postinstall
2.  start firstboot
3.  continue along and select to register with the new rhsm
  
Actual results:
executable:     /usr/bin/python
hashmarkername: firstboot
kernel:         2.6.32-220.4.1.el6.x86_64
reason:         IndexError: list index out of range
time:           Thu 05 Apr 2012 04:33:17 PM EDT

firstboot-tb-TNvyVa: Text file, 42636 bytes

description:
:The following was filed automatically by firstboot:
:firstboot 1.110.11 exception report
:Traceback (most recent call last):
:  File "/usr/lib/python2.6/site-packages/firstboot/interface.py", line 105, in _nextClicked
:    self.advance()
:  File "/usr/lib/python2.6/site-packages/firstboot/interface.py", line 148, in advance
:    result = module.apply(self, self.testing)
:  File "/usr/share/rhn/up2date_client/firstboot/rhn_choose_server_gui.py", line 57, in apply
:    while not interface.moduleList[i].__module__.startswith('rhsm_'):
:IndexError: list index out of range

END:


Expected results:
I would expect this to behave exactly like rhn-classic currently does.  If it detects that you are already registered it doesn't even ask you if you would like to register and just skips to the final entitlement screen.

Additional info:
Comment 1 Adrian Likins 2012-04-09 13:40:43 EDT
The crash is in a rhn module, rhn_choose_server_gui. It is attempting to figure out where the screen after rhsm is, but to do that, it checks to see if rhsm_logging module exists. But the way it checks (looking for rhsm_module python module loaded into python's module path) is a bit of a false positive, since that can be there, even if the module itself isn't in firstboot's module list (which, in this case, it isn't because rhsm_login.shouldAppear is false, because the system is already loaded).

Basically, it's trying to look for the module loaded after rhsm_*, but there are no rhsm_* modules loaded. And I don't really see a good way for rhn_choose_server_gui to detect if the rhsm modules are loaded (at least not
at the time of createScreen which it needs to toggle the "rhn classic" widget).
Comment 2 Adrian Likins 2012-04-09 14:16:05 EDT
what versions of rhn-setup-gnome?
Comment 3 Adrian Likins 2012-04-09 14:24:29 EDT
I was able to reproduce this on a 6.2.x box with an older rhn-setup-gnome, but with a 6.3.x box, it seems to be okay for me.
Comment 4 J.C. Molet 2012-04-10 12:09:24 EDT
Testing this on a freshly built 6.3 box using rhn-setup-gnome-1.0.0-82.el6.noarch

I can see using strace that firstboot now tries to do:

stat("/etc/pki/product", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/etc/pki/entitlement", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/etc/pki/consumer", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0

before it gets to that screen and now skips the entitlement part entirely.


Now the question is this:  shouldn't the latest package of subscription-manager-firstboot now require rhn-setup-gnome with versions >= 1.0.0-82 so people upgrading from rhel 6.2 systems get the right dependency?
Comment 5 Adrian Likins 2012-04-10 13:23:40 EDT
commit d10e51f10d468eabd2e2274a5580d8907f7ed76b
Author: Adrian Likins <alikins@redhat.com>
Date:   Tue Apr 10 12:19:52 2012 -0400

    810399: require the latest rhn-setup-gnome for firstboot
    
    Older versions of rhn-setup-gnome will crash firstboot
    when used with newer subscription-manager-firstboot
Comment 8 J.C. Molet 2012-04-11 11:22:53 EDT
[root@jmolet-vm0 ~]# rpm -qa | grep subscription-manager
subscription-manager-migration-data-1.12.1.2-1.git.2.99d0c10.el6.noarch
subscription-manager-gnome-1.0.0-1.git.11.f42a186.el6.x86_64
subscription-manager-1.0.0-1.git.11.f42a186.el6.x86_64
subscription-manager-migration-1.0.0-1.git.11.f42a186.el6.x86_64
subscription-manager-firstboot-1.0.0-1.git.11.f42a186.el6.x86_64


[root@jmolet-vm0 ~]# rpm -qR subscription-manager-firstboot
librsvg2  
rhn-setup-gnome >= 1.0.0-82
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
subscription-manager-gnome = 1.0.0-1.git.11.f42a186.el6
rpmlib(PayloadIsXz) <= 5.2-1


subscription-manager-firstboot now requires rhn-setup-gnome >= 1.0.0-82

marking VERIFIED.
Comment 10 errata-xmlrpc 2012-06-20 09:09:02 EDT
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-2012-0804.html

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