Permission Denied on any path I choose (FreeNAS)

(Jesse Moore) #1

If I try to create or use an existing directory on my FreeNAS (To replicate to another FreeNAS) I am met with permission denied.

So if I try to replicate for example /mnt/volume1 , or create a new directory (/replicationtest) Syncthing just comes up with the same error each time.

Help!

0 Likes

FreeNAS Syncthing plugin permissions strangeness
(Audrius Butkevicius) #2

Sorry, but I don’t understand what error comes from where. Do you actually have error messages? Also, does syncthing have the relevant permissions in the directory you are syncing to?

0 Likes

#3

Hey Jesse I’m no FreeBSD expert but it sounds like Syncthing don’t have permission to write to that folders. It can be that Syncthing is running under a different user name that don’t have access to that folders. So make sure your folders have the right permissions.

0 Likes

#4

I found a guide that maybe helpful to you. They explain on that website how to set the correct permissions.

0 Likes

(Jesse Moore) #5

Hi There,

So I installed the add-on via the plugin logged in as root.

I’m not sure how to find what user Syncthing is running under. I would have thought by default it would of allowed itself access to the FreeNAS file system! :unamused:

When creating a new Sync on the config page, I am told mkdir Permission denied on /mnt/Volume1 I presume it is doing an mkdir as it cannot verify a directory called Volume1 because it does have rights thus by default trying to create one which of course it shouldn’t be doing!

I’ve gone back a directory to /mnt which gives a different response “/mnt permission denied” without the mkdir.

0 Likes

Many Out of Sync items after inital sync
(Jakob Borg) #6

Indeed it does sound like syncthing is running as a specific user that does not have permission to the mount points in question. Exactly how this is intended to work can probably only be answered by the author of the FreeNAS package, or someone who uses it… :confused:

0 Likes

#7

Last week I set up syncthing on FreeNas following the guide at the aforementioned link:

Read the comment after the guide, it may provide more insight.

Considering it was my first time working with FreeNas, I found the guide everything I needed it to be to get it to work. It’s all there, print it out, read it over, highlight the salient parts, drink a beer, and follow it :smile:

0 Likes

(Oxxy Fx) #8

Hi, I spend considerable time trying to configure an already existing dataset to be synchronized to another server. The problem is/was that I did not want to change the ownership of the existing dataset. I followed the guide precisely, but I noticed a few things. I am running version 0.10.23. instead of changing the “Owner” of the dataset, I made the “syncthing” user member of the group which has all the rights to the dataset.

After that I was still getting permission denied errors. The resolution to the problem was the following:

  1. Follow the above guide, (https://www.zufallsheld.de/2014/12/14/installing-and-configuring-the-freenas-syncthing-plugin/) but do not change the owner of the dataset to syncthing, instead, after creating the “syncthing” user add “syncthing” user to the group which is already managing your dataset. Make sure the group has read/write/execute (777) privileges.

  2. Log in to the syncthing jail as described in the guide.

  3. Create a folder under the /media for your dataset to be mapped to

  4. Change the permission on the folder you just created to 777. (chmod 777 “yourfolder”)

  5. Go back to your Freenas interface and “Add a storage” to the jail corresponding to your syncthing_1. In the add storage window the “source” is the path to your existing dataset and the “destination” is the folder you created above /media/“yourfolder”

  6. Uncheck the “Create Directory” because this is already created and click OK.

  7. Now go to your syncthing interface, click on “Add Folder” and add the above /media/“yourfolder”

This should take care of the permission problems without compromising the existing permissions on the already existing dataset.

0 Likes

(JW0914) #9

Changing permissions to 777 [rwxrwxrwx] is not advised, unless you want unauthorized users to have full access to the data. Permissions should be set to 770 [rwxrwx—], or, at most, 775 [rwxrwxr-x] (774 [rwxrwxr–] is also acceptable).

If it’s a CIFS share that is set up with Windows ACLs, make sure you create the folder from Windows, then symlink it via the GUI or CLI. You’ll know this is correctly set up if there is a plus sign “+” following the permissions [rwxrwxr-x+]. The plus sign indicates the folder is setup with ACLs.

Please note, if the share is to be used on Windows, permissions must be set to a minimum of 5, otherwise the file will not be able to be read from within Windows.

0 Likes

(Jakob Borg) closed #10

This topic was automatically closed 29 days after the last reply. New replies are no longer allowed.

0 Likes