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
Syncthing v1.27.11 on desktop claims there are Local Additions for all folders from Android v1.27.10 #9677
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 discussion
After upgrading to Syncthing v1.27.11 on my desktop, it claims all my receive-only folders have Local Additions. These are being synced from Syncthing on Android v1.27.10. Reverting to v1.27.10 on desktop and disabling upgrades fixes the issue. Comparing hashes of the files shows that they never changed.
Syncthing version
v1.27.11
Platform & operating system
Windows x64
Browser version
No response
Relevant log output
No response
Reacted by Max, Daniel, Mzdyl, Resshi, alvinhochun and Anim Mouse
changed the title [-]Symcthing v1.27.11 on desktop claims there are Local Additions for all folders from Android v1.27.10[/-][+]Syncthing v1.27.11 on desktop claims there are Local Additions for all folders from Android v1.27.10[/+]on Sep 3, 2024
That certainly makes sense in that said PR touches the filesystem layer. However I have no clue yet what happens/goes wrong. Just in case there's an additional hint to be had there: What exactly did you do to narrow that down?
Also could you check the involved filenames on disk on devices - any case differences? E.g. the ".pdf" being ".PDF" somewhere else.
I presume not, the case fs doesn't change names, it just ensures there's no conflicts, but I am grasping for any straws. Also if anyone disagrees that case fs doesn't change names, that would be helpful info too - then I could see how we lose mtimefs info.
@tomasz1986 If you could provide debug logs with scanner and walkfs logs while reproducing the issue, that would be great too. If you can reproduce in isolation with a single file, that's of course best, but I'll also take huge dumps to sift through (privately if necessary). For reproducing I'd almost bet you need to set it up on 1.27.10 to get the file into the DB, and then upgrade - I would not be surprised if directly starting on 1.27.11 doesn't show the same problem.
The err: {} for mtime also looks suspicious - in other places that's err: null. Probably not relevant though: It's definitely an error type that gets marshalled, and that would result in a string if non-nil/empty.
Sorry for being too brief (it was late at night 🙁). I just cherry-picked the commit on top of v1.27.10.
Also could you check the involved filenames on disk on devices - any case differences? E.g. the ".pdf" being ".PDF" somewhere else.
That's not it for sure. All files in my random test folder were marked as "local additions", with no exception.
Just for the record, what I did specifically when testing was:
Still at v1.27.10 on both sides, share the /sdcard/Download folder from Android to a Windows device.
Accept the folder on Windows as Receive Only under a completely new path, and let it sync.
At this point, the folder is "Up to Date" on both sides.
Shut Syncthing down on Windows, upgrade it to v1.27.10+7517d18, then restart.
All files in the folder are now marked "local additions".
@tomasz1986 If you could provide debug logs with scanner and walkfs logs while reproducing the issue, that would be great too. If you can reproduce in isolation with a single file, that's of course best, but I'll also take huge dumps to sift through (privately if necessary). For reproducing I'd almost bet you need to set it up on 1.27.10 to get the file into the DB, and then upgrade - I would not be surprised if directly starting on 1.27.11 doesn't show the same problem.
I didn't look at the code yet, but I suspect this is a question of mtimefs wrapping. The loss of precision in the timestamp looks like we're now looking at the raw on-disk timestamp instead of the one returned by mtimefs.
So a couple of things that may be relevant, the mtimefs has a case insensitivity option that I don't see that we ever set (?) and I wonder if the switcheroo makes a difference if we no longer case-sanitise the folder root for walking, making the existing mtimefs entries no longer match?
Do you need the same from the Android side or is this enough? Asking because I forgot to enable debug logging there 😳, so I would have to repeat the process.
mtimefs has a case insensitivity option that I don't see that we ever set (?)
That confused me too when I created the test. As far as I see it never was used except for tests. So I just ignored it.
if we no longer case-sanitise the folder root for walking, making the existing mtimefs entries no longer match?
mtimefs stores it's stuff by relative paths, so the root being sanitised or not shouldn't matter. And we anyway never case-resolve the root. Actually we never "resolve" a case ever, we only complain if there's a case conflict. We do not change the casing to the "correct one" in the case filesystem layer. That's why I fail to see how changing the order could lead to not finding entries in mtimefs. It very much looks like that's happening though. Then again if all files are affected, it might not even be directly related to case lookups but some other wrapping failure.
@tomasz1986 Haven't yet have time to look at the logs - thanks for providing them. I don't think the android side is relevant at all except maybe for context, so no debug logging there should be fine.
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 discussion
Activity
[-]Symcthing v1.27.11 on desktop claims there are Local Additions for all folders from Android v1.27.10[/-][+]Syncthing v1.27.11 on desktop claims there are Local Additions for all folders from Android v1.27.10[/+]Knaspin commentedon Sep 3, 2024
Having the same issue. Also checked hashes between files and they remained unchanged.
In my case, it is only affecting Windows clients with 1.27.11. Other clients do not show "Local Additions" after syncing.
Going back to 1.27.10 on the Windows machines (but keeping the Linux machines on 1.27.11) solves the issue.
tomasz1986 commentedon Sep 3, 2024
I can confirm the issue. It happens when using v1.27.11 on Windows. The Android side can still be on v1.27.10 (or older).
I've compared a sample file. The left is Android, the right is Windows.
Edit: I can also confirm that downgrading to Syncthing v1.27.10 gets read of the "local additions".
This is the same comparison as above but with v1.27.10. The left is Android, the right is Windows.
tomasz1986 commentedon Sep 3, 2024
I've narrowed down the culprit to 7517d18.
imsodin commentedon Sep 4, 2024
The info from the mtimefs layer is missing in 1.27.11, resulting in truncated mtime and thus the difference.
That certainly makes sense in that said PR touches the filesystem layer. However I have no clue yet what happens/goes wrong. Just in case there's an additional hint to be had there: What exactly did you do to narrow that down?
imsodin commentedon Sep 4, 2024
Also could you check the involved filenames on disk on devices - any case differences? E.g. the ".pdf" being ".PDF" somewhere else.
I presume not, the case fs doesn't change names, it just ensures there's no conflicts, but I am grasping for any straws. Also if anyone disagrees that case fs doesn't change names, that would be helpful info too - then I could see how we lose mtimefs info.
@tomasz1986 If you could provide debug logs with scanner and walkfs logs while reproducing the issue, that would be great too. If you can reproduce in isolation with a single file, that's of course best, but I'll also take huge dumps to sift through (privately if necessary). For reproducing I'd almost bet you need to set it up on 1.27.10 to get the file into the DB, and then upgrade - I would not be surprised if directly starting on 1.27.11 doesn't show the same problem.
imsodin commentedon Sep 4, 2024
The
err: {}for mtime also looks suspicious - in other places that'serr: null. Probably not relevant though: It's definitely an error type that gets marshalled, and that would result in a string if non-nil/empty.tomasz1986 commentedon Sep 4, 2024
Sorry for being too brief (it was late at night 🙁). I just cherry-picked the commit on top of v1.27.10.
That's not it for sure. All files in my random test folder were marked as "local additions", with no exception.
Just for the record, what I did specifically when testing was:
/sdcard/Downloadfolder from Android to a Windows device.Will provide the logs soon 🙂.
calmh commentedon Sep 4, 2024
I didn't look at the code yet, but I suspect this is a question of mtimefs wrapping. The loss of precision in the timestamp looks like we're now looking at the raw on-disk timestamp instead of the one returned by mtimefs.
imsodin commentedon Sep 4, 2024
Yep, indeed. I tried to write a reproducer based on that assumption but failed. Do you spot anything wrong with it? #9680
calmh commentedon Sep 4, 2024
So a couple of things that may be relevant, the mtimefs has a case insensitivity option that I don't see that we ever set (?) and I wonder if the switcheroo makes a difference if we no longer case-sanitise the folder root for walking, making the existing mtimefs entries no longer match?
tomasz1986 commentedon Sep 4, 2024
This is a debug log from the Windows side:
syncthing-windows.log
Do you need the same from the Android side or is this enough? Asking because I forgot to enable debug logging there 😳, so I would have to repeat the process.
Edit:
Adding the Android non-debug log for context:
syncthing-android.log
imsodin commentedon Sep 4, 2024
That confused me too when I created the test. As far as I see it never was used except for tests. So I just ignored it.
mtimefs stores it's stuff by relative paths, so the root being sanitised or not shouldn't matter. And we anyway never case-resolve the root. Actually we never "resolve" a case ever, we only complain if there's a case conflict. We do not change the casing to the "correct one" in the case filesystem layer. That's why I fail to see how changing the order could lead to not finding entries in mtimefs. It very much looks like that's happening though. Then again if all files are affected, it might not even be directly related to case lookups but some other wrapping failure.
@tomasz1986 Haven't yet have time to look at the logs - thanks for providing them. I don't think the android side is relevant at all except maybe for context, so no debug logging there should be fine.
10 remaining items
lib/fs: Add test reproducing missing mtimefs issue (ref syncthing#9677)
lib/fs: Add test reproducing missing mtimefs issue (ref syncthing#9677)
lib/fs: Add test reproducing missing mtimefs issue (ref syncthing#9677)
lib/fs: Add test reproducing missing mtimefs issue (ref syncthing#9677)
lib/fs: Add test reproducing missing mtimefs issue (ref syncthing#9677)
lib/fs: Add test reproducing missing mtimefs issue (ref syncthing#9677)
lib/fs: Add test reproducing missing mtimefs issue (ref syncthing#9677)
lib/fs: Add test reproducing missing mtimefs issue (ref #9677) (#9687)
chore(fs): Only cache the cache for case FS, not the entire FS
chore(fs): Only cache the cache for case FS, not the entire FS
chore(fs): only cache the cache for case FS, not the entire FS
chore(fs): only cache the cache for case FS, not the entire FS (#9701)
chore(fs): only cache the cache for case FS, not the entire FS (synct…