Bug 839791

Summary: rhnreg_ks exits with 1 when rhn-virtualization-host installed and libvirtd not running
Product: Red Hat Enterprise Linux 6 Reporter: Stephen Herr <sherr>
Component: rhn-client-toolsAssignee: Stephen Herr <sherr>
Status: CLOSED ERRATA QA Contact: Pavel Studeník <pstudeni>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.5CC: jhutar, mkollar, pstudeni, tlestach
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 839776 Environment:
Last Closed: 2013-02-21 10:06:45 UTC Type: ---
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: 714903, 761489, 839776    
Bug Blocks:    

Description Stephen Herr 2012-07-12 20:35:17 UTC
+++ This bug was initially created as a clone of Bug #839776 +++

+++ This bug was initially created as a clone of Bug #761489 +++

+++ This bug was initially created as a clone of Bug #714903 +++

Description of problem:
rhnreg_ks exits with 1 when rhn-virtualization-host package is installed and libvirtd is not running. In came situation, rhn-profile-sync exits with 0.


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


How reproducible:
always


Steps to Reproduce:
1. Install rhn-virtualization-host
2. # service libvirtd stop
3. # rhnreg_ks ...


Actual results:
# rhnreg_ks --force --username=<username> --password=<password>
libvir: Remote error : unable to connect to '/var/run/libvirt/libvirt-sock', libvirtd may need to be started: No such file or directory
An error has occurred:
libvirt.libvirtError
See /var/log/up2date for more information
# echo $?
1
# rhn-profile-sync 
Updating package profile...
Updating hardware profile...
Updating virtualization profile...
libvir: Remote error : unable to connect to '/var/run/libvirt/libvirt-sock', libvirtd may need to be started: No such file or directory
Warning: Could not retrieve virtualization information!
	libvirtd service needs to be running.
You have new mail in /var/spool/mail/root
# echo $?
0


Expected results:
Exit code should be 0, as registration utility registered the system. Or maybe exit code of rhn-profile-sync should be 1.

--- Additional comment from mkollar on 2012-01-04 06:01:42 EST ---

There is also a side effect, that traceback appears in /var/log/up2date:

Traceback (most recent call last):
  File "/usr/sbin/rhnreg_ks", line 227, in ?
    cli.run()
  File "/usr/share/rhn/up2date_client/rhncli.py", line 66, in run
    sys.exit(self.main() or 0)
  File "/usr/sbin/rhnreg_ks", line 178, in main
    rhnreg.sendVirtInfo(systemId)
  File "/usr/share/rhn/up2date_client/rhnreg.py", line 674, in sendVirtInfo
    support.refresh()
  File "/usr/share/rhn/virtualization/support.py", line 51, in refresh
    if _is_host_domain():
  File "/usr/share/rhn/virtualization/support.py", line 161, in _is_host_domain
    conn = libvirt.open(None)
  File "/usr/lib64/python2.4/site-packages/libvirt.py", line 169, in open
    if ret is None:raise libvirtError('virConnectOpen() failed')

--- Additional comment from jhutar on 2012-01-18 07:59:09 EST ---

Looks like this is not an issue with rhn-virtualization-host-5.4.14-8.el5sat.

--- Additional comment from jhutar on 2012-01-24 04:29:32 EST ---

Package rhn-virtualization-host-5.4.14-8.el5sat do *not* fix issue with rhn-profile-sync which still returns 0 even after it is unable to update virtualization profile.

--- Additional comment from mkollar on 2012-02-20 02:38:40 EST ---

After fixing this bug might be good idea to walk through our tests, search for 761489, and remove workarounds.

--- Additional comment from pm-rhel on 2012-04-02 06:51:44 EDT ---

This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

--- Additional comment from sherr on 2012-07-12 15:53:53 EDT ---

Confirmed that latest rhn-virtualization-host package makes rhnreg_ks exit with exit status 0 and that rhn-profile-sync still exits with exit status 0 even though it should not (see discussion in bug 714903).

--- Additional comment from sherr on 2012-07-12 16:16:23 EDT ---

Committed to Spacewalk master: 75d403e1d5b463635e64336dc466b32b85d980cc
Note that this relies on rhn-virtualization-5.4.37-1 being released before rhn-client-tools-1.8.13-1.

Comment 1 Stephen Herr 2012-07-12 20:43:04 UTC
Cherry-picked into CLIENT-RHEL-6:
42e61872c5d76998f3a42a008eda435cc38e27f4
and 
b9b908b4f8e87411140f5bec83d21cf7958f8406

Comment 7 errata-xmlrpc 2013-02-21 10:06:45 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-0388.html