-
-
Notifications
You must be signed in to change notification settings - Fork 128
Description
Hi, thanks for the great project!
Im reporting this as a downstream user (paperless-ngx) and please know that I’m not very versed in filesystem internals, so apologies if I’m misreading something.
We’re seeing failures in Docker running on macOS (it does not happen when testing locally, and I havent tested other OS yet) where filelock errors:
[ERROR] [paperless.bulk_edit] Error deleting documents: [Errno 5] Input/output errorA more detailed traceback:
2026-03-10 08:34:08 [2026-03-10 08:34:08,460] [ERROR] [paperless.tasks] ConsumeTaskPlugin failed: 25_rotated.pdf: The following error occurred while storing document 25_rotated.pdf after parsing: [Errno 5] Input/output error
2026-03-10 08:34:08 Traceback (most recent call last):
2026-03-10 08:34:08 File "/usr/local/lib/python3.12/site-packages/asgiref/sync.py", line 361, in main_wrap
2026-03-10 08:34:08 raise exc_info[1]
2026-03-10 08:34:08 File "/usr/src/paperless/src/documents/consumer.py", line 607, in run
2026-03-10 08:34:08 with FileLock(settings.MEDIA_LOCK):
2026-03-10 08:34:08 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2026-03-10 08:34:08 File "/usr/local/lib/python3.12/site-packages/filelock/_api.py", line 567, in __exit__
2026-03-10 08:34:08 self.release()
2026-03-10 08:34:08 File "/usr/local/lib/python3.12/site-packages/filelock/_api.py", line 538, in release
2026-03-10 08:34:08 self._release()
2026-03-10 08:34:08 File "/usr/local/lib/python3.12/site-packages/filelock/_unix.py", line 103, in _release
2026-03-10 08:34:08 os.close(fd)
2026-03-10 08:34:08 OSError: [Errno 5] Input/output errorThis happens during document operations in paperless-ngx that acquire/release a FileLock, specifically here:
What we observed
- paperless-ngx
:latestworks - paperless-ngx dev branch fails in Docker with
Errno 5 - I tried pinning
filelockversions and tested 3.25.1 all the way down to 3.20.4 but all fail, only 3.20.3 works again. So the break appears between 3.20.3 -> 3.20.4 (at least in this environment).
ChatGPT's Analysis of Root Cause
Again, Im not comfortable making real assertions here but I did ask ChatGPT about possible root case.
Potential regression related to unlinking the lock file during release on some Docker/bind-mount filesystem backends, where the sequence unlink -> flock unlock -> close can result in EIO on os.close(fd).
Workaround
- Pinning to
filelock==3.20.3restores correct behavior for us