[11.2] Syncthing, chmod 'operation not permitted'

Sokonomi

Contributor
Joined
Jul 15, 2018
Messages
115
I've been trying to set up syncthing for a while now, but I just cant get it to behave normally.
Ive got it running on FreeNAS in a jail with accessible mountpoints, and on a windows 10 computer.

The problem is that the folder I share from my windows computer arent being synced.
On the NAS side, the folder sits at 0% with thousands of failed items, all of them reading
shortcut chmod: chmod <FILENAME>: operation not permitted

Base folder settings read
drwxrwxr-x 4 syncthing syncthing 5 Jan 15 17:57 cloud

Im a bit of a FreeBSD novice and an afternoon of googling the problem has me asking here. :(
Does anyone know where I might start looking for a clue as to why this is refusing to work?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
If the dateset is configured as a windows dateset then you can't chmod files. This is probably what is happening to you. What is the output of zfs get aclmode <datasetname>?
 

Sokonomi

Contributor
Joined
Jul 15, 2018
Messages
115
The output of zfs get aclmode Tank1 is
Code:
root@NASty[~]# zfs get aclmode Tank1
NAME   PROPERTY  VALUE        SOURCE
Tank1  aclmode   passthrough  local


A snippet from the log;
2019-01-16 18:17:27 Puller (folder "Sven (Home)" (uvwgg-xavav), file "Work/Catalogs/A320/A320PF350.1.jpg"): shortcut chmod: chmod /media/cloud/Sven/Work/Catalogs/A320/A320PF350.1.jpg: operation not permitted
It just repeats this a couple thousand times, for every file thats in the folder.

I've attempted to set user/group properly, and made sure its all on chmod 775.
By all accounts it should be able to do what it needs to do to that particular dataset.
Even on root/wheel with chmod 777 its not budging.
It still refuses to complete a folderscan.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Tank1 is the name of the dataset you share via smb and the dataset you mount in your jail? Tank1 kind of sounds like a pool root.

what is the output of "zfs get aclmode"? don't do the dataset part.
 

Sokonomi

Contributor
Joined
Jul 15, 2018
Messages
115
Sorry, I made a mistake.
It was supposed to be dataset 'Cloud' which resides in 'Tank1'.
So;
Code:
root@NASty[~]# zfs get aclmode Tank1/Cloud
NAME         PROPERTY  VALUE        SOURCE
Tank1/Cloud  aclmode   restricted   local

I can see a hint emerging from this.. Is that the problem?

This dataset is set to 'ACL type : Unix'
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
So Tank1/Cloud is set to restricted that means it's a windows dataset and you can not do unix type permission changes. So no chmod. You need to set it to 'aclmode=passthrough' for synthing to work. You can still share the dataset using smb but some permissions get a little funky but since you talked about 777'ing things it seems like you don't really care about permissions.
 

Sokonomi

Contributor
Joined
Jul 15, 2018
Messages
115
So what do I do to make this work again?
Can I simply flip it over to passthrough and have it go about its business as it should?
The dataset is only meant for syncthing, nothing else.

I've only tried 777 because literally nothing else I could find was working.
I just wanted to see it functioning and worry about patting down the doors later.
 
Last edited:

Sokonomi

Contributor
Joined
Jul 15, 2018
Messages
115
Update; I just chose the nuclear option.
Deleted the dataset and made a new one, now it seems to work.
As to why it suddenly decided to turn the dataset restricted is beyond me though..
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
It doesn't suddenly do it. It happens when you share via smb.
 

Sokonomi

Contributor
Joined
Jul 15, 2018
Messages
115
ACL was set to Unix, and there was no SMB share.
Syncthing in a jail was the only thing capable of accessing this dataset,
other than maybe cramming into it through SSH as root.
So why it ended up restricted, beats me.
 

adirburke

Cadet
Joined
Feb 17, 2023
Messages
4
So Tank1/Cloud is set to restricted that means it's a windows dataset and you can not do unix type permission changes. So no chmod. You need to set it to 'aclmode=passthrough' for synthing to work. You can still share the dataset using smb but some permissions get a little funky but since you talked about 777'ing things it seems like you don't really care about permissions.
I love you! Hours of searching !
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421

D_J_Westy

Cadet
Joined
Nov 17, 2020
Messages
3
So my syncthing is mounted to a 'Media' dataset that is also shared over SMB. I have files going to it as receive only as backup for my photo management software (I have the main files on PC where it's much faster to access and edit).

I manually changed the zfs aclmode to passthrough and it finally works after hours of headscratching. Haven't noticed anything weird with the SMB share yet. I know it's probably wrong to have the plugin mounted to an SMB shared dateset but...it's just at home and I am learning how things work still.
 
Top