Bug 915287 - rhn-profile-sync failed with traceback "module object has no attribute utf8_encode" when service libvirtd was stopped
Summary: rhn-profile-sync failed with traceback "module object has no attribute utf8_e...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Client
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Tomas Lestach
QA Contact: Jiří Mikulka
URL:
Whiteboard:
Depends On:
Blocks: sat560-blockers
TreeView+ depends on / blocked
 
Reported: 2013-02-25 11:52 UTC by Pavel Studeník
Modified: 2014-10-06 13:47 UTC (History)
7 users (show)

Fixed In Version: rhn-virtualization-5.4.44-2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-01 19:59:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Pavel Studeník 2013-02-25 11:52:59 UTC
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'

Comment 3 Radek Bíba 2013-04-23 10:26:30 UTC
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...

Comment 4 Tomas Lestach 2013-04-30 12:15:15 UTC
Taking ...

Comment 5 Tomas Lestach 2013-05-03 08:54:48 UTC
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

Comment 8 Clifford Perry 2013-10-01 19:59:35 UTC
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


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