Modify

Opened 15 years ago

Closed 15 years ago

#5333 closed defect (worksforme)

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

Reported by: col Owned by: Alec Thomas
Priority: normal Component: XmlRpcPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description (last modified by osimons)

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?

Attachments (1)

tractest.py (868 bytes) - added by col 15 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 15 years ago by Steffen Pingel

Description: modified (diff)
Summary: 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 15 years ago by col

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 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

Changed 15 years ago by col

Attachment: tractest.py added

comment:3 Changed 15 years ago by osimons

Description: modified (diff)
Resolution: worksforme
Status: newclosed

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
Set your email in Preferences
Action
as closed The owner will remain Alec Thomas.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.