Project

General

Profile

Error parsing svn output » History » Version 8

Toshi MARUYAMA, 2012-10-17 12:48

1 1 Anthony C
h1. Error parsing svn output
2
3 8 Toshi MARUYAMA
h2. Background
4
5
Redmine is Rails application running on web server (apaches etc.).
6
And Redmine calls "svn" commdand on web server.
7
So, you need to configure web server process *uid* correctly.
8
Check what your web server uid is.
9
(E.g. "ps -ef", "top")
10
11
h2. Introduction
12
13 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.
14
15 2 Anthony C
If you find this error in production.log there's probably an error when the redmine user runs the svn command:
16 1 Anthony C
> Error parsing svn output: #<REXML::ParseException: No close tag for /lists/list>
17
18
(Redmine still tries to parse the output of the svn command as XML, but errors aren't formatted as XML, thus the parse error.)
19
20
To troubleshoot try running the command as the redmine user to see what the error is, for example:
21
> sudo -u www-data svn list --xml 'https://svn.server.address/reponame'@HEAD
22
23
(You may have to add "www-data ALL=(ALL) NOPASSWD:ALL" to /etc/sudoers)
24
25
Now resolve the error so that you get only clean xml from the command every time.
26
27
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:
28
> sudo mkdir /usr/share/redmine/svn
29 3 Anthony C
30 1 Anthony C
> sudo chown www-data:www-data /usr/share/redmine/svn
31
32 7 Toshi MARUYAMA
On *Redmine 1.1.x or lesser*,
33
open REDMINE_ROOT/lib/redmine/scm/adapters/subversion_adapter.rb and go to line 27
34 5 Toshi MARUYAMA
source:tags/1.1.3/lib/redmine/scm/adapters/subversion_adapter.rb#L27
35
 and change:
36 1 Anthony C
37
> SVN_BIN = "svn"
38
39
to, for example:
40
41
> SVN_BIN = "svn --config-dir /usr/share/redmine/svn"
42
43
Now you should be able to permanently accept the certificate.
44 5 Toshi MARUYAMA
45
*TODO:*
46 7 Toshi MARUYAMA
On *Redmine 1.2 or greater*, this line changed.
47 6 Toshi MARUYAMA
source:tags/1.2.3/lib/redmine/scm/adapters/subversion_adapter.rb#L35
48 1 Anthony C
49 4 Anonymous
h2. "SVN: Connection closed unexpectedly" when using SVN with SSH
50
51
When you execute
52
> sudo -u www-data svn list --xml 'svn+ssh://svn.server.address/reponame'@HEAD
53
54
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.
55
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.
56
This should solve the problem.
57
58 1 Anthony C
Source(s):
59
http://www.redmine.org/boards/2/topics/11896
60
http://www.thinkplexx.com/learn/howto/scm/svn/fix-permanent-error-validating-server-certificate-problem-with-subversion