Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN permission denied - txn-current-lock

I have just set up svn on my ubuntu server. I have a my user I can login to. The problem is that whenever I try to make a change on the file structure I get a permission denied error.

Can't open file '/var/www-svn/db/txn-current-lock':
Permission denied

My repo is in /var/www-svn and the permission on that folder is drwxr-xr-x for user AND group svn (I am bad with permissions so I don't know if that's correct). My user that I log in to on svn is in the svn group, yet I cant change the file structure. What am I doing wrong? It works if I change the user and group of the folder to my user that I login too.

In svnserve.conf, anon-access is set to none and auth-access is set to write.

(I changed the owner of /var/www-svn by typing sudo chown -R svn:svn www-svn inside /var directory.)

like image 437
Marwelln Avatar asked Dec 10 '11 18:12

Marwelln


4 Answers

Repository folder on file system must be owned or at last to have read/write permission by the same linux user that your svn or apache via web-dav is working on...

In my case it was:

$ chown -R www-data:www-data /svn/reponame

But in some other case, it might be different, like

$ chown -R someuser:somegroup /svn/reponame

So replace someuser:somegroup with proper values.

like image 186
Aleksandar Pavić Avatar answered Nov 20 '22 16:11

Aleksandar Pavić


You have to add the SETUID bit for the /var/www-svn/ folder, cause under transactions there will be folders generated during the run of SVN for preserving transactions which are represented by folders.

This means in short words just make

chmod +s -R /var/www-svn/

should solve the problem.

like image 23
khmarbaise Avatar answered Nov 20 '22 16:11

khmarbaise


The svnserve deamon ran under my user, not as root. I killed the svnserve processes running under my user and restarted it as root. It now works.

like image 7
Marwelln Avatar answered Nov 20 '22 16:11

Marwelln


My problem ended up being that I applied permissions, then did svnadmin create so setting permission was needed again.

 $ sudo chown -R www-data:subversion myproject
 $ sudo chmod -R g+rws myproject
like image 6
Matt in Washington Avatar answered Nov 20 '22 14:11

Matt in Washington