You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fs watcher silently drops all events for folders under a macOS synthetic.conf symlink (EvalSymlinks'd root vs. unresolved FSEvents paths) #10953
On macOS, a folder whose path goes through a synthetic.conf root symlink (e.g. /data2 → /System/Volumes/Data/data2) never receives filesystem watcher events. Changes are only picked up by the periodic full rescan (up to rescanIntervalS late). No error is reported anywhere: folder watchError is empty, and nothing is logged even with fs and watchaggregator at DEBUG (only No tracked events, waiting for new event.).
Steps to reproduce
/etc/synthetic.conf contains data2<TAB>System/Volumes/Data/data2, reboot. /data2 is now a root-level symlink to /System/Volumes/Data/data2.
Add a folder with path /data2/test, watcher enabled, fsWatcherDelayS=1.
Create a file in it.
Expected: the file is in the index within a few seconds. Actual: /rest/db/file still says "No such object in the index" after 20+ seconds; only a manual/periodic scan picks it up.
Control, same Syncthing instance, temporary unshared folders created side by side:
Pausing/resuming the folder (restarting the watcher) makes no difference.
Cause (from reading the code)
watchPaths in lib/fs/basicfs_unix.go resolves the root with filepath.EvalSymlinks, so roots is ["/System/Volumes/Data/data2/test"]. But FSEvents reports event paths with the /data2/... prefix. I verified this with a minimal FSEvents program (FSEventStreamCreate + kFSEventStreamCreateFlagFileEvents): whether it watches /data2/test or /System/Volumes/Data/data2/test, every event arrives as /data2/test/<file>.
So in Watch, absShouldIgnore → unrootedChecked(absPath, roots) fails for every event and returns true, and the event is dropped silently at the filter stage. That's why there is no "event outside of the filesystem root" error either.
This is roughly the reverse of #5043: resolving symlinks fixed the case where the backend reports resolved paths, but macOS synthetic root symlinks are reported unresolved.
Possible fix
Accept both forms, e.g. in watchPaths return roots containing the evaluated root and, when it differs, f.root as well (unrootedChecked already iterates over multiple roots).
watchPaths is byte-identical in v2.1.5, v2.1.7 and current main.
Syncthing version
v2.1.5 (Homebrew; code path unchanged in v2.1.7 / main)
Platform & operating system
macOS 27.0.1, arm64 (Apple Silicon)
Relevant log output
# fs + watchaggregator at DEBUG, after pausing/resuming the folder and creating a file in it (paths anonymized):
basic /data2/test Watch . Matcher/[]@0x... false<nil>
Started filesystem watcher (folder.id=...)
aggregator/"..." (...): No tracked events, waiting for new event.
# (nothing else; the file is never picked up until the next rescan)
Activity