Opened 10 years ago

Closed 10 years ago

#9099 closed (fixed)

File locking on some NFS mounts

Reported by: Malcolm Tredinnick Owned by: Malcolm Tredinnick
Component: Core (Other) Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


There are still some NFS configurations that are failing to lock files the way we try. The information below is reposted from a comment in #8403 (moving here, since that ticket is about a different sort of error that we have fixed):

File "/usr/lib/python2.4/site-packages/django/core/handlers/" in get_response
  86.                 response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.4/site-packages/django/contrib/admin/" in root
  158.                 return self.model_page(request, *url.split('/', 2))
File "/usr/lib/python2.4/site-packages/django/views/decorators/" in _wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.4/site-packages/django/contrib/admin/" in model_page
  177.         return admin_obj(request, rest_of_url)
File "/usr/lib/python2.4/site-packages/django/contrib/admin/" in __call__
  197.             return self.change_view(request, unquote(url))
File "/usr/lib/python2.4/site-packages/django/db/" in _commit_on_success
  238.                 res = func(*args, **kw)
File "/usr/lib/python2.4/site-packages/django/contrib/admin/" in change_view
  579.                 new_object = self.save_form(request, form, change=True)
File "/usr/lib/python2.4/site-packages/django/contrib/admin/" in save_form
  370.         return
File "/usr/lib/python2.4/site-packages/django/forms/" in save
  302.         return save_instance(self, self.instance, self._meta.fields, fail_message, commit)
File "/usr/lib/python2.4/site-packages/django/forms/" in save_instance
  47.         f.save_form_data(instance, cleaned_data[])
File "/usr/lib/python2.4/site-packages/django/db/models/fields/" in save_form_data
  192.             getattr(instance,, data, save=False)
File "/usr/lib/python2.4/site-packages/django/db/models/fields/" in save
  217.         super(ImageFieldFile, self).save(name, content, save)
File "/usr/lib/python2.4/site-packages/django/db/models/fields/" in save
  74.         self._name =, content)
File "/usr/lib/python2.4/site-packages/django/core/files/" in save
  45.         name = self._save(name, content)
File "/usr/lib/python2.4/site-packages/django/core/files/" in _save
  150.                     file_move_safe(content.temporary_file_path(), full_path)
File "/usr/lib/python2.4/site-packages/django/core/files/" in file_move_safe
  70.             locks.lock(fd, locks.LOCK_EX)
File "/usr/lib/python2.4/site-packages/django/core/files/" in lock
  57.         fcntl.lockf(fd(file), flags)

Exception Type: IOError at /program/event/1109/
Exception Value: [Errno 5] Input/output error
  • OS: Debian Etch
  • export options: (rw,sync,no_subtree_check)
  • nfsd and client nfs tools versions: 1.0.10-6+etch.1
  • options from the mount: rw,vers=3,rsize=32768,wsize=32768,hard,intr,proto=tcp,timeo=600,retrans=2,sec=sys,addr=vm1 0 0

Change History (2)

comment:1 Changed 10 years ago by Malcolm Tredinnick

Triage Stage: UnreviewedAccepted

Based on the information you've provided, in particular the Debian package versions, there's a good chance you might be hitting this problem: .

If so, this isn't a problem Django should fix, since it's a system configuration issue with one particular set of packages. You can either manually start rpc.statd and then nfsd, or upgrade the Debian package or rejig the startup scripts. I'll leave this open for a bit pending confirmation that that Debian bug is the problem (it's not going to be enough to check that statd is running; it must have been started *before* nfsd). If it is, please close this.

If not, it starts to get tricky, because the only reports of seen of this are Debian Etch systems running 1.0.10 (this ticket plus two others now. Turned out that version on that distro was the common factor). We're doing the right sort of file locking for NFS in general, so it starts to looks like a config issue, but I'm not sure what the issue could be. Anyway, feedback on whether that bug report (well, the fix for that report) is the solution is now sought.

comment:2 Changed 10 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

I just received confirmation from one person I know was seeing this problem that upgrading the nfs package in Debian fixed the problem for them (and they were seeing this case). So I'm going to close this.

If anybody else sees this problem and wishes to reopen, we're going to need information about whether any kind of file locking works on the particular NFS mount you are trying to use. That might require consultation with your system administrator. Locking has to be possible for this stuff to work (that was the root problem in the Debian bug report: things were configured so that remote locks weren't going to be possible).

As always, version numbers (if using Debian, make sure to be using nfs-1.0.11 or later) will be appropriate, too. The original report here was actually very good in providing the sort of information we need.

Note: See TracTickets for help on using tickets.
Back to Top