REQUEST - auto add in missing .stfolder

Ive had occasion where something (me!) has deleted a .stfolder for whatever reason.

This borks the mirroring, throwing up the error of “out of sync items”.

Being thick, I always attempt to restart both server/clients, remove/re-add the folder pair or even issue a syncthing --reset-deltas

THEN I realise its a trivial matter of .stfolder folder being deleted for some reason. So, I re-add it. Fixed.

COULD WE NOT have Syncthing simply re-add the missing folder upon restart of the process?

The error is cryptic. If re-adding is considered poor form by the intelligentsia, can the error be modified to “missing .stfolder in folder. Re-add it manually and restart.” (?)

1 Like

That folder marker is a safety feature, see FAQ — Syncthing documentation

If we created it automatically when missing, that would defeat its sole purpose, being able to detect when the folder has gone missing. That will lead to data loss because Syncthing will happily announce any other missing files as deleted and mirror those deletions to other devices. That’s why extra care is advised when creating the folder marker again. Only do that when you are certain that your other files are actually there.

5 Likes

Absolutely perfect. Its all rather obvious where explained in such a clear manner.

May I ask that the error message reflect this in some manner?

The error message says:

Error

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

If you think this is unclear, feel free to make a suggestion for a better message.

Well, that’s pretty clear isn’t it!

That is on the local machine, where the local folder is borked.

In my case, it was the “server” (the other end) that had the .stfolder file deleted.

In this case the local machine simply threw up the message in the Remote Devices area of “Out of Sync Items” and a list of items.

It is that message I was mentioning.

Now, what would be cool would be a banner, such as advised, on the local machine which said this same thing but advising of the error on the Remote Device/s…

A link to the help page on this specific topic would probably solve all of the inquiries about this safety mechanism. Ok. Not all. But most.

1 Like

What we do display already (in a rather non-intrusive way) is when a remote device has not accepted a shared folder, or when it has paused the folder. I’m not sure whether the info about a folder being stopped because of an error is conveyed to the other device. So it might need a protocol extension to implement such a helpful error message on the remote end.

2 Likes

How about offering to create the folder with a stern warning about it? On iOS it is impossible to create a folder beginning with a dot in its name, so this problem is tricky there.

In that case the solution is to just remove the folder from Syncthing and add it again. During that operation, the marker is created automatically. And all files are then being treated as additions, so no chance for accidental deletions on other devices.

The only caveat is if you actually had some deletions pending that had not been synced to other devices yet. But resurrecting them is the safer bet in any case.

3 Likes

Yes, but before deleting it, check for any custom/non default settings you did for this folder (e.g. Receive or Send Only, ignores, path, and… members :wink:) so that you can recreate it on your own even when no peer is up ATM.