svnvisualsvn-servervisualsvn

VisualSVN attaching existing repository


I recently did some reorganizing of my repositories. To speed things up, I decided to use pipes instead of temporary files and GUIs:

Inside of VisualSVN's "Repositories Root" directory, I did this:

svnadmin create proj1
svnadmin dump common | svndumpfilter include trunk/proj1 | svnadmin load proj1 > NUL 2> NUL

Now, when I open up my VisualSVN Server manager, I see the new repositories under the "Repositories" folder, and browsing shows the data is what I wanted. They even seem to appropriately inherit permissions. "Verify Repository..." succeeds.

But when I use the web-browser, or an SVN client to inspect the repository, I get:

$ svn checkout https://svn.mycompany.com/svn/proj1
svn: E170013: Unable to connect to a repository at URL 'https://svn.mycompany.com/svn/proj1'
svn: E175013: Access to '/svn/proj1' forbidden

(it's the same message for a project that I know doesn't exist).

How do I get VisualSVN to serve this repository?

The "Import Existing Repository" function only supports "copy" or "load from dump", both of which I've already done. If I choose the "copy from another location" and choose the repo, I get "A repository named proj1 already exists. Please pick another name".

I've also tried restarting the service.


Solution

  • As far as I can see, you used the svnadmin create command to create your new repository. It doesn't create the authz files that should be present in the repository's /conf directory. When these files are missing, access to the repository is forbidden (because this is considered to be unexpected and has to be fixed).

    You can identify this issue by checking the 'VisualSVN Server' event log in Windows Event Viewer. I think that you will see several error-level events about missing VisualSVN-WinAuthz.ini or VisualSVN-SvnAuthz.ini files.

    And if it's the case, you can resolve this issue by making VisualSVN Server create the missing files. The easiest way is to open the VisualSVN Server Manager console, right-click the new repository and select Properties. Make any change to user permissions and roll back this change (if you don't actually make any changes to permissions). Then click Apply. So, this is going to be a no-op change that creates the missing authz file.

    In the future, please use the New-SvnRepository PowerShell cmdlet to create repositories from the command prompt. Running this cmdlet creates a new repository and all the necessary configuration files.