Syncing folders with group permission

I want to sync my Nextcloud Notes folder with syncthing. The folder is owned by apache and syncthing is running under user syncthing so I created a shared group apachenc and added both apache and syncthing users to it. The folder permissions look like this:

namei -l /mnt/mybook/nextcloud_data/my_user/files/Notes
f: /mnt/mybook/nextcloud_data/my_user/files/Notes
drwxr-xr-x root   root     /
drwxr-xr-x root   root     mnt
drwxrwsrwx root   root     mybook
drwxrwx--- apache apachenc nextcloud_data
drwxrwsr-x apache apachenc my_user
drwxrwsr-x apache apachenc files
drwxrws--- apache apachenc Notes

This seems to work fine for all files in the Notes folder but for all folders inside Notes/ I get the error: Puller (folder "wiki" (tnzwv-f3azf), item "Rezepte"): syncing: handling dir (setting permissions): chmod /mnt/mybook/nextcloud_data/my_user/files/Notes/Rezepte: operation not permitted

The permissions of that “Rezepte” folder look like this:

f: /mnt/mybook/nextcloud_data/my_user/files/Notes/Rezepte/
drwxr-xr-x root   root     /
drwxr-xr-x root   root     mnt
drwxrwsrwx root   root     mybook
drwxrwx--- apache apachenc nextcloud_data
drwxrwsr-x apache apachenc my_user
drwxrwsr-x apache apachenc files
drwxrws--- apache apachenc Notes
drwxrwx--- apache apachenc Rezepte

Why does syncthing need to change the permissions of that folder? It’s already owned by the correct group and has the correct permissions. What am I missing here?

If I’m creating a new folder in Notes/ it gets synced without any problems having the same permissions than the already existing folders.

Any help would be appreciated.

Note: Syncing permissions is disabled. These are my settings for that folder:

    <folder id="tnzwv-f3azf" label="wiki" path="/mnt/mybook/nextcloud_data/myuser/files/Notes" type="sendreceive" rescanIntervalS="3600" fsWatcherEnabled="true" fsWatcherDelayS="10" ignorePerms="false" autoNormalize="true">
        <filesystemType>basic</filesystemType>
        <device id="5EFNGQY-T4O4QG3-EQLKQU6-3AHBS2A-K5E3QSJ-CVV6XX2-MNKZMNG-TRYSXQX" introducedBy="">
            <encryptionPassword></encryptionPassword>
        </device>
        <device id="5ZHB3NR-BL6NAZR-BG5QXEC-6QLHJMM-MM2MR52-INKYEU7-GZKVROV-TKOXXQN" introducedBy="">
            <encryptionPassword></encryptionPassword>
        </device>
        <minDiskFree unit="%">1</minDiskFree>
        <versioning>
            <cleanupIntervalS>3600</cleanupIntervalS>
            <fsPath></fsPath>
            <fsType>basic</fsType>
        </versioning>
        <copiers>0</copiers>
        <pullerMaxPendingKiB>0</pullerMaxPendingKiB>
        <hashers>0</hashers>
        <order>random</order>
        <ignoreDelete>false</ignoreDelete>
        <scanProgressIntervalS>0</scanProgressIntervalS>
        <pullerPauseS>0</pullerPauseS>
        <maxConflicts>10</maxConflicts>
        <disableSparseFiles>false</disableSparseFiles>
        <disableTempIndexes>false</disableTempIndexes>
        <paused>false</paused>
        <weakHashThresholdPct>25</weakHashThresholdPct>
        <markerName>.stfolder</markerName>
        <copyOwnershipFromParent>false</copyOwnershipFromParent>
        <modTimeWindowS>0</modTimeWindowS>
        <maxConcurrentWrites>2</maxConcurrentWrites>
        <disableFsync>false</disableFsync>
        <blockPullOrder>standard</blockPullOrder>
        <copyRangeMethod>standard</copyRangeMethod>
        <caseSensitiveFS>false</caseSensitiveFS>
        <junctionsAsDirs>false</junctionsAsDirs>
        <syncOwnership>false</syncOwnership>
        <sendOwnership>false</sendOwnership>
        <syncXattrs>false</syncXattrs>
        <sendXattrs>false</sendXattrs>
        <xattrFilter>
            <maxSingleEntrySize>1024</maxSingleEntrySize>
            <maxTotalSize>4096</maxTotalSize>
        </xattrFilter>
    </folder>

You say that “syncing permissions is disabled”, but the config snippet you show has ignorePerms="false" which is the opposite. With that set I would expect it to work (or at least, not fail due to not being able to chmod).

1 Like

right my bad… That worked, thanks a lot! Let’s see if this setup is viable or not…