I have found a bug that I was able to reproduce a few times, but not all times… Maybe I am doing something wrong, though, so please advise if I shall create a bug report on Github.
I am running 1.17.0 FreeBSD on two FreeNAS server, which are syncing several folders between them. Biggest folder is around 6TB with 1 Million files.
Here is the issue: Whenever I delete a subfolder, that has another subfolder in it (which has another subfolder in it etc), only the last folder in that structure actually gets deleted from the other server. The other folders are synced back from the remote server and then reappaear on the onsite server.
Example:
I am working on Server A,
it has this folder structure:
SyncedFolder/Folder1/Folder2/Folder3/Folder4
If I delete Folder 2, (that contains Folder 3, which respectively contains Folder 4), then it appears as deleted as it should be, but moments later Syncthing syncs back Folder2 and Folder3 from Server B.
It looks like Syncthing doesn’t recognize if I delete multiple files or folders at once.
Some things I’ve found out:
This only occured when I delete folders with subfolders.
This looks like it appears only on folder with subfolders, but no files in it.
The folders are marked as out of sync items in the syncthing gui.
This does not happen 100% of the time. Sometimes, it works. My guess is, if I delete at the moment when a sync happens or a scan happens, this error occurs.
Best option would be to try and reproduce that in isolation in a brand new empty folder, and provide us with a step by step list of steps to reproduce.
I think this would have to be reproduced in isolation, for us to be able to look at it, because we can’t replicate your environment.
It might be happening due to many factors, perhaps you’ve been running syncthing from some old version that potentially has bugs that placed bad data in it’s database (that we’ve missed fixing up), or perhaps it’s something to do with ignore patterns or case sensitivity, etc.
Alternative would be to enable model debug logging, and capture the logs from both sides as you reproduce the issue.
I will give this a bit more research, and will post again.
A bit more info: The whole thing was set up two months ago, so no version older than that should have touched the systems. I have ignore Permissions set to on, nothing else is ignored.
Judging from your answers, I guess this is not a known problem, so this is not a case of “Yeah the order of deleting items can be mixed up in the syncing process and therefore leading to first delete the main folder, but not deleting its content, leading to this error”.