Skip to content

Creating staggered versions fails due to wrong folder permissions #10532

Closed

Description

@sagamusix

What happened?

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.

Syncthing version

v2.0.13

Platform & operating system

Linux arm64

Browser version

Relevant log output

Activity

  1. added theissue type on Jan 19, 2026
  2. added
    bug
    needs-triage
    on Jan 19, 2026
  3. steadytao commented on Feb 14, 2026

    @steadytao
    Contributor

    I will start looking into this, could you confirm the following on the affected Debian systems?

    • What umask is Syncthing running with?
    • Is the folder on a special filesystem such as CIFS/NFS/FUSE or standard ext4?

    The 0555 intermediate directory suggests the mode may be getting masked rather than randomly set incorrectly

  4. sagamusix commented on Feb 14, 2026

    @sagamusix
    Author
  5. steadytao commented on Feb 14, 2026

    @steadytao
    Contributor

    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

  6. SixFive7 commented on May 17, 2026

    @SixFive7

    Opened #10695 for this.

  7. added 2 commits that reference this issue on May 23, 2026
    5464970
    69fa9d8
  8. added a commit that references this issue on Jun 4, 2026
    4eb00ab
  9. added a commit that references this issue on Jun 28, 2026
    a4dadaa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-triage

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions