Django ImageField upload to nfs. (No locks available)

2.5k Views Asked by At

I want to upload with a Django ImageField to a nfs storage but I get this error:

[Errno 37] No locks available

This is in /etc/fstab/:

173.203.221.112:/home/user/project/media/uploads/ /home/user/project/media/uploads nfs rw,bg,hard,lock,intr,tcp,vers=3,wsize=8192,rsize=8192 0 0

I also tried to patch django to use flock() instead of lockf() but still not working.

http://code.djangoproject.com/ticket/9400

Any idea whats wrong?

2

There are 2 best solutions below

0
On

You could check if nfslock is running on both the nfs server and client machines. It is responsible for managing the locks.

0
On

I have this messy issue once, and after losing a lot of time looking for an answer I found this solution: rpc.statd

I have to execute that command in both sides of the NFS folders, in my case was my Computer and a Virtual Machine

Some information about this command can be found here:


In case that is not enough, some times I faced this issue I have to execute the statd service manually because it wasn't running. This other way to fix the problem is execute in both sides of the NFS the command:

service statd start

After executing the command in both sides the locking problem should dissappear.

Some more information on NFS software can be found here: