Opened 9 years ago

Closed 8 years ago

# [0.11] exception in expat - "junk after document element

Reported by: Owned by: col Alec Thomas normal XmlRpcPlugin normal 0.11

Should the trunk build work with 0.11.2.1?

I installed from trunk, the http://user:passwd@trac/project/login/xmlrpc seems to work "sometime" - the sample code to return the list 1 time in about 10. The failure is an exception in expat - "junk after document element: <differing line and col numbers here>"

This plugin would be very helpful if we can make it work, but where to start?

### comment:1 follow-up:  2 Changed 9 years ago by Steffen Pingel

Description: modified (diff) problems with 0.11? → [0.11] exception in expat - "junk after document element

Can you provide more details how you are using the XmlRpcPlugin?

### comment:2 in reply to:  1 Changed 9 years ago by col

Can you provide more details how you are using the XmlRpcPlugin?

Yeah, sorry my original description isn't up to much. Installed the plugin for all environments following the instructions.

set the XML_RPC to anonymous, but also testing using a trac_admin user... so my tests:

• gave TICKET_CREATE to anonymous.
• did a ticket create test. using the http://trac/projects/demo/xmlrpc worked fine. :-) why didn't I just do that before?
• using my attached python prog with the login version results in:

C:\projects\tractest>python tractest.py Unexpected error. Gonna raise it. Traceback (most recent call last):

File "tractest.py", line 20, in <module>

id = server.ticket.create( "TestTracTicket", "manually created ticket via xmlrpc interface")

File "c:\python26\lib\xmlrpclib.py", line 1199, in call

return self.send(self.name, args)

File "c:\python26\lib\xmlrpclib.py", line 1489, in request

verbose=self.verbose

File "c:\python26\lib\xmlrpclib.py", line 1253, in request

return self._parse_response(h.getfile(), sock)

File "c:\python26\lib\xmlrpclib.py", line 1387, in _parse_response

p.feed(response)

File "c:\python26\lib\xmlrpclib.py", line 601, in feed

self._parser.Parse(data, 0)

xml.parsers.expat.ExpatError: junk after document element: line 10, column 0

I think it's looking like an authentication problem... anything else I can do let me know.

col

### comment:3 Changed 8 years ago by Odd Simon Simonsen

Description: modified (diff) → worksforme new → closed

Hard to say, but could well be authentication. That username looks like it is using some non-basic form of authentication, and the plugin only supports Basic Auth - see XmlRpcPlugin documentation.

Problem with the version of plugin you used was that on any 'big' error like authentication, the plugin would raise a regular Trac error - which in turn makes a nice HTML page of information. That result cannot be parsed by the xmlrpclib and it complains of about junk in result.

In [6069] I re-did the error handling, so that most classes of errors should now return in the format requested by the caller. Please update to latest version of plugin from trunk. Also, turn on Trac debug logging - the plugin writes much useful information to the logs.

Please reopen if you think this is a problem with the plugin, and include the 'About Trac' list of software versions + any other relevant information.

### Modify Ticket

Change Properties