#9400: flock causes problems when writing to an NFS share
-------------------------------------+-------------------------------------
     Reporter:  mikeh                |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  File                 |                  Version:  1.0
  uploads/storage                    |               Resolution:
     Severity:  Normal               |  worksforme
     Keywords:                       |             Triage Stage:  Design
                                     |  decision needed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Marcin Nowak):

 After 6 years It does not work for me, too, but for GlusterFS share.
 I must set STATIC_ROOT to local path, which is a symlink pointing to to
 the GlusterFS path.

 When the STATIC_ROOT is set directly to GlusterFS share, Django will
 crash:

 {{{
 Type 'yes' to continue, or 'no' to cancel: yes
 Deleting 'fonts/FontAwesome.otf'
 Copying '[...]static/fonts/FontAwesome.otf'
 Traceback (most recent call last):
   File "bin/diagnostictool", line 39, in <module>
     sys.exit(djangorecipe.manage.main('diagnostictool.production'))
   File "[...]eggs/djangorecipe-1.11-py2.7.egg/djangorecipe/manage.py",
 line 9, in main
     management.execute_from_command_line(sys.argv)
   File
 "[...]eggs/Django-1.8.6-py2.7.egg/django/core/management/__init__.py",
 line 354, in execute_from_command_line
     utility.execute()
   File
 "[...]eggs/Django-1.8.6-py2.7.egg/django/core/management/__init__.py",
 line 346, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "[...]eggs/Django-1.8.6-py2.7.egg/django/core/management/base.py",
 line 394, in run_from_argv
     self.execute(*args, **cmd_options)
   File "[...]eggs/Django-1.8.6-py2.7.egg/django/core/management/base.py",
 line 445, in execute
     output = self.handle(*args, **options)
   File
 
"[...]eggs/Django-1.8.6-py2.7.egg/django/contrib/staticfiles/management/commands/collectstatic.py",
 line 168, in handle
     collected = self.collect()
   File
 
"[...]eggs/Django-1.8.6-py2.7.egg/django/contrib/staticfiles/management/commands/collectstatic.py",
 line 107, in collect
     handler(path, prefixed_path, storage)
   File
 
"[...]eggs/Django-1.8.6-py2.7.egg/django/contrib/staticfiles/management/commands/collectstatic.py",
 line 315, in copy_file
     self.storage.save(prefixed_path, source_file)
   File "[...]eggs/Django-1.8.6-py2.7.egg/django/core/files/storage.py",
 line 63, in save
     name = self._save(name, content)
   File "[...]eggs/Django-1.8.6-py2.7.egg/django/core/files/storage.py",
 line 258, in _save
     locks.unlock(fd)
   File "[...]eggs/Django-1.8.6-py2.7.egg/django/core/files/locks.py", line
 112, in unlock
     ret = fcntl.flock(_fd(f), fcntl.LOCK_UN)
 IOError: [Errno 2] No such file or directory
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/9400#comment:12>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.4ebaee2d7540e7e07494743a2e9b77dd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to