1

When someone commits I need to determine which project to add it to in our in house version controller. One of the factors is whether a certain branch has been created.

I have the function:

private static string SVN(string command) { StringBuilder output = new StringBuilder(); Process procMessage = new Process();

    //Start svnlook.exe in a process and pass it the required command-line args.
    procMessage.StartInfo = new ProcessStartInfo(
        @"C:\Program Files\VisualSVN Server\bin\svn.exe",
        command
    );
    procMessage.StartInfo.RedirectStandardOutput = true;
    procMessage.StartInfo.UseShellExecute = false;
    procMessage.Start();

    //While reading the output of svn, append it to the stringbuilder then
    //return the output.
    while (!procMessage.HasExited)
    {
        output.Append(procMessage.StandardOutput.ReadToEnd());
    }

    return output.ToString();
}

Which is being called with:

                    string nextRelease = SVN("ls https://server:port/svn/repo/branches/branchname");

and then checking whether nextRelease is empty. This works on my local PC on my local repo but when I install the commit hook on the server I get an error like the following:

Error: svn: E170013: Unable to connect to a repository at URL 'https://server:port/svn/repo/branches/branchname'  
Error: svn: E175013: Access to '/svn/repo/branches/branchname' forbidden  

SVNLook does not provide this information that I can find and the user is, presumably, the SVN user so it would have access to SVN.

What am I missing?

Stefan
  • 3,669
  • 2
  • 32
  • 43

1 Answers1

1

The user account that runs the svn.exe client does not have permissions to https://server:port/svn/repo/branches/ and its childs or to https://server:port/svn/repo/branches/branchname. Double-check the permissions.

Please, read the article KB33: Understanding VisualSVN Server authorization

bahrep
  • 29,961
  • 12
  • 103
  • 150
  • I thought that the commit hook ran as the committing uses? If so the group I am in has read/write access to the directory? – Stefan Apr 09 '20 at 08:29
  • @stefan no. hooks run under the server’s service account. – bahrep Apr 09 '20 at 09:58
  • 1
    @Stefan FYI: If you use Basic authentication on the server side then you need to specify the username and password when authenticating to the server. However, I assume that you use Integrated Windows Authentication (i.e., AD Single Sign-On). – bahrep Apr 09 '20 at 15:50