4
votes

Since an hour, I'm unable to commit to my svn repository. All repositories on my svn server are affected.

Updating and checking out works fine. Committing yields the following error:

svn: Commit failed (details follow):
svn: Can't get exclusive lock on file '/var/svn/repos/<repo name>/db/txn-current-lock': 
  Bad address

The problem started when I created a new repository with the name 'config', although I'm not sure this triggered the problems I'm encountering.

svnadmin recover <repo name> gives:

svnadmin: Can't get exclusive lock on file '<repo name>/db/write-lock': Invalid argument

Why does this locking problem occur?

[edit] The server got worse, and started Segfaulting while trying to install updates. After rebooting again, the whole issue seems to be resolved...

3
Are you accessing the repository through a file:/// URL?Wim Coenen
I'm accessing it through an http:// url.Okke

3 Answers

1
votes

Repository corrupted, see Berkeley DB Recovery part of SVN Book. In short you have to do;

svnadmin recover /path/to/repos
0
votes

I just encountered this problem after migrating SVN servers. I used the native svn export and import commands to do this. On the new server I received the same error as the OP. I noticed that if from the shell I executed commit as sudo it worked, but it failed under my normal user account.

It ended up being a file permissions. I just quickly did a chmod 777 -R which for me is fine because its just my local dev box at home.

svn recover did not resolve the problem. You can't lock the file, because you do not have write permissions.

0
votes

I ran into this problem just this morning after migrating a repository across the world. The issue was that root owned the directory on the server, but the webserver runs as a different user. Change the directory owner on the server using

chown -R user:group /path/to/repository

to resolve the issue, replacing 'user' with the user who runs the webserver, and the 'group' generally should be the same as the user.