Bug 670868

Summary: task_to_dict() exposed by lab controller XML RPC fails with exception
Product: [Retired] Beaker Reporter: Jan Stancek <jstancek>
Component: lab controllerAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 0.6CC: bpeck, dcallagh, gozen, mcsontos, rmancy
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-20 00:38:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 4 Dan Callaghan 2012-03-29 00:15:20 UTC
In this case it seems the uploader field is None. The server has no problem with that, but the lab controller proxy code isn't setting allow_none=True. It gets None back from the server and tries to marshal it for the client and then blows up.

We could probably just set allow_none=True for the proxy:

--- a/LabController/proxy/src/bkr/labcontroller/main.py
+++ b/LabController/proxy/src/bkr/labcontroller/main.py
@@ -127,7 +127,7 @@ def main_loop(conf=None, foreground=False):
         stop_on_exception=False)
     login.daemon = True
     login.start()
-    server = ForkingXMLRPCServer(("", 8000))
+    server = ForkingXMLRPCServer(("", 8000), allow_none=True)
     server.register_instance(proxy)
     try:
         server.serve_forever()

but will this break old clients which can't understand XML-RPC nil?

Comment 5 Dan Callaghan 2012-07-13 04:42:48 UTC
*** Bug 834389 has been marked as a duplicate of this bug. ***

Comment 6 Dan Callaghan 2012-07-13 04:44:01 UTC
I think we can bite the bullet and set allow_none=True. It works back to Python 2.4 (RHEL5).

Comment 7 Dan Callaghan 2012-07-13 05:29:28 UTC
On Gerrit: http://gerrit.beaker-project.org/1214

Verified that this works correctly for RHEL5 and RHEL6 clients.

Comment 10 Raymond Mancy 2012-07-17 05:15:02 UTC
>>> server.task_to_dict("/CoreOS/abrt/Sanity/cli-sanity")
{'excluded_osmajor': [], 'creation_date': '2010-05-28 08:59:23', 'bugzillas': [], 'runfor': ['abrt'], 'path': '/mnt/tests/CoreOS/abrt/Sanity/cli-sanity', 'owner': None, 'rpm': 'rh-tests-abrt-Sanity-cli-sanity-1.0-0.noarch.rpm', 'id': 1232, 'update_date': '2011-09-06 06:24:14', 'priority': None, 'version': '1.0-0', 'description': 'does sanity on abrt-cli', 'repo': 'None', 'uploader': None, 'oldrpm': None, 'destructive': False, 'types': ['Sanity'], 'excluded_arch': [], 'name': '/CoreOS/abrt/Sanity/cli-sanity', 'license': 'GPLv3', 'nda': False, 'required': ['abrt', 'abrt-cli'], 'max_time': 1200, 'valid': True}

Comment 11 Dan Callaghan 2012-07-20 00:38:55 UTC
Beaker 0.9.1 has been released.