SyncThing - GUI wont work with User Data Location set my NAS

The GUI of Syncthing will not connect when I point to a location on my NAS (/mnt/samba/dietpi_userdata) using Samba for the User Data Location for Dietpi. I can only connect to the GUI when this location is set the the original /mnt/dietpi_userdata using the microsd card (only 4GB)

I need to change away from the microSD card and use my NAS so that I don’t get any error messages due to memory shortage.

I thought it may have something to do with access privileges, but I’ve already input the username and password when setting up Samba.

Can anyone help?

Hi

I can only connect to the GUI when this location is set the the original /mnt/dietpi_userdata using the microsd card (only 4GB)

When using DietPi-Software to move to the userdata folder, DietPi will automatically symlink /mnt/dietpi_userdata to target, please verify with:

root@DietPi:~# ls -lha /mnt/dietpi_userdata
lrwxrwxrwx 1 dietpi dietpi 26 Feb 11 22:15 /mnt/dietpi_userdata -> /mnt/samba/dietpi_userdata

If the above is a match, then using /mnt/dietpi_userdata is correct. Essentially, you never need to change /mnt/dietpi_userdata in any installed programs, as long as you use DietPi to move the userdata.

So I verified the above and it all matched, though It doesn’t change that the GUI wont work with the User Data pointed to my NAS. As an experiment, I changed the User Data back to /mnt/dietpi_userdata and the GUI worked.

I’m not sure of the issue as when I use samba to point to my NAS for Squeezebox (on a different Pi), everything works fine. It’s only an issue using Syncthing.

For Syncthing, Isn’t is possible to have the User data pointed to the 4gb microSD card and the folders i’m trying to sync, automatically use the samba location. It would resolve alot of issues…

Thanks.

Hmm SyncThing uses dietpi as user, so the external file system (subfolder) needs to be owned by dietpi. Check/verify, that the filesystem supports user permissions: ls -l /mnt/samba/dietpi_userdata

We do permissions check and give info message, if it fails, but not block dietpi_userdata transfer in case.

So I got the following data…

root@DietPi-3B:~# ls -l /mnt/samba/dietpi_userdata
total 0
drwxr-xr-x 2 root root 0 Feb 11 22:28 downloads
drwxr-xr-x 2 root root 0 Feb 11 22:28 Music
drwxr-xr-x 2 root root 0 Feb 11 22:28 Pictures
drwxr-xr-x 2 root root 0 Feb 11 22:28 syncthing
drwxr-xr-x 2 root root 0 Feb 11 22:28 syncthing_data
drwxr-xr-x 2 root root 0 Feb 11 22:28 urbackup
drwxr-xr-x 2 root root 0 Feb 11 22:28 Video

# chown -R dietpi:dietpi /mnt/samba/dietpi_userdata

Is syncthing running as root or as dietpi?

How do I check for that? I always install programs from Dietpi having already SSH’d in as root. Otherwise, I never change any settings other than those shown on the Dietpi pages…

When I do:

chown -R dietpi:dietpi /mnt/samba/dietpi_userdata

Results:

dietpi@DietPi-3B:~$ chown -R dietpi:dietpi /mnt/samba/dietpi_userdata
chown: changing ownership of ‘/mnt/samba/dietpi_userdata/downloads’: Operation not permitted
chown: changing ownership of ‘/mnt/samba/dietpi_userdata/Music’: Operation not permitted
chown: changing ownership of ‘/mnt/samba/dietpi_userdata/Pictures’: Operation not permitted
chown: changing ownership of ‘/mnt/samba/dietpi_userdata/syncthing_data/.stfolder’: Operation not permitted
chown: changing ownership of ‘/mnt/samba/dietpi_userdata/syncthing_data’: Operation not permitted
chown: changing ownership of ‘/mnt/samba/dietpi_userdata/urbackup/urbackup_tmp_files’: Operation not permitted
chown: changing ownership of ‘/mnt/samba/dietpi_userdata/urbackup’: Operation not permitted
chown: changing ownership of ‘/mnt/samba/dietpi_userdata/Video’: Operation not permitted
chown: changing ownership of ‘/mnt/samba/dietpi_userdata/.swapfile’: Operation not permitted
chown: changing ownership of ‘/mnt/samba/dietpi_userdata/syncthing/cert.pem’: Operation not permitted
chown: changing ownership of ‘/mnt/samba/dietpi_userdata/syncthing/key.pem’: Operation not permitted
chown: changing ownership of ‘/mnt/samba/dietpi_userdata/syncthing/config.xml’: Operation not permitted
chown: changing ownership of ‘/mnt/samba/dietpi_userdata/syncthing’: Operation not permitted
chown: changing ownership of ‘/mnt/samba/dietpi_userdata’: Operation not permitted

Removed, incorrect info.

We’ll need to consider changing samba user to DietPi, by default?

Thanks for all your help…

Hmm and if e.g. ownCloud/Nextcloud datadir is then set to samba drive as well, maybe it is possible to add www-data to dietpi group and change permissions to 770? Or is this not possible as well? I will check, how samba + Nextcloud is solved usually. But hmm actually this doubles somehow the sync/share intention. Not sure if this is intended at all. Same for SyncThing+Samba. Also it brings the issue that manual/direct editing of ownCloud + Nextcloud files is not tracked by server/database then. Maybe one has to decide if sync via samba or SyncThing or other cloud solution…

Just found a German topic about that on Nextcloud forum: https://help.nextcloud.com/t/nextcloud-zusammen-mit-ftp-samba-nutzen/12758/9
Looks quite hacky to do manual rescanning data folder by Nextcloud after editing via samba. But the permissions were indeed solved via adding www-data to root group in that case and chmod 770. But better solution is to use the external folder features to integrate them directly to Nextcloud instead of adding the other way round Nextcloud folder to external/samba drive. But not sure if SyncThing offers integration of external dives as well.