Bug 815372 - system.getScriptResults does return malformed XML
Summary: system.getScriptResults does return malformed XML
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: API
Version: 1.8
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Tomas Lestach
QA Contact: Dimitar Yordanov
URL:
Whiteboard:
Depends On:
Blocks: space18
TreeView+ depends on / blocked
 
Reported: 2012-04-23 13:46 UTC by Tomas Lestach
Modified: 2012-11-01 16:18 UTC (History)
4 users (show)

Fixed In Version:
Clone Of: 784288
Environment:
Last Closed: 2012-11-01 16:18:37 UTC
Embargoed:


Attachments (Terms of Use)

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 (Red Hat) 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 (Red Hat) 2012-11-01 16:18:37 UTC
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18


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