Opened 8 years ago

Closed 7 years ago

#5333 closed defect (worksforme)

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

Reported by: colski Owned by: athomas
Priority: normal Component: XmlRpcPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description (last modified by osimons)

Should the trunk build work with

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?

Attachments (1) (868 bytes) - added by colski 7 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 follow-up: Changed 7 years ago by stp

  • Description modified (diff)
  • Summary changed from problems with 0.11? to [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 7 years ago by colski

Replying to stp:

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 Unexpected error. Gonna raise it. Traceback (most recent call last):

File "", line 20, in <module>

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

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

return self.send(, args)

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


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

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

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


File "c:\python26\lib\", 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.


Changed 7 years ago by colski

comment:3 Changed 7 years ago by osimons

  • Description modified (diff)
  • Resolution set to worksforme
  • Status changed from new to 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.

Add Comment

Modify Ticket

as closed The owner will remain athomas.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.