Error parsing svn output: #<REXML::ParseException: No close tag for /lists/list>
- Redmine: 1.0.1
- Database version: MySQL 5.0
- Ruby version: 1.8.7
- Rails version: 2.3.5 (the one that came with Redmine in the vendor/ directory)
- Subversion: 1.5.1
I'm trying to access repository using
file:/// url (the repository is in the same server as Redmine). It doesn't work.
redmine/log/production.log contains the following:
Shelling out: svn list --xml 'file:///var/svn/repository/'@HEAD --no-auth-cache --non-interactive Error parsing svn output: #<REXML::ParseException: No close tag for /lists/list> /usr/lib/ruby/1.8/rexml/parsers/treeparser.rb:28:in `parse' /usr/lib/ruby/1.8/rexml/document.rb:228:in `build' /usr/lib/ruby/1.8/rexml/document.rb:43:in `initialize' etc...
When I run that exact svn command from shell as
www-data user (as Redmine runs under Passenger), I get the following output, which seems perfectly valid:
poenttoe:/usr/local/lib/redmine-1.0.1$ svn list --xml 'file:///var/svn/repository/'@HEAD --no-auth-cache --non-interactive <?xml version="1.0"?> <lists> <list path="file:///var/svn/repository"> <entry kind="dir"> <name>app</name> <commit revision="34"> <author>jpulakka</author> <date>2010-09-07T12:55:46.978106Z</date> </commit> </entry> <entry kind="dir"> <name>components</name> <commit revision="46"> <author>jpulakka</author> <date>2010-09-07T13:53:52.115011Z</date> </commit> </entry> <entry kind="dir"> <name>lib</name> <commit revision="33"> <author>jpulakka</author> <date>2010-09-07T12:41:20.975111Z</date> </commit> </entry> </list> </lists>
#1 Updated by Joonas Pulakka almost 12 years ago
One notion: when provided with slightly wrong URL such as @'file://var/svn/repository/' (missing a slash), svn spits out something like this:
<?xml version="1.0"?> <lists> <list path="file://var/svn/repository"> svn: Unable to open an ra_local session to URL svn: Local URL 'file://var/svn/repository' contains unsupported hostname
which would explain the "No close tag for /lists/list" parsing error - the tags are not indeed closed since the XML output is interrupted by an error message.
Is there a way to set up the logger so that the svn output, that Redmine tries to parse, would be there? Even though I do get proper output when executing the command that Redmine claims to be "Shelling out", could it be that Redmine is not getting the same output from svn for some reason?
#2 Updated by Joonas Pulakka almost 12 years ago
- Status changed from New to Resolved
Found it! Apache's
error.log contained stuff like this:
svn: Unable to open an ra_local session to URL svn: Unable to open repository 'file:///var/svn/repository' svn: Can't open file '/var/svn/repository/format': Permission denied
Obviously Redmine was not executing the svn command as
www-data as I thought it would. That resulted in error message in the svn output, which Redmine considered just malformed XML.
One config file,
redmine/config/email.yml, was owned by
root (even though all other config files were owned by
www-data). Chowning it to
www-data solved the problem. I have no idea why that file had such an effect, but... now it works.
- Show svn output in the log.
- Show which user Redmine runs as (this is not always obvious).