RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 839791 - rhnreg_ks exits with 1 when rhn-virtualization-host installed and libvirtd not running
Summary: rhnreg_ks exits with 1 when rhn-virtualization-host installed and libvirtd no...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: rhn-client-tools
Version: 6.5
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: Stephen Herr
QA Contact: Pavel Studeník
URL:
Whiteboard:
Depends On: 714903 761489 839776
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-12 20:35 UTC by Stephen Herr
Modified: 2013-02-21 10:06 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 839776
Environment:
Last Closed: 2013-02-21 10:06:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0388 0 normal SHIPPED_LIVE rhn-client-tools bug fix and enhancement update 2013-02-20 20:51:47 UTC

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


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