views:

5594

answers:

4

Here is the question:
Can TortoiseSvn work on Windows 2008 without turning off User Account Control?

Here is the story: I just moved my test server to Windows 2008 and I am having problems with TortoiseSvn. I am logged on as an administrator, but when I go to update some code from the Subversion repository, I get a message saying: Error Can't set file 'C:\dev\trunk.svn\entries' read-write: Access is denied So I have seen messages like that and I know to run cleanup. But when I run cleanup I get: Cleanup failed to process the following paths: C:\dev\trunk

So further investigation convinces me that I have a permissions problem. Running svn status from a command prompt shows me that the directories are locked and running svn cleanup fails just like the tortoise cleanup did. But when I launch the command prompt as an administrator, I can run svn cleanup with out a problem and I can run svn up and get my files updated.

UPDATE: This is a windows UAC permissions problem. Turning off UAC fixes the problem. But I would like to find a solution that doesn't require turning off UAC. Since Tortoise is a windows shell extension, I don't know how to make it run as administrator.

Any suggestions?

+3  A: 

Take ownership and give yourself a full control on C:\Dev\Trunk.svn and children. That should solve your problem.

I would advise against turning off UAC. If you need to turn it off though, you can do it through Control Panel\User Accounts\Turn User Account on or off.

Franci Penov
I created the folders so I already own them. Turning UAC Off did in fact fix the problem, but it is not the fix I was looking for.
Mark Arnott
Actually, the default permissions are a little bit trickier than that. It is possible for another account to create a file in a subfolder of a folder owned by you to which you won't have access.
Franci Penov
A: 

I use TortoiseSVN on Windows Vista SP1 with UAC turned on. I've had no problems. Since Vista SP1 and Windows 2008 are essentially the same operating system, I think you might be experiencing another problem.

SVN does a lot of renaming of temporary files, and it's not particularly robust if there's a sharing violation. I've found that some antivirus products will spot that SVN has just closed a (temporary) file. They'll scan it, and while they're scanning it, SVN attempts to rename it -- sharing violation: boom. Search indexers sometimes cause the same problem.

See if you can stop your source directories from being indexed, or prevent your AV from doing realtime scanning on them. You can exclude the directories, or you can exclude the TortoiseProc.exe process.

Roger Lipscombe
I could see how AV and indexing could be a problem, but I don't have AV on this server and the folders are locked every single time I try to update with tortoise. Sharing problems with the indexing service would be intermittent.
Mark Arnott
Fair enough. My point is that TortoiseSVN _does_ work on that OS. Have you tried using SysInternals' Process Monitor to see what other process has the files open?
Roger Lipscombe
+10  A: 

right-click on your working copy c:\dev folder, select "properties" from the context menu. In the properties dialog, go to the security tab. You will notice that the Admin user doesn't have full access (the user is not listed there). Add the Admin user and give it full access rights.

Yes, the Admin user usually has full access rights to all folders, but only after the UAC prompt. Applications usually don't provide the UAC prompt but get an access-denied error instead. To give the Admin user full access to that folder without the UAC prompt, you have to add that user manually.

Stefan
This is a problem with Windows 2008. That is not specific to TortoiseSVN. I was logged on with an administrator account when I checked out the files. Windows made the local administrators group the owner of the files and folders. Instead windows should have made my user account the owner.So now even though I created the folder, I don't have rights to edit the contents of the folder until I give my account permission to the folder. I could also access the folder "as administrator", but I didn't do the checkout "as administrator". This behavior just doesn't make sense.
Mark Arnott
I have the same problem. But. I have a User (in Administrators group) that is used to logon and therefore use TortoiseSVN in explorer. On the same account I run VS2008 with elevated permissions (as Admin) and use AnkhSVN in it. Whenever I commit something using VS, Tortoise starts complaining with "Access denied". Security setting on the folder set Full Control to Administrators group. What should I do?
Robert Koritnik
+1was getting the same, solved by adding the permission for the specific user - even though the permission was already explicitly granted to the admins group.
eglasius
Stefan, you where the first person that has given out the secret how to eliminate such a nuisance. Everybody tells you turn off UCA, or something else, this answer is the "correct" answer. if i could given you 2 pluses.
Shrage Smilowitz
A: 

You folks who are denying that there is a UAC specific problem are getting very annoying.

This is a real problem, with Windows 2008 and Windows 7. Certain files require elevated permissions to change them. This can be seen by trying to save files from notepad, or replace them by dragging in Explorer. I do not know the exact rules, but they seem to have something to do with whether the files have been used recently by a process which runs with elevated permissions, or files in protected directories like Programfiles or INETPUB.

Tortoise cannot run with elevated permissions. I end up having to use a commandline client running from an elevated command window.

Ross Presser
read my comments on stefan's answer (the accepted answer). If files are created by a user/process that is in the local administrators group, those files are owned by the group, not the user and can only be modified with elevated privileges. Yes that is totally insane, but that's the way Microsoft did it.
Mark Arnott
Well then this is a serious deficiency in TortoiseSVN, because there is no way to make TortoiseProc run elevated, which means there will ALWAYS be problems like this happening.
Ross Presser