Bug 237310 - Repeated erros from /usr/share/rhn/virtualization/poller.py
Summary: Repeated erros from /usr/share/rhn/virtualization/poller.py
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Virtualization (Show other bugs)
(Show other bugs)
Version: 500
Hardware: i386 Linux
Target Milestone: ---
Assignee: Pradeep Kilambi
QA Contact: Brandon Perkins
Depends On:
Blocks: 232034
TreeView+ depends on / blocked
Reported: 2007-04-20 18:57 UTC by John Barton
Modified: 2007-10-24 02:15 UTC (History)
2 users (show)

Fixed In Version: sat500
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-06-26 02:09:39 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description John Barton 2007-04-20 18:57:27 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv: Gecko/20061023 SUSE/ Firefox/

Description of problem:
Server was installed using kickstart, no packages were specified in %packages section. It appears that some virtualization packages were installed anyway, including rhn-virtualization-host.

After the server has been running for a brief period of time, I start getting errors from the cronjob installed by this package because python is failing. This system is not running the xen kernel and virtualization is not being used.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.install base operating system without selecting virtualization
2.boot system into standard kernel
3.wait for errors

Actual Results:
Started receiving the following error from the cronjob run every 2 minutes at /etc/cron.d/rhn-virtualization.cron:

Traceback (most recent call last):
  File "/usr/share/rhn/virtualization/poller.py", line 189, in ?
    domain_list = poll_hypervisor()
  File "/usr/share/rhn/virtualization/poller.py", line 63, in poll_hypervisor
    conn = libvirt.open(None)
  File "/usr/lib/python2.4/site-packages/libvirt.py", line 39, in open
    if ret is None:raise libvirtError('virConnectOpen() failed')
libvirt.libvirtError: virConnectOpen() failed

Expected Results:
cronjob should complete silently at the minimum, but probably shouldnt run at all on a machine where virtualization is not specified and system is not running xen kernel

Additional info:

Comment 2 Shannon Hughes 2007-04-25 10:10:34 UTC
prad, i think you have already looked at a similar bug, going to throw on must
list and you can dup or move to appropriate tracker. 

Comment 3 Pradeep Kilambi 2007-04-25 17:53:35 UTC
fix committed we need to gracefully catch the exception raised my libvirt, if
cannot step up a hypervisor connection.

Committed revision 115436.

Comment 4 Brandon Perkins 2007-05-11 18:44:09 UTC
Fails QA.  Now I'm getting:

Traceback (most recent call last):
  File "/usr/share/rhn/virtualization/poller.py", line 196, in ?
    domain_list = poll_hypervisor()
  File "/usr/share/rhn/virtualization/poller.py", line 69, in poll_hypervisor
    if not conn:
UnboundLocalError: local variable 'conn' referenced before assignment

Comment 5 Pradeep Kilambi 2007-05-14 12:07:54 UTC
fixed.. should make it into next iso..

Comment 6 Brandon Perkins 2007-05-15 16:36:44 UTC
Still Fails QA with rhn-virtualization-host-1.0.1-49.  Looks like the same error:

Traceback (most recent call last):
  File "/usr/share/rhn/virtualization/poller.py", line 196, in ?
    domain_list = poll_hypervisor()
  File "/usr/share/rhn/virtualization/poller.py", line 69, in poll_hypervisor
    if not conn:
UnboundLocalError: local variable 'conn' referenced before assignment

Comment 7 Pradeep Kilambi 2007-05-15 17:00:21 UTC
found the problem..it was a typo sorry :(

Sending        virtualization/poller.py
Transmitting file data .
Committed revision 116285.

Comment 8 Brandon Perkins 2007-05-22 18:12:05 UTC
Still Fails QA with rhn-virtualization-host-1.0.1-50.  Slightly different error
this time:

Traceback (most recent call last):
  File "/usr/share/rhn/virtualization/poller.py", line 196, in ?
    domain_list = poll_hypervisor()
  File "/usr/share/rhn/virtualization/poller.py", line 70, in poll_hypervisor
    raise VirtualizationException, \
virtualization.errors.VirtualizationException: Failed to open connection to

Comment 9 Pradeep Kilambi 2007-05-22 18:18:49 UTC
well thats because there is no lib-virt on that box and we raise an exception as
follows if we cannot connect to hypervisor:

        conn = libvirt.open(None)
    except libvirt.libvirtError, lve:
        # virConnectOpen() failed
        conn = None

    if not conn:
        raise VirtualizationException, \
              "Failed to open connection to hypervisor."

This is a legitimate exception.

Comment 10 Pradeep Kilambi 2007-05-22 18:20:46 UTC
oops i dint mean there is no libvirt.. i meant if it cannot open a connection to
the hypervisor we cannot proceed further to get the domain lists

Comment 11 Pradeep Kilambi 2007-05-22 19:54:14 UTC
k we decided to suppress the legitimate exception for poller to not spam the
user. Now on a non-xen kernel poller should just pass on silently if its not
able to create a connection to hyper visor.

Comment 12 Brandon Perkins 2007-05-24 14:52:47 UTC
Verified.  We're good on this case.

Comment 13 Brandon Perkins 2007-06-19 04:50:41 UTC
Release Pending.

Comment 14 Brandon Perkins 2007-06-26 02:09:39 UTC
Closed for Satellite 500 Release.

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