Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

inotify not being triggered on SFTP file transfer #665

Open
jat255 opened this issue May 21, 2020 · 1 comment
Open

inotify not being triggered on SFTP file transfer #665

jat255 opened this issue May 21, 2020 · 1 comment

Comments

@jat255
Copy link
Contributor

jat255 commented May 21, 2020

I have paperless setup in an lxc unprivileged container, which works mostly okay, but I've noticed that if I use my laptop's file browser (KDE Dolphin) to upload a file to my paperless consumption directory via SFTP, the consumer does not see the event and trigger consumption.

I can confirm that it triggers an inotify event when uploading the file, as I see the following output on my paperless host when watching the directory and uploading a file via SFTP:

$  inotifywatch -v -e moved_to -e close_write -r /data/consumption
Establishing watches...
Setting up watch(es) on /data/consumption
OK, /data/consumption is now being watched.
Total of 1 watches.

[Upload file via SFTP then press Ctrl-C...]

Finished establishing watches, now collecting statistics.
total  close_write  filename
1      1            /data/consumption/

I monitored those two inotify events because those are the ones monitored on this line of the consumer. I cannot see why this wouldn't work.

My paperless user has full rights to the file:

-rw-r--r--+ 1 paperless paperless 778K May 21 11:09  file_to_consume.pdf

Some more debugging shows that this in the log:

May 21 11:52:10 paperless python3[19865]: Skipping /data/consumption/file_to_consume.pdf.part as it is not a file

So it looks like because Dolphin uploads a .part file and then renames it, the original file gets ignored, and the rename is not detected via inotify

@jat255
Copy link
Contributor Author

jat255 commented May 21, 2020

Copying via scp works as expected

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant