Error parsing svn output » History » Version 7

Toshi MARUYAMA, 2012-10-17 12:40

1 1 Anthony C
h1. Error parsing svn output
2 1 Anthony C
3 1 Anthony C
If after adding a repository you get an error "The entry or revision was not found in the repository" on the Repository tab, check in your log folder (e.g. /var/log/redmine/default) for production.log.
4 1 Anthony C
5 2 Anthony C
If you find this error in production.log there's probably an error when the redmine user runs the svn command:
6 1 Anthony C
> Error parsing svn output: #<REXML::ParseException: No close tag for /lists/list>
7 1 Anthony C
8 1 Anthony C
(Redmine still tries to parse the output of the svn command as XML, but errors aren't formatted as XML, thus the parse error.)
9 1 Anthony C
10 1 Anthony C
To troubleshoot try running the command as the redmine user to see what the error is, for example:
11 1 Anthony C
> sudo -u www-data svn list --xml 'https://svn.server.address/reponame'@HEAD
12 1 Anthony C
13 1 Anthony C
(You may have to add "www-data ALL=(ALL) NOPASSWD:ALL" to /etc/sudoers)
14 1 Anthony C
15 1 Anthony C
Now resolve the error so that you get only clean xml from the command every time.
16 1 Anthony C
17 1 Anthony C
If you get prompted to accept the server's certificate every time you need to give the redmine user a directory to store svn configuration in. Create a directory somewhere and make sure the redmine user is owner, for example:
18 1 Anthony C
> sudo mkdir /usr/share/redmine/svn
19 3 Anthony C
20 1 Anthony C
> sudo chown www-data:www-data /usr/share/redmine/svn
21 1 Anthony C
22 7 Toshi MARUYAMA
On *Redmine 1.1.x or lesser*,
23 7 Toshi MARUYAMA
open REDMINE_ROOT/lib/redmine/scm/adapters/subversion_adapter.rb and go to line 27
24 5 Toshi MARUYAMA
source:tags/1.1.3/lib/redmine/scm/adapters/subversion_adapter.rb#L27
25 5 Toshi MARUYAMA
 and change:
26 1 Anthony C
27 1 Anthony C
> SVN_BIN = "svn"
28 1 Anthony C
29 1 Anthony C
to, for example:
30 1 Anthony C
31 1 Anthony C
> SVN_BIN = "svn --config-dir /usr/share/redmine/svn"
32 1 Anthony C
33 1 Anthony C
Now you should be able to permanently accept the certificate.
34 5 Toshi MARUYAMA
35 5 Toshi MARUYAMA
*TODO:*
36 7 Toshi MARUYAMA
On *Redmine 1.2 or greater*, this line changed.
37 6 Toshi MARUYAMA
source:tags/1.2.3/lib/redmine/scm/adapters/subversion_adapter.rb#L35
38 1 Anthony C
39 4 Pascal König
h2. "SVN: Connection closed unexpectedly" when using SVN with SSH
40 4 Pascal König
41 4 Pascal König
When you execute
42 4 Pascal König
> sudo -u www-data svn list --xml 'svn+ssh://svn.server.address/reponame'@HEAD
43 4 Pascal König
44 4 Pascal König
and receive the error "SVN: Connection closed unexpectedly", you may enable the shell for the user www-data on the machine, hosting the svn repository.
45 4 Pascal König
Simply edit /etc/passwd and change the entry for the respective user so it ends with /bin/bash instead of /bin/false or /sbin/nologin.
46 4 Pascal König
This should solve the problem.
47 4 Pascal König
48 1 Anthony C
Source(s):
49 1 Anthony C
http://www.redmine.org/boards/2/topics/11896
50 1 Anthony C
http://www.thinkplexx.com/learn/howto/scm/svn/fix-permanent-error-validating-server-certificate-problem-with-subversion