Bug 815372

Summary: system.getScriptResults does return malformed XML
Product: [Community] Spacewalk Reporter: Tomas Lestach <tlestach>
Component: APIAssignee: Tomas Lestach <tlestach>
Status: CLOSED CURRENTRELEASE QA Contact: Dimitar Yordanov <dyordano>
Severity: high Docs Contact:
Priority: medium    
Version: 1.8CC: cperry, dyordano, hklein, mmraka
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 784288 Environment:
Last Closed: 2012-11-01 16:18:37 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:
Bug Depends On:    
Bug Blocks: 871344    

Description Tomas Lestach 2012-04-23 13:46:11 UTC
+++ This bug was initially created as a clone of Bug #784288 +++

Created attachment 557237 [details]
xml output

Description of problem:

The system.getScriptResults call does return invalid XML


How reproducible:

$key = "75284";
$schedule = $client->call('system.getScriptResults',$session,$key);
for my $sched (@$schedule)
{
  print "ScheduleID: $key\tReturncode: $sched->{'returnCode'}\n";
}
not well-formed (invalid token) at line 258, column 46, byte 13433 at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/XML/Parser.pm line 187

Actual results:

$ xmllint --noout fault2.xml 
fault2.xml:219: parser error : PCDATA invalid Char value 27
Starting Nagios Service Mode for 120 hours...              [  OK  ]
                                              ^
fault2.xml:219: parser error : PCDATA invalid Char value 27
Starting Nagios Service Mode for 120 hours...              [  OK  ]
                                                    ^
fault2.xml:219: parser error : PCDATA invalid Char value 27
Starting Nagios Service Mode for 120 hours...              [  OK  ]

Expected results:

valid XML

Comment 1 Tomas Lestach 2012-04-23 13:53:20 UTC
The reproducer isn't specified at all.

Here's a valid one:
1. setup following Remote Command:
service httpd restart
2. run rhn_check on the client
3. call system.getScriptResults API to get the script result

Actual results:
Traceback (most recent call last):
  File "./get_script_results.py", line 14, in <module>
    result = client.system.getScriptResults(key, script_id)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1575, in __request
    verbose=self.__verbose
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1297, in single_request
    return self.parse_response(response)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 1467, in parse_response
    p.feed(data)
  File "/usr/lib64/python2.7/xmlrpclib.py", line 557, in feed
    self._parser.Parse(data, 0)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 6, column 58

Additional info: "^[" does cause the trouble in this case


spacewalk.git: 0104135e1ff03c8bea04230d9cdc5b23e66cf297

Comment 3 Jan Pazdziora 2012-10-30 19:23:24 UTC
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/

Comment 4 Jan Pazdziora 2012-11-01 16:18:37 UTC
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18