Bug 237310 - Repeated erros from /usr/share/rhn/virtualization/poller.py
Repeated erros from /usr/share/rhn/virtualization/poller.py
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Virtualization (Show other bugs)
500
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Pradeep Kilambi
Brandon Perkins
:
Depends On:
Blocks: 232034
  Show dependency treegraph
 
Reported: 2007-04-20 14:57 EDT by John Barton
Modified: 2007-10-23 22:15 EDT (History)
2 users (show)

See Also:
Fixed In Version: sat500
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-06-25 22:09:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Barton 2007-04-20 14:57:27 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.2) Gecko/20061023 SUSE/2.0.0.2-1.1 Firefox/2.0.0.2

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):
rhn-virtualization-host-1.0.1-41

How reproducible:
Always


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 06:10:34 EDT
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 13:53:35 EDT
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 14:44:09 EDT
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 08:07:54 EDT
fixed.. should make it into next iso..
Comment 6 Brandon Perkins 2007-05-15 12:36:44 EDT
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 13:00:21 EDT
found the problem..it was a typo sorry :(

fixed
Sending        virtualization/poller.py
Transmitting file data .
Committed revision 116285.
Comment 8 Brandon Perkins 2007-05-22 14:12:05 EDT
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
hypervisor.
Comment 9 Pradeep Kilambi 2007-05-22 14:18:49 EDT
well thats because there is no lib-virt on that box and we raise an exception as
follows if we cannot connect to hypervisor:

    try:
        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 14:20:46 EDT
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 15:54:14 EDT
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 10:52:47 EDT
Verified.  We're good on this case.
Comment 13 Brandon Perkins 2007-06-19 00:50:41 EDT
Release Pending.
Comment 14 Brandon Perkins 2007-06-25 22:09:39 EDT
Closed for Satellite 500 Release.

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