8

My post-commit hook is:

/usr/bin/svn update /var/www/html/mysite/ --username myusername --password mypassword --no-auth-cache >> /var/www/html/mysite/foo.txt 2>&1

After performing a commit, my post-commit hook outputs to foo.txt the following:

Updating '/var/www/html/mysite': svn: E000013: Can't create temporary file from template '/var/www/html/mysite/.svn/tmp/svn-XXXXXX': Permission denied

Any ideas?? Must be something related to permissions. It used to work, but something happened.

user2644136
  • 91
  • 1
  • 1
  • 3

3 Answers3

10

check if you have the permission of /var/www/html/mysite/

sigmalha
  • 723
  • 6
  • 13
  • Could you be more specific? – user2644136 Aug 02 '13 at 13:13
  • @user2644136 You can use the ls command to show the directory permission, but I think maybe you can login with root. – sigmalha Aug 02 '13 at 13:21
  • 1
    Using SSH, I can perform an update using "sudo" before de "svn up" in the "mysite" directory. The problem comes when trying to do the update with the "post-commit" hook (I suppose its not the same user I use when performing updates via SSH). – user2644136 Aug 02 '13 at 13:26
  • @user2644136 You can check [this link](http://www.svnforum.org/threads/34952-post-commit-hooks-not-running.?p=103872&viewfull=1#post103872) – sigmalha Aug 02 '13 at 19:47
  • It worked!!! Thanks man! It was hard not to find the solution at Google, but luckily I did so txs to you. Cheers! – user2644136 Aug 02 '13 at 21:28
  • I have added some info and examples to your answer, as it is the first google hit for this SVN error message. – user1853181 Sep 16 '15 at 10:17
  • @user1853181 where did you put your infos? – Hokascha Oct 13 '15 at 17:08
  • Unfortunately the edit was rejected. I'm not sure if you can see it in the suggested edits. – user1853181 Oct 14 '15 at 17:49
  • I had the same problem. The directory permissions had changed to root somehow. chown proper_user:proper_user /.svn/tmp fixed it. Would anyone know WHY this happens? – DevOpsSauce Feb 25 '21 at 14:05
8

When this happens to me (svn 1.7.14), I usually just have to create the tmp directory and retry the command:

mkdir /var/www/html/mysite/.svn/tmp
goldy
  • 81
  • 1
  • 3
  • This simple trick did it also for me. Afterwards "svn cleanup" (and any other svn command) worked again. – ralhei Oct 09 '17 at 08:52
-1

For all Linux Machine Users

Its file permission issue run this particular command in linux terminal.

 chmod -R 0777 /var/www/YourProjectName
Vinit Kadkol
  • 1,221
  • 13
  • 12
  • 4
    maybe you might want to change the owner to `www-data:www-data` (`chown -R www-data:www-data /var/www/YourProjectName`) instead of giving everyone read and write permissions to the folder and all files. – koppor Nov 04 '15 at 07:44
  • 5
    Never do this as this will give fully control of your files to the outside – Maduka Jayalath Nov 12 '15 at 04:27