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 )
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)
Change History (4)
comment:1 follow-up: 2 Changed 15 years ago by
Description: | modified (diff) |
---|---|
Summary: | problems with 0.11? → [0.11] exception in expat - "junk after document element |
comment:2 Changed 15 years ago by
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:
- http://trac/projects/demo/xmlrpc returns a nice page in ff
- http://trac/projects/demo/login/xmlrpc also appears to work correctly in ff.
- wget http://trac/projects/demo/xmlrpc worked fine.
- wget http://DOMAIN\\user:passwd@trac/projects/demo/login/xmlrpc resulted in 401, which is odd, since the user definitely worked ok in ff.
- 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
Attachment: | tractest.py added |
---|
comment:3 Changed 15 years ago by
Description: | modified (diff) |
---|---|
Resolution: | → worksforme |
Status: | 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.
Can you provide more details how you are using the XmlRpcPlugin?