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
Creating staggered versions fails due to wrong folder permissions #10532
I couldn't find a corresponding issue, but in this forum thread it was mentioned that this is a bug that needs fixing, and I just ran into it again so I'm opening an issue here.
Here's the original description from the issue (updated to current version where this still happens):
I run Syncthing 2.0.13 on Windows as the source for the folder, and it is being mirrored to two Linux devices, both running Syncthing 2.0.13 on Debian 12 (from the official Syncthing apt repository).
The problem:
I have a small number of files in one specific shared folder that are not synchronized correctly anymore. The set of files is identical between the two Linux devices. The error message is always like this: syncing: finishing: moving for conflict: removing item to be replaced: staggered versioner: archive: mkdir /…/syncthing/dokumente/.stversions/a/b/c: permission denied
Even if I delete folder a inside .stversions, the same thing happens again later: a is created with the expected 755 permissions, however b is created with 555 and as a result c is not created at all, causing the versioned files to not be moved. Everything inside the syncthing folder belongs to the user that runs Syncthing. In other folders, the versioning folders are still created with the correct permissions as it seems.
This turned out to be a regression in how permissions are synchronised for version-store directories. If a source directory is read-only (e.g. 0555), the corresponding directory inside .stversions could inherit that restrictive mode. Over time, this can leave intermediate directories in the version store non-owner-writable, which then prevents creation of deeper nested paths during archive operations.
I’ve opened PR #10575 which ensures version-store directories remain owner-writable while preserving all other permission bits. It also includes a regression test reproducing the failure scenario described here.
Once merged, this should prevent .stversions from getting stuck in a read-only state and allow staggered versioning to continue working correctly
Activity
steadytao commentedon Feb 14, 2026
I will start looking into this, could you confirm the following on the affected Debian systems?
The 0555 intermediate directory suggests the mode may be getting masked rather than randomly set incorrectly
sagamusix commentedon Feb 14, 2026
steadytao commentedon Feb 14, 2026
This turned out to be a regression in how permissions are synchronised for version-store directories. If a source directory is read-only (e.g. 0555), the corresponding directory inside .stversions could inherit that restrictive mode. Over time, this can leave intermediate directories in the version store non-owner-writable, which then prevents creation of deeper nested paths during archive operations.
I’ve opened PR #10575 which ensures version-store directories remain owner-writable while preserving all other permission bits. It also includes a regression test reproducing the failure scenario described here.
Once merged, this should prevent .stversions from getting stuck in a read-only state and allow staggered versioning to continue working correctly
SixFive7 commentedon May 17, 2026
Opened #10695 for this.
fix(versioner): ensure user read/write/execute on archived dirs (fixes …
Merge remote-tracking branch 'upstream/main' into jb/morecrashrep
Merge branch 'main' into db-drop-dev-vs-index
[codex] Merge upstream stable v2.1.1 into main (#23)