What happened?
The Windows 10/11+ Protected Folders feature results in file not found, and only in the Notifications you see the alert, and click that to end up in the "Protection History" where you click to expand and find:
There used to be some atypical GetLastError() for the intended use case process, it still might be.
If an infected file is found, there are error codes (via https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499- )
ERROR_VIRUS_INFECTED
225 (0xE1)
Operation did not complete successfully because the file contains a virus or potentially unwanted software.
ERROR_VIRUS_DELETED
226 (0xE2)
This file contains a virus or potentially unwanted software and cannot be opened. Due to the nature of this virus or potentially unwanted software, the file has been removed from this location.
But your error message says Not found, indicates
ERROR_FILE_NOT_FOUND
2 (0x2)
The system cannot find the file specified.
ERROR_PATH_NOT_FOUND
3 (0x3)
The system cannot find the path specified.
Edit 3: Solved. It was windows 'ransomware protection'. Python wasn't allowed to write to my working directory.
Is a relevant example post.
The particulars:
FileNotFoundError Traceback (most recent call last) <ipython-input-10-c7d3eec16936> in <module> 2 3 if not os.path.exists(newpath): ----> 4 os.makedirs(newpath) # SNIP ~\Anaconda3\lib\os.py in makedirs(name, mode, exist_ok) 219 return 220 try: --> 221 mkdir(name, mode) 222 except OSError: 223 # Cannot rely on checking for EEXIST, since the operating system <-------- clue FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\WorkDir\\Video
The clue.
An exist is performed which still might yield true (it exist), yet the expected Write to a file (that exist) might yield atypical Not found instead of Access Denied (due to ie, cannot write while a file is locked by zyx) or ... well, it depends, in this case its a local fixed drive in the user profile, without links (junctions, hardlink, symbolic link) or other magic.
Important use-case:
you can set specific directories manually to be protected, examples say %USERPROFILE%.ssh or %APPDATA%\gnupg or something that could be used as an infection vector or hijacking of files/paths due to how windows defer to search paths in case a filename only is provided (look up dll hijacking, 'put your own bad custom dll in the program but rename it a specific system dll', ie LoadLibrary() vs LoadLibraryEx)
Syncthing version
v1.29.1
Platform & operating system
Winddows 11 23H2 (build 22631.4751)
Browser version
Not Applicable
