Syncthing hiding files on Truenas Scale SMB shares

I have a TrueNAS Scale homeserver/NAS running for a couple of months now and I recently noticed that my files synced from my laptop to this NAS are set to hidden on my NAS. I very rarely work directly on the SMB shares on my NAS. That’s why I did not notice this any earlier.

I don’t know if this behaviour was there when I started using this new NAS or if this started after an update for TrueNAS or the Syncthing app on TrueNAS Scale.

Digging around on the internet, I found that Synchting writes a temporary version of your file and prefixes this with a dot. SMB treats dot files as hidden and sets the hidden flag on the file. Once Synchting has synced the file, the prefixed dot is removed from the filename, but the hidden flag is not removed / changed. This seems to be a known issue.

Digging further on the internet it seems that SMB settings on the server could be set with an auxilary parameter ‘hide dot files’ Unfortunately setting these kinds of SMB options are removed from the TrueNAS Scale GUI. They could be set via CLI, but will be overwritten with each update.

Both my Linux laptop sees the files as hidden, my Windows pc sees the files as hidden.

I can’t be the only one having this kind of setup and issue.

How to deal with this?

  • Change SMB shares to NFS?
  • Don’t use TrueNAS Scale but something else?
  • Don’t bother about the hidden files?
  • Don’t use Syncthing anymore?
  • Have I overlooked something?

I’m running Truenas ElectricEel-24.10.2.1 Syncthing App Version: 1.29.5 Version: 1.1.17

Client Ubuntu 24.04.2 LTS x86_64 v1.27.2-ds4, Linux (64-bit Intel/AMD)

Any input is highly appreciated

I mean, it’s a Samba bug, and should be reported/treated accordingly. Perhaps it’s a feature request on TrueNAS to enable the corresponding workarounds.

I’m running same Truenas ElectricEel-24.10.2.1, however Syncthing App Version: 1.29.4 Version: 1.1.14. Also running same Client Ubuntu 24.04.2 LTS x86_64 v1.27.2-ds4, Linux (64-bit Intel/AMD). Also my syncthing folders reside in an SMB share on the Truenas server.

I have not encountered the hidden files issue you describe.

One thing that occurs to me is that I’ve configured syncthing using a hostpath to the SMB dataset. Thus syncthing isn’t using Samba. Maybe you’ve configured syncthing to instead mount your SMB share as a SMB/CIFS volume?

If so, maybe that could be the difference. (Let me know if there are any other settings you’d like to compare.)

Could you clarify that for me? Have you configured this in Syncthing on the NAS or on your client pc?

Ok, I’ll have a look how I configured Syncthing on my NAS when I get home.

Ok, I got home. It seems I added every Syncthing folder/path as SMB shares in Syncthing and not as host path’s.

On changing them, I lost my existing Syncthing config… So it’ll take some time to get that fixed again…

Ok, please post when you find out if this does/doesn’t fix the hidden files issue for you. I may have another idea…

Ok, I’ve tried to modify the existing Syncthing paths on my NAS, but I ended up nowhere. I have reinstalled the app on my NAS, but stumble over the same problem: for each folder I want to share I get a permission denied warning. I guess that was exactly the reason why I chose a SMB share/folder when I set it up many months ago.

I have set up Syncthing using this tutorial: https://www.truenas.com/docs/scale/22.12/scaletutorials/apps/syncthing/

This is what my Syncthing config looks like on my NAS:

It seems the folder on my NAS is correctly shared with the Syncthing container, but Syncthing can’t write to it.

Opening the shell on the Syncthing app reveals that the folder is correctly mounted:

But Synchting can’t write to it.

I just don’t know what user is being used to write to the host folder withing the Sycnthing container. (root? apps? …)

Yes it’s user ‘apps’. From Truenas Shares I think it’s the 2nd icon that looks like a shield and leads to an ACL editor. What I did was add user ‘apps’, same as if it was one of my client users. Truenas should already know that there exists a user called ‘apps’, we just gotta give it permission to modify the smb share.

Afterwards for good measure toggle smb off and on again under System services.

Adding a screenshot for the visual learners. Even though your explanation is perfect.

Cool, thanks.

One more important setting…

