29

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?

alexandrul
  • 12,856
  • 13
  • 72
  • 99
Mark Arnott
  • 1,975
  • 3
  • 17
  • 28
  • Making it run as Administrator will just lead to `the requested operation requires elevation` windows message and the interface will not run at all. See http://stackoverflow.com/a/4806112/692942 – user692942 Jan 04 '17 at 09:54

5 Answers5

38

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
  • 43,293
  • 10
  • 75
  • 117
  • 1
    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 May 01 '09 at 17:24
  • 1
    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 Aug 20 '09 at 07:53
  • 3
    +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 Jan 07 '10 at 08:07
  • 1
    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 Jul 12 '10 at 16:53
  • 2
    @Shrage Shmilovitz - "Everybody tells you turn off UCA, or something else" - that comment is not correct. I gave exactly the same answer as Stefan two months earlier - give the user full control for that folder. – Franci Penov Dec 09 '10 at 17:37
  • FWIW, I had to turn of UAC before I could execute the above security permissions. This may be required temporarily (some of the files were giving access denied when trying to change the security permissions). You can then turn UAC back on afterwards. – longda Dec 14 '10 at 23:08
  • @Franci Penov You are correct, i guess there is such a think as luck. since Stefan's answer was pushed up i only noticed his. – Shrage Smilowitz Dec 15 '10 at 16:25
  • Same happened to me, even when I checked out the folder with the same user (my user, local admin, not "administrator"). Really annoying, since I try to develop, not to delve into Windows/UAC/tortoiseSVN workings.. – gerleim Nov 07 '11 at 11:15
9

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
  • 74,861
  • 18
  • 132
  • 169
  • 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 Oct 31 '08 at 15:24
  • 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 Oct 31 '08 at 18:42
  • Weird I had the local Administrators group with Full Control but still got errors about the database being read only when trying to update or switch. Adding my user explicitly to the `Security` tab fixed this even though I'm a local administrator. Thanks for this. More importantly, I didn't have to sacrifice UAC protection to do it. – user692942 Jan 04 '17 at 09:52
0

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
  • 89,048
  • 55
  • 235
  • 380
  • 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 Oct 31 '08 at 14:54
  • 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 Oct 31 '08 at 15:23
0

We just updated to SVN 1.9.3, but we use SVN on our development server to update our testing sites directly from the repository by checking out the website files. We found that users who did not perform the original checkout do not have permission to run an SVN update. Now, all of these users are part of the administrators group, and it still did not matter, but what we found was very odd is that you can add the Everyone group to the checked out folder, and then anyone is able to perform an SVN Update.

I don't understand why the everyone group being added would be able to perform this, and not anyone from the Administrators group.

I ensured that the Administrators group had full control, and that it was propagated to all sub directories and files. It did not matter.

If anyone else has an explanation for this, it would be very helpful.

David Anderson
  • 13,558
  • 5
  • 50
  • 76
-1

Did you try navigating to Program Files\TortoiseSVN\bin in Windows Explorer and setting "run ad administrator" on TortoiseProc.exe > Properties > Compatibility?

devlord
  • 4,054
  • 4
  • 37
  • 55
  • If you do that and UAC is explicit you will get a "the requested operation requires elevation" windows message and `TortoiseProc.exe` will never run. – user692942 Jan 04 '17 at 09:49