I’m having a strange issue running Syncthing on my TrueNAS box. It can create new directories (top-level share folder, .stfolder
, or regular sub-folders within the share), but it goes out of sync if a remote device pushes a file.
The exact error reported in the UI is “operation not permitted” / “syncing: finishing: opening temp file: open /path/to/share/.syncthing.foo.jpg.tmp: operation not permitted” for a given file named “foo.jpg”.
(I have tested with files called literally “foo.jpg”, so this is nothing to do with special chars in the filenames.)
Bizzarely, Syncthing does actually create the temp file on disk, despite the “not permitted” error. It shows up as an empty file. Permissions are managed with an ACL, so the files may be owned by root:root, but are still writeable when logged in as the “apps” user (same user that Syncthing runs as). For good measure, it’s possible to manipulate files with touch
, mv
, rm
, etc as the same user in the share folder.
The main thing is that chmod
can’t be used. This is a limitation of TrueNAS (the reasoning is a bit convoluted; Syncthing actually mounts the share folder as an NFS volume). The error doesn’t mention chmod or permissions, but if Syncthing is trying to set any particular permissions, that’s probably the issue. However, I see the same behavior even with “ignore permissions” set on both devices. Everything runs fine without the NFS layer in the middle.
Any suggestions are appreciated. I’m currently wondering if there’s a way to get more granularity from the “not permitted” error, or if there’s a hidden setting to really ignore permissions.
Running version v1.23.5 installed via TrueCharts on TrueNAS SCALE 22.12.3.1
Log (attempt to pull baz.jpg, all debug logging facilities ON)
2023-06-26 18:50:19 http: GET "https://172.16.0.90:8384/rest/noauth/health": status 307, 79 bytes in 0.03 ms
2023-06-26 18:50:19 http: GET "https://172.16.0.90:8384/rest/noauth/health": status 307, 79 bytes in 0.02 ms
2023-06-26 18:50:19 http: GET "/rest/noauth/health": status 200, 21 bytes in 0.06 ms
2023-06-26 18:50:19 http: GET "/rest/noauth/health": status 200, 21 bytes in 0.10 ms
2023-06-26 18:50:20 http: GET "/rest/system/log?since=2023-06-26T18%3A50%3A17.070659647-04%3A00": status 200, 965 bytes in 0.19 ms
2023-06-26 18:50:21 http: GET "/rest/system/discovery": status 200, 969 bytes in 0.65 ms
2023-06-26 18:50:21 http: GET "/rest/system/status": status 200, 4652 bytes in 1.67 ms
2023-06-26 18:50:21 http: GET "/rest/system/connections": status 200, 1411 bytes in 0.24 ms
2023-06-26 18:50:21 http: GET "/rest/system/error": status 200, 21 bytes in 0.10 ms
2023-06-26 18:50:22 handle index-update for 19fb9-veeue message
2023-06-26 18:50:22 queueing IndexUpdate(362XLTQ-J3DBHPM-WITU2L5-6D33IZW-YNYL64Y-GJL6FIW-G7O2NAX-GTTSTAV, 19fb9-veeue, 2 files)
2023-06-26 18:50:22 Index update (in): 362XLTQ-J3DBHPM-WITU2L5-6D33IZW-YNYL64Y-GJL6FIW-G7O2NAX-GTTSTAV / "19fb9-veeue": 2 files
2023-06-26 18:50:22 19fb9-veeue Update(362XLTQ-J3DBHPM-WITU2L5-6D33IZW-YNYL64Y-GJL6FIW-G7O2NAX-GTTSTAV, [2])
2023-06-26 18:50:22 insert (remote); folder="19fb9-veeue" device=362XLTQ-J3DBHPM-WITU2L5-6D33IZW-YNYL64Y-GJL6FIW-G7O2NAX-GTTSTAV File{Name:"baz.jpg", Sequence:14, Permissions:0660, ModTime:2023-06-26 17:43:03.003785472 -0400 EDT, Version:{[{362XLTQ 1687819821}]}, VersionHash:, Length:303196, Deleted:false, Invalid:false, LocalFlags:0x0, NoPermissions:true, BlockSize:131072, NumBlocks:3, BlocksHash:7f01c3aeb7c4a9a2495ccee24f799616130db2bbd32b4bb31c25a31f4b778fd4, Platform:{<nil> <nil> <nil> <nil> <nil> <nil>}, InodeChangeTime:1969-12-31 19:00:00 -0500 EST}
2023-06-26 18:50:22 update global; folder="19fb9-veeue" device=362XLTQ-J3DBHPM-WITU2L5-6D33IZW-YNYL64Y-GJL6FIW-G7O2NAX-GTTSTAV file="baz.jpg" version={[{362XLTQ 1687819821}]} invalid=false
2023-06-26 18:50:22 new global for "baz.jpg" after update: {{Version:{[{362XLTQ 1687819821}]}, Deleted:false, Devices:{362XLTQ}, Invalid:{}}}
2023-06-26 18:50:22 local need insert; folder="19fb9-veeue", name="baz.jpg"
2023-06-26 18:50:22 insert (remote); folder="19fb9-veeue" device=362XLTQ-J3DBHPM-WITU2L5-6D33IZW-YNYL64Y-GJL6FIW-G7O2NAX-GTTSTAV File{Name:"bar.jpg", Sequence:15, Permissions:0660, ModTime:2023-06-26 18:50:21.003785472 -0400 EDT, Version:{[{362XLTQ 1687819821}]}, VersionHash:, Length:0, Deleted:true, Invalid:false, LocalFlags:0x0, NoPermissions:true, BlockSize:131072, NumBlocks:0, BlocksHash:, Platform:{<nil> <nil> <nil> <nil> <nil> <nil>}, InodeChangeTime:1969-12-31 19:00:00 -0500 EST}
2023-06-26 18:50:22 update global; folder="19fb9-veeue" device=362XLTQ-J3DBHPM-WITU2L5-6D33IZW-YNYL64Y-GJL6FIW-G7O2NAX-GTTSTAV file="bar.jpg" version={[{362XLTQ 1687819821}]} invalid=false
2023-06-26 18:50:22 new global for "bar.jpg" after update: {{Version:{[{362XLTQ 1687819821}]}, Deleted:true, Devices:{362XLTQ}, Invalid:{}}}
2023-06-26 18:50:22 local need delete; folder="19fb9-veeue", name="bar.jpg"
2023-06-26 18:50:22 19fb9-veeue Snapshot()
2023-06-26 18:50:22 19fb9-veeue WithNeed(7777777-777777N-7777777-777777N-7777777-777777N-7777777-77777Q4)
2023-06-26 18:50:22 log 1154 RemoteIndexUpdated map[device:362XLTQ-J3DBHPM-WITU2L5-6D33IZW-YNYL64Y-GJL6FIW-G7O2NAX-GTTSTAV folder:19fb9-veeue items:2 sequence:15 version:15]
2023-06-26 18:50:22 http: GET "/rest/events?since=1110": status 200, 329 bytes in 42645.17 ms
2023-06-26 18:50:22 folderconfiguration.go:121 basic /mnt/Pictures/Test Stat . {0xc0014b2270} <nil>
2023-06-26 18:50:22 folderconfiguration.go:139 basic /mnt/Pictures/Test Stat .stfolder {0xc0014b2340} <nil>
2023-06-26 18:50:22 folder.go:334 basic /var/syncthing/config/index-v0.14.0.db Usage . {274753257472 274877906944} <nil>
2023-06-26 18:50:22 folderconfiguration.go:121 basic /mnt/Pictures/Test Stat . {0xc0014b2410} <nil>
2023-06-26 18:50:22 folderconfiguration.go:139 basic /mnt/Pictures/Test Stat .stfolder {0xc0014b24e0} <nil>
2023-06-26 18:50:22 folder.go:334 basic /var/syncthing/config/index-v0.14.0.db Usage . {274753257472 274877906944} <nil>
2023-06-26 18:50:22 receiveonly/19fb9-veeue@0xc000488800 pulling
2023-06-26 18:50:22 log 1155 StateChanged map[duration:389.545080322 folder:19fb9-veeue from:idle to:sync-waiting]
2023-06-26 18:50:22 log 1156 StateChanged map[duration:0.545251665 folder:19fb9-veeue from:sync-waiting to:sync-preparing]
2023-06-26 18:50:22 19fb9-veeue Snapshot()
2023-06-26 18:50:22 receiveonly/19fb9-veeue@0xc000488800 copiers: 2 pullerPendingKiB: 32768
2023-06-26 18:50:22 19fb9-veeue WithNeed(7777777-777777N-7777777-777777N-7777777-777777N-7777777-77777Q4)
2023-06-26 18:50:22 19fb9-veeue Get(baz.jpg)
2023-06-26 18:50:22 19fb9-veeue GetGlobal(baz.jpg)
2023-06-26 18:50:22 receiveonly/19fb9-veeue@0xc000488800 parent not missing baz.jpg
2023-06-26 18:50:22 19fb9-veeue Availability(baz.jpg)
2023-06-26 18:50:22 stats.DeviceStatisticsReference.WasSeen: 362XLTQ-J3DBHPM-WITU2L5-6D33IZW-YNYL64Y-GJL6FIW-G7O2NAX-GTTSTAV
2023-06-26 18:50:22 19fb9-veeue Get(baz.jpg)
2023-06-26 18:50:22 open: open /mnt/Pictures/Test/.syncthing.baz.jpg.tmp: no such file or directory
2023-06-26 18:50:22 http: GET "/rest/system/log?since=2023-06-26T18%3A50%3A19.427554368-04%3A00": status 200, 8283 bytes in 13.35 ms
2023-06-26 18:50:22 receiveonly/19fb9-veeue@0xc000488800 need file baz.jpg; copy 3, reused 0
2023-06-26 18:50:22 log 1157 ItemStarted map[action:update folder:19fb9-veeue item:baz.jpg type:file]
2023-06-26 18:50:22 folderconfiguration.go:274 basic /mnt/Pictures/Test Usage . {54254756691968 54263936974848} <nil>
2023-06-26 18:50:22 http: GET "/rest/events?since=1111": status 200, 777 bytes in 0.41 ms
2023-06-26 18:50:22 receiveonly/19fb9-veeue@0xc000488800 closing baz.jpg
2023-06-26 18:50:22 receiveonly/19fb9-veeue@0xc000488800 new error for baz.jpg: finishing: opening temp file: open /mnt/Pictures/Test/.syncthing.baz.jpg.tmp: operation not permitted
2023-06-26 18:50:22 progress emitter: deregistering 19fb9-veeue baz.jpg
2023-06-26 18:50:22 receiveonly/19fb9-veeue@0xc000488800 changed 1 on try 1
2023-06-26 18:50:22 19fb9-veeue Snapshot()
2023-06-26 18:50:22 receiveonly/19fb9-veeue@0xc000488800 copiers: 2 pullerPendingKiB: 32768
2023-06-26 18:50:22 19fb9-veeue WithNeed(7777777-777777N-7777777-777777N-7777777-777777N-7777777-77777Q4)
2023-06-26 18:50:22 log 1158 ItemFinished map[action:update error:0xc004584c20 folder:19fb9-veeue item:baz.jpg type:file]
2023-06-26 18:50:22 19fb9-veeue Get(baz.jpg)
2023-06-26 18:50:22 19fb9-veeue GetGlobal(baz.jpg)
2023-06-26 18:50:22 receiveonly/19fb9-veeue@0xc000488800 parent not missing baz.jpg
2023-06-26 18:50:22 19fb9-veeue Availability(baz.jpg)
2023-06-26 18:50:22 stats.DeviceStatisticsReference.WasSeen: 362XLTQ-J3DBHPM-WITU2L5-6D33IZW-YNYL64Y-GJL6FIW-G7O2NAX-GTTSTAV
2023-06-26 18:50:22 19fb9-veeue Get(baz.jpg)
2023-06-26 18:50:22 log 1159 ItemStarted map[action:update folder:19fb9-veeue item:baz.jpg type:file]
2023-06-26 18:50:22 receiveonly/19fb9-veeue@0xc000488800 need file baz.jpg; copy 3, reused 0
2023-06-26 18:50:22 basic /mnt/Pictures/Test Watch: Ignoring .syncthing.baz.jpg.tmp
2023-06-26 18:50:22 folderconfiguration.go:274 basic /mnt/Pictures/Test Usage . {54254756691968 54263936974848} <nil>
2023-06-26 18:50:22 http: GET "/rest/events?since=1114": status 200, 609 bytes in 0.37 ms
2023-06-26 18:50:22 receiveonly/19fb9-veeue@0xc000488800 closing baz.jpg
2023-06-26 18:50:22 receiveonly/19fb9-veeue@0xc000488800 new error for baz.jpg: finishing: opening temp file: open /mnt/Pictures/Test/.syncthing.baz.jpg.tmp: operation not permitted
2023-06-26 18:50:22 progress emitter: deregistering 19fb9-veeue baz.jpg
2023-06-26 18:50:22 receiveonly/19fb9-veeue@0xc000488800 changed 1 on try 2
2023-06-26 18:50:22 19fb9-veeue Snapshot()
2023-06-26 18:50:22 receiveonly/19fb9-veeue@0xc000488800 copiers: 2 pullerPendingKiB: 32768
2023-06-26 18:50:22 19fb9-veeue WithNeed(7777777-777777N-7777777-777777N-7777777-777777N-7777777-77777Q4)
2023-06-26 18:50:22 log 1160 ItemFinished map[action:update error:0xc0012b2f60 folder:19fb9-veeue item:baz.jpg type:file]
2023-06-26 18:50:22 19fb9-veeue Get(baz.jpg)
2023-06-26 18:50:22 19fb9-veeue GetGlobal(baz.jpg)
2023-06-26 18:50:22 receiveonly/19fb9-veeue@0xc000488800 parent not missing baz.jpg
2023-06-26 18:50:22 19fb9-veeue Availability(baz.jpg)
2023-06-26 18:50:22 stats.DeviceStatisticsReference.WasSeen: 362XLTQ-J3DBHPM-WITU2L5-6D33IZW-YNYL64Y-GJL6FIW-G7O2NAX-GTTSTAV
2023-06-26 18:50:22 19fb9-veeue Get(baz.jpg)
2023-06-26 18:50:22 receiveonly/19fb9-veeue@0xc000488800 need file baz.jpg; copy 3, reused 0
2023-06-26 18:50:22 log 1161 ItemStarted map[action:update folder:19fb9-veeue item:baz.jpg type:file]
2023-06-26 18:50:22 basic /mnt/Pictures/Test Watch: Ignoring .syncthing.baz.jpg.tmp
2023-06-26 18:50:22 folderconfiguration.go:274 basic /mnt/Pictures/Test Usage . {54254756691968 54263936974848} <nil>
2023-06-26 18:50:22 http: GET "/rest/events?since=1116": status 200, 609 bytes in 0.19 ms
2023-06-26 18:50:22 receiveonly/19fb9-veeue@0xc000488800 closing baz.jpg
2023-06-26 18:50:22 receiveonly/19fb9-veeue@0xc000488800 new error for baz.jpg: finishing: opening temp file: open /mnt/Pictures/Test/.syncthing.baz.jpg.tmp: operation not permitted
2023-06-26 18:50:22 progress emitter: deregistering 19fb9-veeue baz.jpg
2023-06-26 18:50:22 receiveonly/19fb9-veeue@0xc000488800 changed 1 on try 3
2023-06-26 18:50:22 Puller (folder "Test" (19fb9-veeue), item "baz.jpg"): syncing: finishing: opening temp file: open /mnt/Pictures/Test/.syncthing.baz.jpg.tmp: operation not permitted
2023-06-26 18:50:22 "Test" (19fb9-veeue): Failed to sync 1 items
2023-06-26 18:50:22 log 1162 ItemFinished map[action:update error:0xc000a89290 folder:19fb9-veeue item:baz.jpg type:file]
2023-06-26 18:50:22 log 1163 FolderErrors map[errors:[{baz.jpg syncing: finishing: opening temp file: open /mnt/Pictures/Test/.syncthing.baz.jpg.tmp: operation not permitted}] folder:19fb9-veeue]
2023-06-26 18:50:22 Folder "Test" (19fb9-veeue) isn't making sync progress - retrying in 1h4m0s.
2023-06-26 18:50:22 log 1164 StateChanged map[duration:0.656175123 folder:19fb9-veeue from:sync-preparing to:idle]
2023-06-26 18:50:22 19fb9-veeue Snapshot()
2023-06-26 18:50:22 progress emitter: bytes completed for 19fb9-veeue: 0
2023-06-26 18:50:22 19fb9-veeue Snapshot()
2023-06-26 18:50:22 model@0xc001482340 Completion(362XLTQ-J3DBHPM-WITU2L5-6D33IZW-YNYL64Y-GJL6FIW-G7O2NAX-GTTSTAV, "19fb9-veeue"): map[completion:100 globalBytes:303196 globalItems:1 needBytes:0 needDeletes:0 needItems:0 remoteState:valid sequence:15]
2023-06-26 18:50:22 log 1165 FolderSummary {19fb9-veeue 0xc000d50dc0}
2023-06-26 18:50:22 log 1166 FolderCompletion map[completion:100 device:362XLTQ-J3DBHPM-WITU2L5-6D33IZW-YNYL64Y-GJL6FIW-G7O2NAX-GTTSTAV folder:19fb9-veeue globalBytes:303196 globalItems:1 needBytes:0 needDeletes:0 needItems:0 remoteState:valid sequence:15]
2023-06-26 18:50:22 http: GET "/rest/events?since=1118": status 200, 2738 bytes in 0.46 ms