lost all files but one


I got scared today. While working on documents, i.e. creating a new one and copying a few from a CD to a place within the synced folder, I suddenly realised in another program that one file was missing. Checking more thoroughly, I found that actually all files on my desktop were gone, i.e. all files within the shared folder, but one, the last one I had saved. I noticed that the syncthing connection to my desktop was somehow disrupted, luckily I guess, because else maybe now also the synced folder on my NAS would have been empty. Bu as far as I can see, there are still all 170.000 files.

My questions are:

  1. is there a way to find out what happened? Since it affected only the synced folder, I guess it has to do with Syncthing, particularly as I am sure that I did not do any deletion operation.
  2. How can I resync without losing the files on my NAS?

Thank you in advance for your help!

Which operating system does your desktop run? If Windows, logs are automatically saved next to the config (see https://docs.syncthing.net/users/config.html for the specific location), however if it’s something else (Linux, Mac, etc.), then logs are only saved if you configure Syncthing to do so in advance.

This kind of mass deletion usually happens when you try to recreate a folder manually together with the .stfolder marker, which would cause Syncthing to believe that all files have been deleted, and thus it would push those deletions to other devices too. That’s why recreating .stfolder manually is very much not recommended. Has something like this by any chance happened on any of your devices?

You should set the folder type on the NAS to Send Only, then press the “Override Changes” button. Please do this only if you’re 100% sure that the folder state on the NAS is exactly what you need as this operation will make the folder on other devices identical to the one on the NAS.

Sorry, I forgot to mention that I’m running Linux. I’ll check for logs. It’s so long since I set it up, I don’t know if I also made it to log everything.

Ok, I checked and found the following:

Files on NAS seem to be completely there.

There is some kind of a log on my desktop. But that seems to show only activity that has been going on every day, so just normal routine. It doesn’t even show when the desktop was disconnected. However, I use syncthing-gtk and there it gives the following message:

folder marker missing (this indicates potential data loss, search docs/forum to get information about how to proceed)

well, here I am. I don’t recall having touched any folder marker (or .stfolder). But there is also no .stfolder.

Sorry, one more question: When I set the NAS folder to “send only”, nothing happens because the desktop side is still stopped by syncthing itself. To be sure, I would like to set the folder there at least for the resync to “receive only”, but it seems not to be possible.

You need to create a new directory called literally .stfolder inside the folder on the disk for Syncthing to restart the sync. However, you should still be able to change the folder type to Receive Only before doing so. Please make sure you’re using the actual Web GUI and not the interface that Syncthing-GTK provides because the latter is outdated and doesn’t include all the functionality.

I can’t connect via the web GUI on my desktop. But maybe I’m doing something wrong. Which port should it be? If it’s 22000, I can’t do it. or localhost:8384 should do it.

1 Like

I just lost all video and photos on my drive today (14GB).

my set up is Phone (send only) → PC drive (receive only) so i can have some local copy on my PC.

here is the event. if ever my phone do a backup on GooglePhotos, photos on my phone are deleted to save some space on my phone.

now after launching syncthing on my PC, it will check for my phone and copy all photos to pc, now since some of the photo are deleted from my Phone syncthing will also delete its local copy. and thats how i lost my files.

now, checking syncthing document it seems that I should have set ignoreDelete flag to TRUE.

note to developer, please, this setting should be visible when setting folder type to receive only to prevent lose files

BUT then again, it seems that does not work .

@tomasz86 Thank you for that info, I don’t know how I could miss that, but I guess I was a little bit confused yesterday.

@dev0ps I think that all settings that could cause data loss should be accompanied by a warning message which is easily to understand. However, some things are conceptually sound. Syncthing is not a backup tool, but it synchronizes files. That means what is gone on the sending side, will be gone on the receiving side. From what you have written it seems to me, that you did not enable the ignoreDelete flage, hence it couldn’t have worked. What makes you say that setting it would not work?

nevermind, it works fine now.

hopefully in the future update, ignoreDelete option be visible in the folder setting.

Now i have a big red button “Revert Local Changes” . → wish we can ignore or hide this button. clicking this is very dangerous. lol.

ignoreDelete setting should not exist. What you are trying to do is not what syncthing was created for.

Syncthings goal is to make A and B look the same, your goal is to transfer files from A to B, which is not what syncthing is for.


Now all files are back in place. I guess I can safely change the type of folders back: my desktop to “send/receive”, my NAS to “receive”. Right?

Another note however: For my desktop’s folder, it says that it has not been synced. When I check the not synced files, I see that all are either those excluded by the “.stignore” file or “SYNO_DTIME” files (each 10 B), which shouldn’t be synced anyway. Why does it still show that the folder has not been synced?

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