Bug 453398 - Python traceback on addition of a guest
Summary: Python traceback on addition of a guest
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 0.1
Hardware: i386
OS: Linux
low
medium
Target Milestone: ---
Assignee: Pradeep Kilambi
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
: 462576 (view as bug list)
Depends On:
Blocks: space02
TreeView+ depends on / blocked
 
Reported: 2008-06-30 12:44 UTC by Rob See
Modified: 2009-09-17 06:59 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-09-17 06:59:23 UTC
Embargoed:


Attachments (Terms of Use)

Description Rob See 2008-06-30 12:44:58 UTC
Description of problem:
While trying to make use of the rhn-virt-guest and rhn-virt-host client pieces,
I run into a python traceback on the spacewalk server:
Exception Handler Information
Traceback (most recent call last):
  File "/usr/share/rhn/server/apacheRequest.py", line 120, in call_function
    response = apply(func, params)
  File "/usr/share/rhn/server/handlers/xmlrpc/registration.py", line 1109, in
virt_notify
    rhnVirtualization._virt_notify(server_id, actions)
  File "/usr/share/rhn/server/rhnVirtualization.py", line 844, in _virt_notify
    handler.handle(server_id, action)
  File "/usr/share/rhn/server/rhnVirtualization.py", line 217, in handle
    handler(system_id, timestamp, properties)
  File "/usr/share/rhn/server/rhnVirtualization.py", line 267, in
_handle_domain_exists
    uuid)
  File "/usr/share/rhn/server/rhnVirtualization.py", line 784, in __notify_listeners
    listener._notify(*args)
  File "/usr/share/rhn/server/rhnVirtualization.py", line 1028, in _notify
    self.guest_migrated(*args)
  File "/usr/share/rhn/server/rhnVirtualization.py", line 1038, in guest_migrated
    procedure.rhn_entitlements.repoll_virt_guest_entitlements(new_host_sid)
  File "/usr/share/rhn/server/rhnSQL/__init__.py", line 181, in __call__
    proc = self._implementor.__call__(self._name)
TypeError: Procedure() takes exactly 1 argument (2 given)

How reproducible:
I have 3 groups of host/guest that are experiencing this problem

Steps to Reproduce:
1. install rhn-virt-guest on guests
2. install rhn-virt-host on hosts
3. run rhn-profile-sync on host
4. wait for traceback email to arrive to spacewalk admin
 
Actual results:
Guests are not linked correctly to the host machine in the webgui

Expected results:
Guests showing as linked to their host.

Additional info:

Comment 1 Rob See 2008-06-30 12:46:29 UTC
The server is running CentOS 5.2 i386, the client machines are running a
combination of Cent 5.2 i386 and Cent 5.2 x86_64

Comment 2 Rob See 2008-06-30 14:26:16 UTC
This may or may not be related, but I'm also seeing the following error messages from:
python /usr/share/rhn/virtualization/poller.py (run from cron on the hosts)

libvir: Remote error : No such file or directory
libvir: warning : Failed to find the network: Is the daemon running ?
libvir: Remote error : No such file or directory
libvir: warning : Failed to find the network: Is the daemon running ?

Which seem to happen because /var/run/libvirt/libvirt-sock does not exist. The only files I have in this 
directory are qemud-sock and qemud-sock-ro

Comment 3 Rob See 2008-06-30 14:31:43 UTC
ok, so this looks like it is not related... it was happening because libvirtd wasn't running on the hosts.



Comment 4 Rob See 2008-07-01 20:16:31 UTC
Had a python guy I know look at this... Its caused by a difference between 2.3
and 2.4/2.5. Can be worked around by changing 
def Procedure(name): => 
def Procedure(cls,name): 
and
def Function(name, ret_type): =>
def Function(cls, name, ret_type):

in rhnSQL/__init__.py 

Comment 5 Jon 2008-07-02 17:49:24 UTC
I can confirm that I have the same problem on Centos 5.1 running
python-2.4.3-19.el5.

Comment 6 Rob See 2008-07-02 17:49:48 UTC
Updated version that should actually fix the problem (in an ugly way) and not
break other stuff.
Replace these two functions in /usr/share/rhn/server/rhnSQL/__init__.py

# wrapper for a Procedure callable class
def Procedure(name,extra=None):
    if extra:
        name = extra
    db = __test_DB()
    return db.procedure(name)

# wrapper for a Procedure callable class
def Function(name, ret_type, extra=None):
    if extra:
        name,ret_type=ret_type,extra
    db = __test_DB()
    return db.function(name, ret_type)


Comment 8 John Matthews 2008-09-12 14:20:31 UTC
Verified, below is the procedure I followed.

On Spacewalk 0.2 running on RHEL5.2 with rhel5 vt channel

Registered a RHEL5.2 pv-host to SW 0.2
Created a Kickstart profile for a RHEL5.2 pv-guest, associated an activation key for base channel rhel-5-server with no entitlements.

Kickstarted the guest from SW 0.2.

Guest was created successfully.

Comment 9 Pradeep Kilambi 2008-09-22 11:51:18 UTC
*** Bug 462576 has been marked as a duplicate of this bug. ***

Comment 10 Miroslav Suchý 2009-09-17 06:59:23 UTC
Spacewalk is released for long time.


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