Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 834389

Summary: xml-rpc throws "cannot marshal None unless allow_none is enabled" error
Product: [Retired] Beaker Reporter: Gurhan Ozen <gozen>
Component: lab controllerAssignee: Steven Lawrance <stl>
Status: CLOSED DUPLICATE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.8CC: bpeck, dcallagh, jburke, rmancy, stl
Target Milestone: ---   
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-13 04:42:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gurhan Ozen 2012-06-21 18:26:45 UTC
Description of problem:
Here is a code snappet to reproduce the issue:

>>> lab_controller = "lab-02.rhts.eng.bos.redhat.com"
>>> server = xmlrpclib.ServerProxy("http://"+lab_controller+":8000", allow_none=True)
>>> testinfo = server.task_to_dict("/kernel/filesystems/nfs/bz803431")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1253, in request
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1392, in _parse_response
    return u.close()
  File "/usr/lib64/python2.6/xmlrpclib.py", line 838, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 1: "<type 'exceptions.TypeError'>:cannot marshal None unless allow_none is enabled">


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

How reproducible:
Everytime.

Steps to Reproduce:
1. see above
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Steven Lawrance 2012-06-21 19:40:31 UTC
The task in question has a NULL priority, which Task.to_dict returns as None:

return dict(...
    priority = self.priority,
    ....
)

task_to_dict seems to work for tasks with a priority specified.

Comment 2 Gurhan Ozen 2012-06-22 15:05:24 UTC
Ok, so what's the solution here? Can the call be modified in the lab controller to maybe return a null string or something instead of None? 
That was just an example task, we should be able to get info from all tasks, so changing the tasks is not scalable.

Comment 3 Steven Lawrance 2012-06-22 17:47:26 UTC
I agree this shouldn't happen but it will need to be fixed on the server side (the lab controller just proxies the call).

It looks like there could be a couple other cases in the same block susceptible to similar errors.

Comment 4 Gurhan Ozen 2012-06-23 16:53:21 UTC
Thanks Steven!

Comment 8 Steven Lawrance 2012-07-12 18:38:45 UTC
On gerrit, but there is the question of why we can't just allow marshalling none:
http://gerrit.beaker-project.org/#/c/1203/

Comment 9 Dan Callaghan 2012-07-13 04:42:48 UTC

*** This bug has been marked as a duplicate of bug 670868 ***