SVN post-commit update error (Can't create temporary file from template / permission denied)
Asked Answered
V

3

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.

Verwoerd answered 2/8, 2013 at 0:42 Comment(0)
B
10

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

Brahmaputra answered 2/8, 2013 at 4:49 Comment(9)
Could you be more specific?Verwoerd
@Verwoerd You can use the ls command to show the directory permission, but I think maybe you can login with root.Brahmaputra
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).Verwoerd
@Verwoerd You can check this linkBrahmaputra
It worked!!! Thanks man! It was hard not to find the solution at Google, but luckily I did so txs to you. Cheers!Verwoerd
I have added some info and examples to your answer, as it is the first google hit for this SVN error message.Seessel
@Seessel where did you put your infos?Devitt
Unfortunately the edit was rejected. I'm not sure if you can see it in the suggested edits.Seessel
I had the same problem. The </path/to/html/.svn/tmp> directory permissions had changed to root somehow. chown proper_user:proper_user /.svn/tmp fixed it. Would anyone know WHY this happens?Proportionate
R
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
Reprint answered 18/6, 2016 at 18:16 Comment(1)
This simple trick did it also for me. Afterwards "svn cleanup" (and any other svn command) worked again.Terce
S
-1

For all Linux Machine Users

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

 chmod -R 0777 /var/www/YourProjectName
Stirpiculture answered 22/4, 2014 at 13:25 Comment(2)
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.Statant
Never do this as this will give fully control of your files to the outsideBusiness

© 2022 - 2024 — McMap. All rights reserved.