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
Frequent rescans due to group ownership issue #9879
bugA problem with current functionality, as opposed to missing functionality (enhancement)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussionneeds-triageNew issues needed to be validated
I have two Linux machines, each running syncthing as root, keeping multiple directory trees in sync. I know that this is not recommended, but I have multiple users on both machines and I wand to run just one instance of ST. It works as expected.
However, I noticed full rescans every 10-15 seconds. A large number of files is briefly shown as out-of-sync in the web interface, the same ones again and again.
Finally I found that all those files had group id 1000, which had different names on the two machines, and one group name didn't even exist on the other machine at all. After changing the groups to match, these rescans stopped.
It seems that this situation isn't being handled well right now. There were no helpful log messages.
I'm also getting files constantly resynced between two machines: one Linux/ZFS, the other an iMac with modifications being claimed on both sides. I can cause all these files in a small folder to be 'modified' on-demand by simply pressing "Rescan".
I can get this to stop if I stop syncing ownership. I.e. hitting "Rescan" doesn't sync anything. Unlike the author, I haven't tried changing my uids/gids to match.
I followed the Syncthing documentation regarding owner sync. I have setup for each file in this small folder:
iMac: Uid=501/mark, Gid=20/staff
Linux: Uid=3000/mark, Gid=50/staff
Syncthing is doing the right thing for me in finding an alternative Uid/Gid to match on the Linux side as I sync primarily from iMac -> Linux.
I have a feeling that this is involved as my change times are never the same on both sides (about 10s apart, I suspect due to the fs watcher time). So I ran some experiments clicking rescan from the Linux/ZFS side:
Sync Ownership on = all files detected as changed.
Send Ownership on only = all files detected as changed.
Sync Extended attributes on (Sync/Send ownership off) = no files detected as changed.
So mabye it is having a ctime difference and having a uid/gid difference that's causing the files to contantly sync.
On further examination it seems change times are never set; only read. This behaviour seems a bit contradictory to me. Could someone confirm, and also whether this seems relevant to this issue? I can raise another if required.
I wonder now whether change times might not be the issue here. They don't appear to be stored in the database, thus the global version seems to have a change time of 0 and won't trigger a rescan. This would make sense with my testing showing that the syncing of extended attributes not being a problem.
Which I think is what the poster is referring to. For me also, I am syncing between Linux and Darwin platforms, so the platforms are different.
Syncthing has a very good feature where it will look up the uid/gid on the destination side, but that intellegence is lost here. I am not going to submit a pull request, but it seems that syncthing should be storing the uids and gids on both sides to make a better comparison. Right now this seems like a lost feature and the workaround is to make sure they are the same, at least when the unix platforms are different.
I have installed Syncthing (v1.29.2) on two Macs (absolutely running macOS). What I encountered is that files are continuously syncing, never stopping. I read this issue and turned "Sync Extended Attributes" off, and it soon showed me "Up to Date". I tested in a separate folder (both in internal and external disks, respectively, including only one file) and confirmed that the issue exists. Here, the only file synced almost every 10 seconds and the "File Created Time" was only showed on the device where it was created. In other words, it seemed like that attribute never really synced, causing a difference being noticed by the watcher and showing a 10 seconds interval between every sync.
However, things seems to be a little different here. I tried turning on "Sync Ownership" and/or "Sync Extended Attributes", and found when the latter is turned on, regardless of the former, the issue shows up. It is the "Sync Extended Attributes" setting that goes wrong instead of "Sync Ownership".
Also, I can provide additional information if required. Thank you all for working on this issue and the amazing software.
bugA problem with current functionality, as opposed to missing functionality (enhancement)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussionneeds-triageNew issues needed to be validated
Activity
astralbat commentedon Jan 30, 2025
I'm also getting files constantly resynced between two machines: one Linux/ZFS, the other an iMac with modifications being claimed on both sides. I can cause all these files in a small folder to be 'modified' on-demand by simply pressing "Rescan".
I can get this to stop if I stop syncing ownership. I.e. hitting "Rescan" doesn't sync anything. Unlike the author, I haven't tried changing my uids/gids to match.
I followed the Syncthing documentation regarding owner sync. I have setup for each file in this small folder:
Syncthing is doing the right thing for me in finding an alternative Uid/Gid to match on the Linux side as I sync primarily from iMac -> Linux.
astralbat commentedon Jan 30, 2025
In
syncthing/lib/protocol/bep_fileinfo.go
Lines 427 to 431 in 124673f
I have a feeling that this is involved as my change times are never the same on both sides (about 10s apart, I suspect due to the fs watcher time). So I ran some experiments clicking rescan from the Linux/ZFS side:
So mabye it is having a ctime difference and having a uid/gid difference that's causing the files to contantly sync.
astralbat commentedon Feb 3, 2025
On further examination it seems change times are never set; only read. This behaviour seems a bit contradictory to me. Could someone confirm, and also whether this seems relevant to this issue? I can raise another if required.
astralbat commentedon Feb 3, 2025
I wonder now whether change times might not be the issue here. They don't appear to be stored in the database, thus the global version seems to have a change time of 0 and won't trigger a rescan. This would make sense with my testing showing that the syncing of extended attributes not being a problem.
Further down however:
syncthing/lib/protocol/bep_fileinfo.go
Lines 441 to 448 in b300c29
And:
syncthing/lib/protocol/bep_fileinfo.go
Lines 845 to 855 in b300c29
Which I think is what the poster is referring to. For me also, I am syncing between Linux and Darwin platforms, so the platforms are different.
Syncthing has a very good feature where it will look up the uid/gid on the destination side, but that intellegence is lost here. I am not going to submit a pull request, but it seems that syncthing should be storing the uids and gids on both sides to make a better comparison. Right now this seems like a lost feature and the workaround is to make sure they are the same, at least when the unix platforms are different.
astralbat commentedon Feb 3, 2025
As with the poster, after setting uids and gids to be the same on both sides, I am no longer picking any files when pressing the rescan button.
huanqiugame commentedon Feb 8, 2025
I have installed Syncthing (v1.29.2) on two Macs (absolutely running macOS). What I encountered is that files are continuously syncing, never stopping. I read this issue and turned "Sync Extended Attributes" off, and it soon showed me "Up to Date". I tested in a separate folder (both in internal and external disks, respectively, including only one file) and confirmed that the issue exists. Here, the only file synced almost every 10 seconds and the "File Created Time" was only showed on the device where it was created. In other words, it seemed like that attribute never really synced, causing a difference being noticed by the watcher and showing a 10 seconds interval between every sync.
However, things seems to be a little different here. I tried turning on "Sync Ownership" and/or "Sync Extended Attributes", and found when the latter is turned on, regardless of the former, the issue shows up. It is the "Sync Extended Attributes" setting that goes wrong instead of "Sync Ownership".
Also, I can provide additional information if required. Thank you all for working on this issue and the amazing software.
fix(protocol): slightly loosen/correct ownership comparison criteria (f…
fix(protocol): slightly loosen/correct ownership comparison criteria (f…
Merge branch 'main' into jb/slog
Feature/merge upstream (#21)
chore(deps): update syncthing/syncthing docker tag to v2 (#2048)