1

When I commit a change to the Ubuntu Subversion, I always get the error below.

~$ sudo svn commit -m "Initial Commit" test.txt --username akira

svn: Commit failed (details follow):
svn: Can't open file '/home/svn/myrepo/db/txn-current-lock': Permission denied

How should I set the permission to the txn-current-lock? I set the permissions below beforehand.

~$ sudo chown -R taro:subversion myrepo
~$ sudo chmod -R g+rws /home/svn/myrepo
4
  • How is your repository initialized? I.e. what command like svn co ... (or svn checkout) have you ran?
    – Lekensteyn
    Feb 19, 2012 at 12:28
  • svn://, svn+ssh:// or http:// repo? Feb 19, 2012 at 12:29
  • The command was 'sudo svn co 192.168.253.130/svn/repository /home/akira/svn/repository --username akira' Feb 19, 2012 at 12:56
  • Wait, you're committing as root, and you get a permission denied error? Weird. Is /home mounted over NFS or something? Feb 19, 2012 at 13:51

1 Answer 1

0

As you've said:

The command was sudo svn co http://192.168.253.130/svn/repository /home/akira/svn/repository --username akira

That means that you're checking out from the server 192.168.253.130 over HTTP to the local directory /home/akira/svn/repository as user akira. The read/write privileges on the SVN server (a centralized repository) are determined by the program serving SVN over HTTP (likely Apache). Apache is running as www-data and cannot write to /home/svn/myrepo/db/txn-current-lock if it's not owned by you.

I suggest you to start a svnserve daemon as the svn user and use that instead of Apache. The URL http://192.168.253.130/svn/repository then becomes something like svn://192.168.253.130/myrepo when using this initscript that basically invokes svnserve --root=/home/svn --threads as user svn. If you're running a local subversion server, you can add the --listen-host=localhost option for added security.

3
  • When using svn:// protocol, some case is successful and another case fails. Feb 20, 2012 at 14:30
  • When using svn:// protocol, some case is successful and another case fails. On the server, [svnserve -d --root=/home/svn --threads] is started as the user of svn. And on the client, [svn co svn://***] and [svn add ***] succeed but [svn commit] fails with the error of [Authorization failed]. I am confused. Could you give me another hint? Feb 20, 2012 at 14:37
  • Have a look in the files in /home/svn/myrepo/db/conf/, especially the passwd file and anon-access/auth-access settings
    – Lekensteyn
    Feb 20, 2012 at 15:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .