Description of problem: I stopped service libvirtd and then registered (or run rhn-profile-sync) system to rhn/satellite. I got error message (good behaviour) to stdout: "libvir: Remote error : unable to connect to '/var/run/libvirt/libvirt-sock-ro'.." and traceback "exceptions.AttributeError" (bad behaviour). System was registered but rhn-profile-sync failed. Problem exists only on RHEL5. Version-Release number of selected component (if applicable): rhn-virtualization-host-5.4.34-4.el5sat redhat-release-5Server-5.9.0.2 How reproducible: Always on RHEL5 with virtualization Steps to Reproduce: 1. Install libvirtd and stop this service >> service libvirtd stop 2. run rhn-profile-sync or register system to sat/rhn Actual results: >> rhn-profile-sync Updating package profile... Updating hardware profile... Updating virtualization profile... libvir: Remote error : unable to connect to '/var/run/libvirt/libvirt-sock-ro', libvirtd may need to be started: No such file or directory An error has occurred: exceptions.AttributeError See /var/log/up2date for more information Expected results: Error message without traceback Additional info: 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) File "/usr/share/rhn/virtualization/support.py", line 62, in refresh if _is_host_domain(fail_on_error): File "/usr/share/rhn/virtualization/support.py", line 190, in _is_host_domain sys.stderr.write(rhncli.utf8_encode(_("Warning: Could not retrieve virtualization information!\n\tlibvirtd service needs to be running.\n"))) exceptions.AttributeError: 'module' object has no attribute 'utf8_encode'
With: - sys.stderr.write(rhncli.utf8_encode(_("Warning: Could not retrieve virtualization information!\n\tlibvirtd service needs to be running.\n"))) + sys.stderr.write("Warning: Could not retrieve virtualization information!\n\tlibvirtd service needs to be running.\n") which prevents the traceback (but may not be the best fix), the error message is still incorrect. It lies: # rhn-profile-sync Updating package profile... Updating hardware profile... Updating virtualization profile... libvir: error : no connection driver available Warning: Could not retrieve virtualization information! libvirtd service needs to be running. An error has occurred: exceptions.TypeError See /var/log/up2date for more information # service libvirtd status libvirtd (pid 12466) is running...
Taking ...
rhncli does not define utf8_encode on RHEL5, so to prevent changing rhn-client-tools package in RHEL5, we're doing the change in RHN Tools package ... spacewalk.git: 4292755b20458f32c71d66466cb93e7767321c35 fixing another issue described in Comment#3 ... spacewalk.git: 253a65a23118522ac81a7de54e0c069ebc4805a1
This bug was fixed with updated packages being released within the RHN Tools channels. RHN Tools (for Sat 5.6 GA) Errata text: https://rhn.redhat.com/errata/RHEA-2013-1391.html