I hit a small problem with a subversion server I recently installed at work. It was nothing major, just the listing of repositories from the SVNParentPath folder was not working. It had worked when I initially set up the server and the repositories, but I later found that it was no longer working.
Digging through multiple forum and blog posts about it I found reference to some people getting joy from ensuring that the Location stanza in their apache config had a trailing slash. After not finding the solution through google I decided to stop looking for the easy solution and started watching the log files. What I found surprised me a little.
My location stanza looks like this:
<Location /repositories/system/>
DAV svn
SVNParentPath /home/www/subversion/repositories/system
SVNListParentPath on
# access control policy
AuthzSVNAccessFile /home/www/subversion/.svn_access
# authorisation section
AuthType Basic
AuthName “My Subversion Repositories”
AuthUserFile /home/www/subversion/.svn_passwd
AuthzSVNAccessFile /home/www/subversion/.svn_access
Require valid-user
</Location>
And the log was showing this error:
Access denied: ‘jacob’ GET repositories:/system
In order to compare the error to an equivalent error for a path inside a repository that is legitimately blocked I added a test user and denied them access to anything inside the project1 repository. The url for the repository is http://my.svn.server/repositories/system/project1/ and the error message that I received was:
Access denied: ‘test.jacob’ GET project1:/
Lining up the error messages and the paths that each one was reporting I found that the problem was solved by adding a permission for all users to read the parent folder of the SVNParentPath into my AuthzSVNAccessFile file
[repositories:/]
* = r
I was surprised that I needed to put it a level back up from the location of the SVNParentPath folder, and believe that this may have been why there was so much speculation on the internet about what the solution could be.