Project

General

Profile

svn+ssh subversion browsing in project

Added by Stuart Mathews over 14 years ago

Hi there Folks,

I'm having a problem browsing my subversion repository via Redmine.

My subversion repository(on the same server as redmine) is only accessible via SSH, and works fine as far as I can see - I use it on all my machines via the command line 'svn' tools.

After configuring a project to use that existing repository on my svn server via the URL setting in the settings page (on the redmine webpage) for my project, like so:

svn+ssh:/var/repos/compliancestream

I've left out both the username and password fields, because I've configured ssh to be host based I.e requiring no password. As you can see I've included the username in the URL as 'stuart' as this should work.

Then running :

'ruby script/runner "Repository.fetch_changesets" -e production'

this seems to use that URL previously mentioned and works(no errors, used hosted based ssh authentication) - Ie. when going to the repository tab for that project, I see the subversion listing(the commits) as expected however, when clicking through to a revision say 2 it lists the files as expected and the clicking on individual files listed to see them, I get an error 500 and the error 'The entry or revision was not found in the repository.'

When bumping the log level up on my production.log for my installation of Redmine to see whats happening through this process(Ie when I click on a source file). I see it gets this:

Shelling out: svn list --xml 'svn+ssh:/var/repos/compliancestream/ComplianceStream/src/AbilityModules'@1
Error parsing svn output: #<REXML::ParseException: No close tag for /lists/list>

and looking down the file I can see that this is true :

Output was:

<lists>
<list
path="svn+ssh:/var/repos/compliancestream/ComplianceStream/src/AbilityModules">

which shows that the output generated from svn list --xml only provides this much and thus IS missing the rest (a closing <list> tag),as the error correctly explained.

So performing this command from the command line, svn list --xml:

svn list --xml 'svn+ssh:/var/repos/compliancestream/ComplianceStream/src/AbilityModules'@1
svn: warning: cannot set LC_CTYPE locale
svn: warning: environment variable LANG is en_GB.UTF-8
svn: warning: please check that your locale name is correct

<lists>
<list
path="svn+ssh:/var/repos/compliancestream/ComplianceStream/src/AbilityModules">
The authenticity of host 'devel.stuartmathews.com (72.249.105.9)' can't be established.
RSA key fingerprint is bc:98:d5:ae:d6:0e:71:76:72:67:20:ba:3f:cc:83:32.
Are you sure you want to continue connecting (yes/no)?

Which also gets stuck at the <list tag as the original error specified. So it waits until you say 'yes'...

So I'm thinking this is a SSH issue. So anyway, I say yes, that adds devel.stuartmathews.com to my list of known hosted on my client machine - fair enough(this is my laptop) - this means I'd not have to do it again in the future. After doing that the XML that is generated is correct:

<lists>
<list
path="svn+ssh:/var/repos/compliancestream/ComplianceStream/src/AbilityModules">
<entry
kind="file">
<name>MSSQLAbilityModule.java</name>
<size>1399</size>
<commit
revision="1">
<author>stuart</author>
<date>2009-10-12T12:33:24.268972Z</date>
</commit>
</entry>
</list>
</lists>

And I assume thats what redmine is after.

If I run that command again from the command line, it doesn't prompt me(i already said yes to add it to my known hosts) and just lists the XML again correctly.

So it could be two thing:

1) Redmine when using the svn+ssh can understand how to deal with the 'Are you sure you want to continue connecting (yes/no)?' question

2) Redmine is impatient - and expects the svn list --xml command to return straight away, and doesnt allow for time to authenticate as it takes a good 3 seconds for my ssh host based authentication to authenticate.

3) I need to configure my SSH differently to accommodate Redmine?

If the issue is point 1) then I'm not too sure how to make redmine/SSH server work together in peace.

If the issue is point 2) then I guess it should wait longer until it gets a full response from the svn+ssh list --xml command?

If the issue is point 3) then do you have any idea what I need to do or point me in the right direction so I can figure it out myself.

If it something totally different, please let me know and if its related to RFM - let me know and I'll cower in shame :-)

Thanks a lot guys - Redmine is cool by the way :-)

Kind regards,

Stuart


Replies (4)

RE: svn+ssh subversion browsing in project - Added by Stuart Mathews over 14 years ago

I think that the command svn list --xml takes too long to generate the XML file and redmine is impatient but I' not too sure is that is the case.

RE: svn+ssh subversion browsing in project - Added by Stuart Mathews over 14 years ago

Sorry - I should've formatted the post :-(

RE: svn+ssh subversion browsing in project - Added by Nico Brenner about 14 years ago

Hi, I just went through quite a hassle to get Redmine working with svn+ssh. I kept getting a 500 Internal Server Error, checking the log I discovered a problem like this: http://www.redmine.org/issues/3929 with a "No close tag for /lists/list" message, nevertheless it didn't make any sense to me.

I was running Redmine behind Apache, according to the instructions here: http://www.redmine.org/wiki/redmine/HowTo_configure_Apache_to_run_Redmine. The problem with this was I couldn't see what was going on, so I switched to running it from the redmine dir using "ruby script/server -e production". Then I was able to see the problem was Redmine needed an additional password and it was asking for it on the console. Since of course I didn't want to or could enter the password each time, I did the following:

  • As root
  • Edited lib/redmine/scm/adapters/subversion_adapter.rb line 228 and removed the "--no-auth-cache" option
  • Edited /etc/passwd to enable a shell for apache
  • Gave write permission to apache on /var/www (it's home dir according to /etc/passwd)
  • Changed user to apache using the su command (su apache)
  • Checked out my svn project so subversion would cache the password
  • Set up password-less ssh login on the svn server with a public key for user apache (followed these instructions: http://blogs.translucentcode.org/mick/archives/000230.html)
  • Tested the password-less ssh login
  • Switched back to root (logged out of the apache shell)
  • Edited /etc/passwd to disable the shell for apache

Then everything worked fine. Now I'm having another problem with yum and some package dependencies to install mod_fastcgi, but that's another story. Hope this helps.

    (1-4/4)