11

I'm trying to commit to a SVN server. On the server the subversion repository is NFS mounted. When doing a commit, I get this error message:

svn: Can't get exclusive lock on file '/svn/repo/db/transactions/7802-2.txn/rev-lock': No locks available

This used to work, and there has been no software upgrades / changes on anything. However the NFS server did crash earlier, so it might be 'corrupted' (if that's even applicable here)

Amandasaurus
  • 31,471
  • 65
  • 192
  • 253

6 Answers6

16

There's a few possibilities here:

  1. The user account that is doing the SVN update may not have update permission on the repository directory
  2. The NFS file system where the repository is stored may be full
  3. The lock daemon (lockd) may not be running on the NFS server.

UPDATE: following the update to the question, I'd suspect #3. Make sure that lockd is set up to start when the NFS server is rebooted.

gareth_bowles
  • 9,127
  • 9
  • 34
  • 42
3

Make sure that your NFS server supports locks; you may need to enable additional processes on the NFS server to accomplish this; see rpc.lockd(8) and rpc.statd(8).

Additionally, if your NFS server has restarted recently, you may have a stale or even a partially stale NFS mount. Try unmounting and remounting the NFS mount as well.

EDIT: based on your other question, it looks like lockd didn't start after your NFS server recovered from it's crash.

Tel Janin
  • 156
  • 3
  • It used to work, until the nfs server crashed. there's been no software updates recently. I've expanded the question – Amandasaurus Sep 02 '09 at 16:47
  • Your NFS mount might be (partially) stale; happens over here with a FreeBSD based NFS server and Solaris clients. Umounting / remounting the NFS share fixes the problem for us. – Tel Janin Sep 02 '09 at 16:52
  • 1
    restarting the client that had the NFS mount didn't fix it. (Although there are other machines that are mounting from that NFS server that I haven't restarted/remounted) – Amandasaurus Sep 02 '09 at 17:08
1

There are a number of alternatives mentioned in this google search for terms you mentioned above.

A few of the options mentioned are: full discs, permissions issues, "hung" or "stuck" svnserve processes, and hung transactions... You may need to try a number of these different issues to see what exactly the problem is in your case.

It sounds like you are using the bsddb SVN back-end? You may want to try migrating your repository over to the fsfs back-end (the default for several years now). It has, in my experience and from that of a number of others I know, proven more reliable than bsddb. Though you'll want to research how it interacts with NFS -- I haven't used it on NFS.

Another option you may want to consider is moving away from using SVN over NFS and instead running it over SSH on a server with the SVN repository locally stored. This is how we do all our SVN work, with fsfs backend, and I can't remember the last time we had SVN repository issues.

Sean

Sean Reifschneider
  • 10,720
  • 3
  • 25
  • 28
0

I had same issue on NFS server restart, on my old debian 3.16.7 following helped:

/etc/init.d/nfs-kernel-server restart

then nfs client must remount volume, and it worked.

LJay
  • 1
0

if you using SVN with NFS on debian

run this:

/etc/init.d/portmap restart
slm
  • 7,615
  • 16
  • 56
  • 76
0

I had similar problems here, mine due to vagrant's NFS mounts. Going from what Tel Janin said above, I restarted rpcbind with sudo service rpcbind restart on my host OS. This hung my vm. I restarted that, which gave me a cryptic NFS error failed to start with result 'dependency'. It did work though and I'm now a happy camper.