nsg / immich-distribution

Experimental Immich distribution inside a snap
MIT License
25 stars 0 forks source link

Sync feature #231

Open PolestarWx opened 2 days ago

PolestarWx commented 2 days ago

Question

Hello,

First, thank you very much for this great job !

I would like to know how often your extra sync service is syncing.

I got an error when it try to upload the syncthing .txt file generated by syncthing on windows (I mounted windows folder to my vmware immish snap) Oct 25 16:52:03 immich immich-distribution.sync-service[6836]: Failed to upload asset /var/snap/immich-distribution/common/sync/b611ff47-31f0-4e7c-8ffc-f92f42829e2d/S23U/.stfolder/syncthing-folder-588315.txt, status code 400. Response: {"message":"Unsupported file type syncthing-folder-588315.txt","error":"Bad Request","statusCode":400,"correlationId":"gqe8f2ei"}

Does it stop the service ?

Thank you for your time :)

nsg commented 2 days ago

I would like to know how often your extra sync service is syncing.

The service watches for changes, so it should trigger immediately. It's using Inotify and it's a Linux kernel feature.

There is also a extra daily full scan that I execute once a day (at startup, and once every 24 hours). I wrote this as an extra check to make sure that everything in imported.

I got an error when it try to upload the syncthing .txt file generated by syncthing on windows /.../

The error message was Immich API complaining that it can't import the txt-file. This should not stop the sync-service. The sync service assumes that everything are images and videos ready to be imported to Immich.

I mounted windows folder to my vmware immish snap

I have no idea how vmware mounts works, but I'm a little worried that they do not support Inotify. If changes do not trigger immediately, that's probably why.

.stfolder

Looks like you have file versioning turned on, that could be a little confusing for the sync service because they may be multiple versions of the same file, even if they are removed. I have turned this of myself for this reason.

PolestarWx commented 2 days ago

Thank you very for all the explantation, I have to check about Inotify and vmware mount.

Do you think it will work if I use samba share from windows, mounted on linux instead ?

What are the difference between using syncthing using your sync service and syncthinf to mounted folder as external library ? As I understand using your sync service change report immediately, that is not hte case with external library. But delete seems to work the same if we mount them as read/write (without :ro) right ?

nsg commented 16 hours ago

Do you think it will work if I use samba share from windows, mounted on linux instead?

Probably not, file changes are rarely sent over network mounts due performance. A share in the other direction should work.

What are the difference between using syncthing using your sync service and syncthinf to mounted folder as external library ?

My sync service predates Immich native External Library feature, so I mainly built it to have a two way sync between Immich and my synching folder (synced with my phone). Immich External Library has since then implemented most of these features.

As I understand using your sync service change report immediately, that is not hte case with external library.

I haven't checked recently but I think they scan the external library on a schedule. This has the advantage that it works with most filesystems/mounts, but has the disadvantage of being slow.

But delete seems to work the same if we mount them as read/write (without :ro) right ?

That's my understanding.

Try External Library, if that works for you, that's probably the easiest and most well supported solution because it's actively developed by the Immich team directly.