Blaok / nextcloud-inotifyscan

Automatically scan external changes for Nextcloud local storage.
MIT License
48 stars 14 forks source link

inotifyscan hangs after some time #25

Open bjo81 opened 12 months ago

bjo81 commented 12 months ago
Nov 06 16:37:04 mail.somehost.org nextcloud-inotifyscan[4951]: INFO - Scan for /bjo/files/Screenshots/
Nov 06 16:37:05 mail.somehost.org nextcloud-inotifyscan[4951]: INFO - Scan for /bjo/files/Screenshots/Screenshot_20231106-163657.png.ocTransferId431656977.part
Nov 07 00:35:33 mail.somehost.org nextcloud-inotifyscan[4951]: INFO - Found /data/cloud/bjo/files/ DELETE acme.log
Nov 07 00:35:33 mail.somehost.org nextcloud-inotifyscan[4951]: INFO - Found /data/cloud/bjo/files/ MOVED_TO acme.log
Nov 07 00:35:33 mail.somehost.org nextcloud-inotifyscan[4951]: INFO - Scan for /bjo/files/

I wondered why some files synced via Synchting were missing and had to php /usr/share/webapps/nextcloud/occ files:scan --all manually.

Blaok commented 11 months ago

Hi @bjo81,

I actually use Syncthing with Nextcloud as well, and haven't noticed similar issues. Could you provide more details? A minimal repro would be ideal, if possible.

bjo81 commented 11 months ago

Unfortunately I don't now what causes this issue and how to reproduce it. Like mentioned above, Nov 07 00:35:33 was the last log entry, but files got changed afterwards bei syncthing and inotifyscan did not recognize the changes. Do I understand correctly that Scan for is triggered by a change, so it should find the change afterwards?

Blaok commented 11 months ago

Do I understand correctly that Scan for is triggered by a change, so it should find the change afterwards?

Yes. Scan for /bjo/files/ should inform Nextcloud about all files and subdirectories under /bjo/files/. I was unable to reproduce the issue by doing something like this:

cd /path/to/nextcloud/files
touch test
touch ../test
rm test; mv ../test test

The inotifyscan log looks like this:

INFO - Found /path/to/nextcloud/files/ DELETE test
INFO - Found /path/to/nextcloud/files/ MOVED_TO test
INFO - Scan for /nextcloud/files/

The Nextcloud database does show the test file.

bjo81 commented 10 months ago

Yeah, first it also looked ok in my test. Maybe the issue was caused by sshfs/gocryptfs. I switched to juicefs now and will monitor if the issue still persists