Posterous theme by Cory Watilo

Getting Subversion Repository access working with Bitnami Redmine 0.8.4 stack

I’ve been playing with Redmine for some time and am still impressed with the basic issue tracking and wiki functionality, but since starting to work with issues, I haven’t been tying them to work done in the source code repository.
Looking to remedy this, I set up the repository access details according to the project settings page.  This involved naming the Source Code Management system (Subversion), the root URL for the project, and a suitable login and password.
I did all this correctly, yet when I went to the Repository page for the project, all I got was an error saying the revision was not accessible.
A bit of research didn’t come up with a direct solution, but I did come to have a suspicion that worked out to be true.
First, I found out that the repository functionality in Redmine relies on the command-line subversion client.  This didn’t come with the Bitnami Redmine Stack (I’m on Windows, btw), so I installed it and rebooted to make sure the PATH environment variable got set properly.
After this, I ran the svn command as a test:
svn info https://my.repository.com/root
This prompted me to store the server credentials, which I accepted permanently.  This was definitely something I realized that I now how to do from the service account for Redmine.
Redmine, however, was configured to use the local system account, which doesn’t have an interactive login.  While I could have changed the service logon, I am loathe to do that to a running system.  Who knows what permissions will break.
Luckily, I remembered an old trick from the Sysinternals guys: psexec.
psexec allows you to do a telnet-like session to your own or another machine, including setting the user credentials.  It also has a special ‘-s’ switch for logging in as the system account.
A few tries got me to the magic incantation:
psexec –s –i cmd.exe
This got me an interactive window running the command interpreter as the local system account, which I verified by checking the environment variables.
Running the svn command allowed me to store the server credentials under the system account.
However, my ordeal was not over yet.  Fortunately, reading the Redmine Guide had alerted me to the fact that the first time you run the repository view, it takes a long time to index the repository into the database.  They weren’t kidding.  My browser finally timed out waiting for it to complete (but I knew some progress had been made since it was actually taking time this time around). Watching the server’s load with Process Explorer (another great Sysinternals tool) I could see it peak, sustain, trough and peak again over and over.
When it finished, I reloaded the web page, and voila!  Redmine repository happiness with Bitnami Redmine Stack as a local system service on Windows.