Django unable to write to an NFS share

345 views
Skip to first unread message

Bastian

unread,
Apr 13, 2012, 5:22:48 AM4/13/12
to django...@googlegroups.com
Hi,

I have a working Django project and I am trying to add a second server. In the process I am making an NFS share on one server. The Apache instances on this server (the NFS host) can write (mostly images) to this directory but the other server (the NFS client) seems unable. Actually from this second server I changed the permissions of the share to 777 just to make sure and still root can write but www-data can only create file, it is denied the right to write them. Very strange situation that I don't understand. Searching this group and Google led me to few information. There is this lock issue thing that I'm not sure to understand if it has been fixed. Any clue is welcome. I'm using Debian Squeeze, Django 1.3 and this is the options I use in the export: rw,sync,no_root_squash,no_subtree_check,insecure

Thanks,
Bastian

Bastian

unread,
Apr 13, 2012, 6:30:05 AM4/13/12
to django...@googlegroups.com
Let me reformulate that, I started again from scratch and the www-data user can actually create and edit files in the NFS share. Now what happens is that the app simply says connecting while trying to upload a file and it stays like that in the browser for as long as I don't stop it. I cannot see any error in the logs. I have my user-media set to the NFS share in my django settings. I have no idea what is going on!

Bastian

unread,
Apr 13, 2012, 11:48:23 AM4/13/12
to django...@googlegroups.com
ok I just gave up using NFS, it's just too much hassle, making sure the ports are static, configuring iptables and then permissions problems... I switched to sshfs and it just worked straight away :)
Now I don't know if it is a very good option for sharing the user-media folder, any idea?


On Friday, April 13, 2012 11:22:48 AM UTC+2, Bastian wrote:

Win Thor

unread,
Jun 6, 2019, 7:39:25 AM6/6/19
to Django users
In case anyone else runs into this. You can fix this by using NFSv4. There are issues with file locking and if you don't have statd running with NFSv3 to help manage lock status for files then you'll run into these types of issues. I was having this same issue and had to update my NFS server to ONLY use NFSv4. Once I did this, I didn't have the issue anymore.
Reply all
Reply to author
Forward
0 new messages