I’ve recently been experiencing an issue with deleted files being apparently “stuck in sync” inside Syncthing, even though physically they’re gone from all devices.
The setup is A ↔ B ↔ C (i.e. A and C are not connected).
The situation is always similar, e.g. a file is deleted on A, then the deletion is synced to B, and then to C. However, sometimes, B reports the file as stuck in sync with C, like this:
Have you got any ideas what may be going on here? I can get rid of the stuck file by recreating it manually, then deleting again, but this gets tiresome after a while .
Interesting. Not sure of a root cause, but looking at the API output my interpretation is that B (the middle device) never had the file to begin with and just propagated the delete onwards? There could be some issue with optimisations around syncing deletes for files we don’t have.
All files between A and C need to go through B, so it’s not really possible that they don’t exist on B itself, however, thanks to what you’ve said, I think I know what may be the culprit here.
Basically, the file was deleted on A while B was still downloading it. I’ve verified this just now by checking B, and sure enough, there is ~syncthing~xxx.tmp for the specific file in there. As the file was gone on A, the download process was interrupted and never finished.
The affected files are quite small, so all this must be happening in a very short time span, however I will try to reproduce using larger files and report back if I come up with something concrete.
Edit:
I’ve tried reproducing in my test setup simply by deleting the file while still in transfer between A and B, however this still doesn’t lead to the deletion being stuck between B and C, so I’m guessing that there must also be something else in between that leads to this state…