views:

264

answers:

1

I’ve got an SVN hook written as a .NET console app and running on VisualSVN server which is causing some problems. Every time I try to commit (either remotely with Tortoise or locally via command line) I get the response “Access Denied”. Looking at the event viewer for VisualSVN there is an error beginning with “Could not MERGE resource…” followed by another error repeating “Access Denied”.

If the pre-commit hook is disabled the commit goes through fine so I don't think it’s anything to do with repository permissions. The path to the pre-commit hook is definitely correct so SVN is looking in the right location. I’ve also tried giving my account local admin rights as well as explicitly giving it “Read & Execute” on the folder with the hook app. I can run the PreCommit.exe console app directly so it’s certainly capable of executing on the machine.

This is my pre-commit.cmd file in the hooks folder of the repo:

E:\PreCommitHooks\PreCommit.exe %1 %2

All of this worked fine on my local machine so I’m confident everything is correct syntactically and it’s simply a permissions error somewhere along the way. Any ideas?

+1  A: 

Visual SVN runs the script, and its a service. So it does runs it using whatever user account the service is installed under.

Something you are doing requires permissions that it doesn't seem to have.

Are you running on a domain? Is e: a local, physical drive or a nework mapping?

sylvanaar
The VisualSVN service is running under "Network Service" and granting this account all the rights in the world (i.e. local admin) doesn't make a difference. The server is on an AD domain using a local physical drive. The security log shows a successful logon by Network Service then twice again on my account when I try to commit remotely.
Troy Hunt
Well, Giving VisualSVN a domain login account would probably be your best bet short of running it as local system.I have it running on my domain controller, and it works just fine as network service - does that exe do anything out of the ordinary?
sylvanaar
Nice work, I ended up setting VisualSVN to run under System Account which has sorted the hooks issue. I've got another drama now but that's for another post :)
Troy Hunt