Syncthing deleted a good portion of my files!!!

Syncthing deleted a good portion of my files without me doing anything! One of my devices was not online so luckily most of my files are still available (I think). But what the hell is going on! Some synced folder that were ok yesterday are now empty on two out of three devices! The third one only retains it’s data because it was offline. I did not even use my PC (1st) amd laptop (2nd device) although they were powered on. So is there a way I can find out what happened and why it happened? And is there a an undo command or something I can make?

To be honst my trust in syncthing as backup solution to increase my data safety is shuttered…

Thanks in advance and tell me how I could provide useful information on the incident.

It gets boring bot it still needs to be said again:
Using Syncthing is not a replacement for proper backups.

That being said, losing data is obviously still not acceptable. You should save logs and look at the recent changes lists in the UI. However given that Syncthing is used widely without reports similar to yours, I doubt the problem is with Syncthing.

As to an “undo command”: If you have versioning enabled, then you can restore from there, otherwise not (and no, enabled versioning is still no replacement for backups).

I accept you saying not for backup purposes but to be honest: That’s what was the intended use. That will have to change now. That aside… The folders and there sub folders remain, but empty. There is information of files being deleted as last action of the regarding folders. Only folders that were synced with syncthing are affected. So what elese could it be? That it works fine with many users is no argument. The Windows 10 anniversary update crippled my pc, too even though many users have no problem with it.

Where can I find the logs? About file versioning. I sadly had it disabled. If I enable it, does that mean the files would use up as much space as there are versions? I am just limited in the hard disk space I can buy. It’s not cheap… And sorry if it’s a stupid question, but i am new to syncthing and have very limited time to deal with it. I have to go to work, so I can buy more hard disks :stuck_out_tongue:

You should read the docs or explore the UI before putting all of your data into something you don’t fully understand. The activity log shows who deleted the data.

1 Like

That’s good. I am not saying Syncthing can’t be part of a backup solution, but it lacks a lot of characteristics a dedicated backup tool needs (because it’s not designed as a backup tool). See e.g. this thread for a possibility: [Project] Syncthing as backup solution

And I am not saying the problem isn’t connected with Syncthing, I am saying it’s probably specific to your setup. Anyway, that doesn’t really matter until there are actual hints as to what happened.

There is no single place for logs, it depends on your system and how you run Syncthing: FAQ — Syncthing documentation

Sure, versioning needs to safe the data somewhere, so it needs disk space. That’s one thing that many backup programs can do better, by storing backuped data at block level.

Without logs this is only fishing in the dark, but ideas for randomly deleted files include:

  • On one of the peers, permissions for a folder changed so that it no longer was accessible.
  • On one of the peers, the synced directory is on a external drive or on a network drive which became inaccessible during operation and therefore Syncthing considered files as “deleted”

Can you elaborate a little bit on your setup and hint on anything that might be out-of-the-ordinary?

2 Likes

This was fixed in v0.14.46, so only problematic on <=v0.14.45.

That’s what the “.stfolder” safety mechanism should prevent. Sp unless the external/network drive is mapped below the root of a Syncthing folder, that shouldn’t be a problem.

I agree, and I don’t know of an active problem in the area. As I said, fishing in the dark. Does the .stfolder also cover cases where the drive becomes suddenly unavailable (i.e. unplug USB stick, network server goes down, etc.)?

Checks for the existence of .stfolder are all over the place. No scan results can be committed to database and thus propagated while it doesn’t exist.

Martin, that could be it. My third device was not syncing because the external hdd went to sleep and did not reawaken (it never does for some reason). I checked the syncthing.log on my laptop and pc, only to find out that only the last session was stored and I rebooted both since the incident occurred. I will check the log on the third device later and let you guys know. Right now it is offline with the hdd connected to my PC copying the missing 800GB.

Edit: I will also ckeck for the .stfolder later on.

While it should be a proper safeguard by design, it’s not always effective, and i don’t think it’s syncthing’s fault.

I have experienced a couple of mass-deletes because of external HDD becomes “disconnected” in the past.

What actually was going on:

The synced folder was on external hard drive, which was always connected to the PC, actually disconnecting it from PC never caused any trouble, as ST always detected lack of .stfolder and stopped the sync.

BUT:
sometimes (very infrequently) the HDD would disconnect from PC on it’s own, without any cables being actually removed, I suspect it was due to weak USB controller, or smthn in that fashion. And Windows won’t properly recognize the drop in communication with the device: it still would show up in “My Computer”/“This PC”, and, if opened you’d be able to see a couple folders there (probably available due to them being cached at some level), but deeper browsing would show folders either as “unavailable” or “empty”. Manually disconnecting and reconnecting the cable to HDD would fix it and all contents would be back there.

So it this “buggy” state, ST would sometimes still see .stfolder present, and sync all the “unavailable/empty” stuff as deleted.

As I said, i don’t think ST can be blamed here, it’s either a Windows bug, or a HW error. But my lesson was to always keep some sort of versioning on everywhere, and be extremely careful while syncing folders residing on external drives.

8 Likes

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