From the Syncthing gui, not Truenas. For each syncthing folder residing on the server, edit the folder, go to Advanced, and enable “Ignore Permissions”.

Otherwise syncthing doesn’t think files are ever in sync. I think I had a folder full of .tmp’s before finding this setting.

Spent some time on this, but I can’t get it working. I redeployed the app using the documentation. Added ‘Additional Storage’ using a Host Path (and not a SMB Share as I had done previously).

The built-in apps user has full control permissions on the folder:

I restarted the service after change.

But I keep on getting a permission denied in Syncthing:

When opening a shell in the Syncthing container, I can write to the mount path configured in Syncthing (/mnt/POOL1/Photo/2025)

And the file gets written:

  1. 2025 is not a dataset, right?

  2. Can your linux client write a file to the smb share? Both at the base level and in the 2025 directory?

  3. Screenshot ls -la /mnt/POOL1/Photo and ls -la /mnt/POOL1/Photo/2025 and I can compare permissions with mine.

  4. Your previous touch /mnt/POOL1/Photo/2025/test.txt from syncthing shell is useful, but doesn’t tell the whole story because the syncthing shell is running as user ‘root’, from the perspective of the containerized app. (Which can be confirmed with whoami.)

  5. Output of the two ls -la will help determine next steps.

  6. Have you tried this lately: from syncthing gui Add a brand new test folder in Photo, and see if syncthing gui complains about permissions or not?

Yes I have added a Testfolder in the syncthing app. The folder is created, I shared it with my client pc. The folder appears. I added a file in the testfolder, the file does not appear and I get an out-of-sync error.

Interesting: this testfolder is owned by apps. All the other folders on my Photo dataset are owned by user koen (me). Some of the subfolders in 2025 seem to be onwned by me, but also user 3003.

And if you enable “Ignore Permissions” on TESTFOLDER, and rescan, does the Out of Sync change to Up to Date?

If that doesn’t fix it, try also enabling “Ignore Permissions” on the folder at the other end of the link.

If we get this syncing properly, then we’ll attack 2025 next…

Ok, setting the Ignore Permission fixed that

Ok. Wasn’t sure how it works in a syncthing Send & Receive environment. For my use-case I make my server folders Receive Only, and my client folders Send Only. My clients are master, and nothing that happens on my server (including mishaps) can mess up my clients.

For your 2025 folder, I can think of two approaches. A) Start from scratch, assuming nothing vital resides in that folder. B) Try to chown/chmod our way to victory with existing contents.

I much prefer A because of send/receive caveat, we’ll get a brand new syncthing database, it’s less error prone and just feels cleaner in general.

A) First remove the 2025 folder from Syncthing gui (Edit then Remove). Then delete the actual 2025 folder. Either from your linux machine, or if that doesn’t work, could do a rm -rf /mnt/POOL1/Photo/2025 from the syncthing shell or the Truenas shell. Caution rm -rf is a dangerous command if you get it wrong! Then Add the 2025 folder from scratch in syncthing gui. (I can’t tell whether the subfolders in 2025 are syncthing folders, or just existing subdirectories on your client machine(s). I’m guessing the latter?)

-OR-

B) Subject to above send/receive caveat, I’d hate for the existing server folder(s) and existing syncthing database(s) to mess up your client folder(s)! From syncthing shell chown -R 568 /mnt/POOL1/Photo/2025. If that doesn’t work then from Truenas shell sudo chown -R apps /mnt/POOL1/Photo/2025. Syncthing shell refers to Truenas user ‘apps’ as user ‘568’. (Can confirm by first doing ls -la /mnt/POOL1/Photo from syncthing shell.) Truenas shell knows about user ‘apps’ as user ‘apps’. Same caution with chown -R, would do damage if entered wrong!

Ok,

I have moved my files in the 2025 to a backup place. Removed that 2025 folder from the NAS. Recreated this folder in Synchting, set the Ignore permissions in the advanced tab. Shared it with my linux client laptop. Added some files and folders from the backup location to this 2025 folder on my client laptop and let Syncthing sync.

I didn’t get the permissions error and my synced files are not hidden on the SMB share.

I guess it’s now working as it is supposed to, but I’ll have recreate all my sync tasks…