Can someone explain this strange synchronization behaviour?

Hey there,

I have the following setup: I have systems A, B and C. A is the “main” system, it adds, modifies and deletes files on a regular basis. B is a storage server. It never adds, changes or deletes files. It just serves the files read-only on the intranet. C is an off-site system, that is switched off most of the time. All systems are set up “vanilla”, meaning I did not change any of the default settings for shared folders when I created them there. All systems share the folder with each other (A with B, A with C, B with C and the other way around ;-))

Now, systems A und B seem to do what I expect which is synchronizing. But whenever I start up system C after some time, it wreaks havoc. My expectation would be, when C comes up, it “checks” what has changed since it last was online, then pull changed and added files and folders, delete deleted ones and so on until it has the same state that A and B have created in the meantime (since it itself did not change or create anything). Instead, it starts propagation its own state and deletes files and folders created by A in the meantime and overwriting changes A made. And I can not really understand why that is the case. Did I misunderstand what syncthing is? Or did I set it up wrong? Any help would be appreciated :slight_smile:

Cheers Steffen

Syncthing definitely does what you intend, there must be something strange going on the systems. Were the systems ever in sync? Or more to the point: What are the files/folders that C propagates?

Hi there and thanks for your reply!

I first noticed this behaviour the following way: I started using this setup to synchronize my World of Warcraft addons between machines. Machine A is my home machine, machine C is at my parents home, where I visit about once a month. I started noticing that addons I installed on my home machine (A) where gone when I returned from my parents house (I never realized they were missing at my parents, since I am not really doing much there). I reinstalled them at home and forgot about it. When I came back from my parents the next time, same thing happened. I went there this weekend and had a look at syncthing there. I use SyncTrayzor which has a “Global Changes” feature where you can see the last changes it encountered. And it read "CASTLE (name of the machine at my parents) deleted ", so I am sure it is in fact machine C who is deleting the stuff.

The machines have been in sync in the beginning, since I copied the addon folder manually from C to A when I got my new home computer.

I have no problem resetting and starting over if my current setup is screwed up. Was my way to configure things (every computer shares with every other) the right one? Or should it rather be A and C sync with B (the server) but not with each other? I am using syncthing for other stuff too but for now with a simple two-machine setup. I’d like to sort this one out before using it in a more complex way with important stuff :wink:

The way you do it is just fine, I have a similar 3 device setup (homeserver, laptop and infrequently online phone) without problems.

By in sync I mean from Syncthing’s perspective: When you first set up, do folders eventually show as “In Sync”?

Something must happen on C (not by Syncthing) that triggers the update (in your case deleting stuff). There is no reason why Syncthing would just suddenly delete a file by itself. So to troubleshoot you should inspect the synced directories on C before starting Syncthing and thus propagating these deletes. If something is deleted on C and hasn’t been modified on either A or B since C was last in sync (that would cause a conflict and thus no deletion), it will naturally get deleted on A and B.

Yes, the folders are in sync after C is done deleting the changes -.-

Hmm, maybe I am thinking about what happens the wrong way. I thought that what happend was that C comes online and syncthing notices that it is out of sync but it “thinks” it (syncthing on C) has the latest changes and needs to propagate these overwriting changed and new stuff on the other clients in the process. You on the other hand seem to think, that C comes online and actually pulls the added files, getting in sync with A and B, even if only for a short while. Then something on C (not syncthing) happens and deletes the files and then syncthing pushes those deletes. Am I right? I’ll have to look into that, that would be possible. I have no idea what that could be but it would definately make sense! Thanks a lot for that idea!

I have issues with deletes myself. Sometimes deletes are undeleted especially by devices that were not online for a while. I just hate that ;(

These are conflicts (delete and modify at the same time) which non-delete always wins. Fix your environment not to modify/touch files while the device is offline.

1 Like

I have 5 devices and I am the only user and I only use one device at a time. I never modify files at the same time or around the same time. When I delete files from one device (lets say Linux) it deletes from the other 3 devices. Once one of the device that was offline (Android 4.1) for a while comes back online , it undeletes some files. The offline device never ever modifies those undeleted/deleted files at all. I do not even open those folders while the device is offline. So how am I creating conflicts?

If you can explain that to me how these conflicst are created that gives to undeletion, I would be more than happy to fix my environment other than that I am unable to understand what is going with these cases.

Most of my devices are Android and Linux.

Android does all sorts if weird things, such as updates metadata on images and thumbnails everytime you open the gallery app etc. You might not modify the files yourself, but android is probably doing it for you.

Well sure but I cant fix Android ;( I wish there was a workaround.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.