As in this lengthy title I put (just for others reference), Syncthing shows:
Error
on folder [folder name] (folder id): folder marker missing (this
indicates potential data loss, search docs/forum to get information
about how to proceed)`
Failed
to create folder marker: mkdir \\?\C:\Users\user\Documents\[name of 2FA
program here]\.stfolder: The system cannot find the file specified.
So making .stfolder (mkdir) on Windows 11 is impossible under all Windows libraries (lack of permissions?). This includes Documents, Videos, Music, Pictures, Videos, Downloads etc. I also tried to create folder on second non-system D drive which was connected to Music library (D:\Music) and it failed with the same message. Does this only happen to me? Also, when creating under any other folder like D:\Test for example, issue doesn’t occur and that’s my workaround for now. Sorry for this long post, but this made me really mad as I struggled for hours.
Update:
Issue occurs only on legacy folders. On Windows 11 “My Documents” is called “Documents” instead. There is also a library “Documents”, but it’s a link to multiple folders within it. So I was wrong to mention libraries. Legacy folders are stored locally on Windows drives and are not virtual.
It’s probably because libraries are not actual physical folders:
Libraries are virtual containers for users’ content. A library can contain files and folders stored on the local computer or in a remote storage location. In Windows Explorer, users interact with libraries in ways similar to how they would interact with other folders. Libraries are built upon the legacy known folders (such as My Documents, My Pictures, and My Music) that users are familiar with, and these known folders are automatically included in the default libraries and set as the default save location.
Libraries are built upon the legacy known folders (such as My Documents, My Pictures, and My Music) that users are familiar with.
So I was wrong to mention libraries as libraries contian multiple folders. Issue actually occurs on folders. On Windows 11 “My Documents” is simply called “Documents” and you can change its location to any real folder on a drive. It was by default under C:\Users\user\Documents for me, but you can also put it like D:\Documents and issue would occur again. Libraries are like collection of multiple folders. Either way, this shouldn’t happen as legacy folders do exist and are not virtual.
I tried right click “Run as Administrator”, but I get same issue. Issue is very obvious as you say, Syncthing doesn’t have permission to access these folders in order to make hidden .stfolder in them, but I don’t know how to add permissions to it.
This isn’t a common problem though, as normally Syncthing should be able to access the same paths the user which has launched it can. Could you copy and paste the whole command line output which you get when you start Syncthing? You can obfuscate personal information in it, but please leave the rest untouched.
I’m not sure about that, there’s a lot of stuff, what part would you need?
I even tried adding location as D:\Music\ .stfolder, but obviously that failed as well. If I make .stfolder in D:\Music it shows folder as “Out of sync” rather than “Stopped”.
[U2FLG] 2023/12/26 19:28:57 INFO: "Music" (folder code): Failed to sync 186 items
[U2FLG] 2023/12/26 19:28:57 INFO: Folder "Music" (folder code) isn't making sync progress - retrying in 1m1s.
[U2FLG] 2023/12/26 19:29:05 INFO: Adding folder "Test" (folder code)
[U2FLG] 2023/12/26 19:29:05 INFO: No stored folder metadata for "folder code"; recalculating
[U2FLG] 2023/12/26 19:29:05 INFO: Ready to synchronize "Test" (folder code) (sendreceive)
[U2FLG] 2023/12/26 19:29:05 INFO: Completed initial scan of sendreceive folder "Test" (folder code)
[U2FLG] 2023/12/26 19:32:37 INFO: Adding folder "Music" (folder code)
[U2FLG] 2023/12/26 19:32:37 INFO: No stored folder metadata for "folder code"; recalculating
[U2FLG] 2023/12/26 19:32:37 WARNING: Failed to create folder marker: mkdir \\?\D:\Music\Music (folder code)\.stfolder: The system cannot find the file specified.
[U2FLG] 2023/12/26 19:32:37 INFO: Ready to synchronize "Music" (folder code) (sendreceive)
[U2FLG] 2023/12/26 19:32:37 INFO: Failed initial scan of sendreceive folder "Music" (folder code)
[U2FLG] 2023/12/26 19:32:37 WARNING: Error on folder "Music" (folder code): folder marker missing (this indicates potential data loss, search docs/forum to get information about how to proceed)
Can you look at the post above please? I’d really like to solve this issue. If I should send this to devs or somewhere else let me know. Thank you in advance.
No idea what could cause the problem, unfortunately. What if you try to create a completely different folder, e.g. D:\test-folder? Does it also fail with the same error messages?
Somehow I accidentally managed to delete my lengthy post. It’s astonishing how easily it can be deleted. In order to fix this “folder marker missing” problem, just go to Windows Security → Virus & threat protection → Manage settings → Controlled folder access. Here add syncthing.exe to whitelist as Windows Security blocks it from creating a .stfolder. That will allow you to make folders in any of Windows legacy ones (Documents, Music, Downloads etc.). Check this setting also for other programs because it works like a Windows Firewall and can block programs from doing even non-malicious regular tasks.