Medical Nerds Blog Logo
medicalnerds.com

technology, stats and IT for medics

 

TortoiseSVN and svn+ssh problems

May 15th, 2007 by Mark · 3 Comments

I’ve had problems with TortoiseSVN connecting to a subversion repository on Mac OS X where the connection would just hang when trying to browse or checkout a repository, or would fail with the error “Unable to write to standard output (stderr)”. I show you how to diagnose the problem, and solve it (in my case).

TortoiseSVN is a great Windows Explorer shell extension that allows one to interact with a local or remote Subversion repository easily and efficiently. Subversion is great for keeping track of your academic work – think of “Track Changes” on steroids, a super way of keeping track of changes to files and groups of files. It also makes collaboration easy, if you are collaborating with like-minded individuals who understand the benefits of decent version control rather than trying to keep version information in Microsoft Word.

I’ve previously used two laptops, one running Mac OS X (my main work machine) and one running Windows XP. I synchronise my work by using subversion. I can checkout a working copy of my research files, make changes, and then commit those changes. I don’t tend to get any conflicts, but these are easy to fix (with plain text files anyway). I take special care not to commit binary changes from one working copy before committing changes from the other, as binary conflicts are much harder to deal with.

Since upgrading my Mac (a new Macbook Pro), I’ve had problems connecting. If your copy of TortoiseSVN hangs when trying to connect, or complains about a “Unable to write to standard output (stderr)” error, then try the following: (I assume you use bash as your default shell on the server holding your subversion repository).

Check manual SSH connections work

  • Download Plink (a command line SSH client). Copy this file into C:\WINDOWS
  • Go to START menu->Run
  • Type CMD.EXE
  • Type PLINK.EXE user@host

You should then be able to login to the SSH server running on your machine (Mac OS X, or Linux). Obviously, you will need to run a SSH server on this machine. On the Mac, you just enable “Remote login” from the SHARING pane of System Preferences.

If you can’t login using SSH, then you must have a network problem, or some other problem stopping connections. Ensure you’re using the correct IP address etc.

As long as a normal SSH login worked, you can now move on to the next step:

Check svn+ssh will work
To do this, svnserve must be in the path. This is critical and in UNIX, the path may differ between interactive and non–interactive shells. I use MacPorts which makes it easy for me to install Subversion (port install subversion), but by default, all binaries are installed in /opt/local/bin/.

For interactive shells, bash looks for .profile, and will execute the commands therein. For non-interactive shells, bash looks at .bashrc.

Try this:

  • Type PLINK.EXE user@host svnserve -t

To see whether a non-interactive shell can find your svnserve binary. In my case this was the problem, and adding the required lines to my ~/.bashrc file cured my TortoiseSVN problem.

If you continue to have problems, then the output from PLINK may well be able to offer insight into what is going on (whereas TortoiseSVN doesn’t pass on errors from connections and just seems to silently fail or provide cryptic error messages.

Good luck!

Tags: Free · Software

3 responses so far ↓

  • 1 Ben XO // May 11, 2008 at 3:53 pm

    Thanks for the tips, came in useful debugging a stupid CPanel server that was throwing some unwanted output on to every connection!

  • 2 Hoopla // Oct 28, 2009 at 2:12 am

    Hey mate, thanks a shipload! That tunnel command worked a treat!

  • 3 suresh // Mar 12, 2011 at 11:22 am

    i need better way to avoid mine error like whenever i open file that time i will get that file is locked like this

Leave a Comment

(Don't forget to fill in the Captcha)