SyncThing - Directory Access Denied

Status
Not open for further replies.

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949

Spencer Skinner

Contributor
Joined
Dec 22, 2016
Messages
179

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Ahhh right that could be one of the issues, the "admin" is a group and the user within "admin" is "spencer". But the owner of the dataset in question is "syncthing" can i just set the owner user of the dataset to "spencer"?
everything should still work.

but as it stands, 'spencer' should already be avle to write using group permissions
 

Spencer Skinner

Contributor
Joined
Dec 22, 2016
Messages
179
Right ok ive also just noticed a mistake on my part, i noticed that "share type" and "permission type" on a dataset are two entirely separate things, that does change things a bit ahaha
 

Spencer Skinner

Contributor
Joined
Dec 22, 2016
Messages
179
I assume that for this all to work the "Permission type" MUST stay as UNIX?

I cant believe i never noticed that mistake before ahaha
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
I assume that for this all to work the "Permission type" MUST stay as UNIX?

I cant believe i never noticed that mistake before ahaha
I never enable windows permissions, but you might be able to get it to work with them. I just dont use them or help with them.

your files currently dont have them, since I dont see a "+" at the end of the permission levels
 

Spencer Skinner

Contributor
Joined
Dec 22, 2016
Messages
179
I never enable windows permissions, but you might be able to get it to work with them. I just dont use them or help with them.

your files currently dont have them, since I dont see a "+" at the end of the permission levels

Yeh im gonna try and avoid the windows permissions i think for all the places i intend to sync, the issue now stands as my whole server is configured for windows permissions ahahaha sooooo thats going to need some work i think
 

Spencer Skinner

Contributor
Joined
Dec 22, 2016
Messages
179
Good news, ive started to sync all my data in tests after changing all the permissions and it seems to be working wonders to be honest

Ill make sure to get back to you if i start running into issues but so far its looking like im gonna be alright.

Wont speak too soon though. ahaha
 

Spencer Skinner

Contributor
Joined
Dec 22, 2016
Messages
179
Riiight so here is the issue....
I broke it again.....


Here is the results of the ls command for you
Code:
[root@freenas ~]# jls                                                           
   JID  IP Address      Hostname                      Path                     
     1  -               plexmediaserver_1             /mnt/AlphaVolume/jails/ple
xmediaserver_1                                                                 
     2  -               syncthing_1                   /mnt/AlphaVolume/jails/syn
cthing_1                                                                       
[root@freenas ~]# jexec 2 tcsh                                                 
root@syncthing_1:/ # ls -l /meida                                               
ls: /meida: No such file or directory                                           
root@syncthing_1:/ # ls -l /media                                               
total 34                                                                       
drwxrwx---  13 1001  admin  17 Feb  3 18:54 collegesync                         
drwxrwx---   9 1001  admin  10 Feb  3 12:06 gamesync                           
drwxrwx---   2 root  wheel   2 Feb  3 19:55 sync                               
root@syncthing_1:/ #  


And here is the error im now getting -
Code:
2017-02-03 20:01:29: Loading ignores: open /media/sync/.stignore: permission denied

2017-02-03 20:01:29: Creating folder marker: open /media/sync/.stfolder: permission denied

2017-02-03 20:01:29: Stopping folder "SyncTest" (rtaly-zclpb) - folder path missing


Permission types are all set to UNIX and the share type remains as Windows, ive got no idea whats causing it.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Riiight so here is the issue....
I broke it again.....


Here is the results of the ls command for you
Code:
[root@freenas ~]# jls                                                          
   JID  IP Address      Hostname                      Path                    
     1  -               plexmediaserver_1             /mnt/AlphaVolume/jails/ple
xmediaserver_1                                                                
     2  -               syncthing_1                   /mnt/AlphaVolume/jails/syn
cthing_1                                                                      
[root@freenas ~]# jexec 2 tcsh                                                
root@syncthing_1:/ # ls -l /meida                                              
ls: /meida: No such file or directory                                          
root@syncthing_1:/ # ls -l /media                                              
total 34                                                                      
drwxrwx---  13 1001  admin  17 Feb  3 18:54 collegesync                        
drwxrwx---   9 1001  admin  10 Feb  3 12:06 gamesync                          
drwxrwx---   2 root  wheel   2 Feb  3 19:55 sync                              
root@syncthing_1:/ # 


And here is the error im now getting -
Code:
2017-02-03 20:01:29: Loading ignores: open /media/sync/.stignore: permission denied

2017-02-03 20:01:29: Creating folder marker: open /media/sync/.stfolder: permission denied

2017-02-03 20:01:29: Stopping folder "SyncTest" (rtaly-zclpb) - folder path missing


Permission types are all set to UNIX and the share type remains as Windows, ive got no idea whats causing it.
try to learn how to read the permission levels yourself.
the sync folder is owned by the user root and group wheel, instead of the 1001 and admin of the other folders.
 

Spencer Skinner

Contributor
Joined
Dec 22, 2016
Messages
179
try to learn how to read the permission levels yourself.
the sync folder is owned by the user root and group wheel, instead of the 1001 and admin of the other folders.

Yeh it would be advisable that i learn this stuff tbh ahaha

Ive had a play with the chown command

Code:
root@syncthing_1:/ # chown 983:1001 /media/gamesync                            
root@syncthing_1:/ # chown 983:1001 /media/collegesync                        
root@syncthing_1:/ # chown 983:1001 /media/sync                                
root@syncthing_1:/ # ls -l /media                                              
total 34                                                                      
drwxrwx---  13 syncthing  admin  17 Feb  3 18:54 collegesync                  
drwxrwx---   9 syncthing  admin  10 Feb  3 12:06 gamesync                      
drwxrwx---   2 syncthing  admin   2 Feb  3 19:55 sync                          
root@syncthing_1:/ #


Any fatal mistakes here?

EDIT - It doesnt seem to be fussing about the permissions anymore on syncthing if that is anything to go by
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Yeh it would be advisable that i learn this stuff tbh ahaha

Ive had a play with the chown command

Code:
root@syncthing_1:/ # chown 983:1001 /media/gamesync                           
root@syncthing_1:/ # chown 983:1001 /media/collegesync                       
root@syncthing_1:/ # chown 983:1001 /media/sync                               
root@syncthing_1:/ # ls -l /media                                             
total 34                                                                     
drwxrwx---  13 syncthing  admin  17 Feb  3 18:54 collegesync                 
drwxrwx---   9 syncthing  admin  10 Feb  3 12:06 gamesync                     
drwxrwx---   2 syncthing  admin   2 Feb  3 19:55 sync                         
root@syncthing_1:/ #


Any fatal mistakes here?

EDIT - It doesnt seem to be fussing about the permissions anymore on syncthing if that is anything to go by
nope that was good, just dont change permissions for more the folders containing your data
 

Spencer Skinner

Contributor
Joined
Dec 22, 2016
Messages
179
nope that was good, just dont change permissions for more the folders containing your data

What do you mean by more folders

Say i was to create another directory within media which would be used for syncing as those 3 are, would i not need to replicate the permissions on the new sync directory?

Also here is an ls command of the whole jail

Code:
root@syncthing_1:/ # ls -l /                                                   
total 178                                                                       
-rw-r--r--   2 root       wheel   966 Mar 25  2016 .cshrc                       
drwxr-xr-x   2 root       wheel     4 Feb  2 18:27 .plugins                     
-rw-r--r--   2 root       wheel   254 Mar 25  2016 .profile                     
-r--r--r--   1 root       wheel  6197 Mar 25  2016 COPYRIGHT                   
drwxr-xr-x   2 root       wheel    47 Mar 25  2016 bin                         
drwxr-xr-x   8 root       wheel    50 Mar 25  2016 boot                         
dr-xr-xr-x  11 root       wheel   512 Feb  3 20:09 dev                         
drwxr-xr-x  23 root       wheel   107 Feb  3 20:09 etc                         
drwxr-xr-x   3 root       wheel    52 Mar 25  2016 lib                         
drwxr-xr-x   3 root       wheel     5 Mar 31  2016 libexec                     
drwxrwx---   5 syncthing  admin     5 Feb  3 19:55 media                       
drwxr-xr-x   2 root       wheel     2 Mar 25  2016 mnt                         
dr-xr-xr-x   1 root       wheel     0 Feb  3 20:23 proc                         
drwxr-xr-x   2 root       wheel   146 Mar 25  2016 rescue                       
drwxr-xr-x   2 root       wheel     7 Feb  2 18:57 root                         
drwxr-xr-x   2 root       wheel   132 Mar 25  2016 sbin                         
lrwxr-xr-x   1 root       wheel    11 Mar 25  2016 sys -> usr/src/sys           
drwxrwxrwt   6 root       wheel     6 Feb  3 20:09 tmp                         
drwxr-xr-x  15 root       wheel    15 Feb  2 18:27 usr                         
drwxr-xr-x  25 root       wheel    25 Feb  3 20:09 var                         
root@syncthing_1:/ #            


Anything silly done there either?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
What do you mean by more folders

Say i was to create another directory within media which would be used for syncing as those 3 are, would i not need to replicate the permissions on the new sync directory?

Also here is an ls command of the whole jail

Code:
root@syncthing_1:/ # ls -l /                                                  
total 178                                                                      
-rw-r--r--   2 root       wheel   966 Mar 25  2016 .cshrc                      
drwxr-xr-x   2 root       wheel     4 Feb  2 18:27 .plugins                    
-rw-r--r--   2 root       wheel   254 Mar 25  2016 .profile                    
-r--r--r--   1 root       wheel  6197 Mar 25  2016 COPYRIGHT                  
drwxr-xr-x   2 root       wheel    47 Mar 25  2016 bin                        
drwxr-xr-x   8 root       wheel    50 Mar 25  2016 boot                        
dr-xr-xr-x  11 root       wheel   512 Feb  3 20:09 dev                        
drwxr-xr-x  23 root       wheel   107 Feb  3 20:09 etc                        
drwxr-xr-x   3 root       wheel    52 Mar 25  2016 lib                        
drwxr-xr-x   3 root       wheel     5 Mar 31  2016 libexec                    
drwxrwx---   5 syncthing  admin     5 Feb  3 19:55 media                      
drwxr-xr-x   2 root       wheel     2 Mar 25  2016 mnt                        
dr-xr-xr-x   1 root       wheel     0 Feb  3 20:23 proc                        
drwxr-xr-x   2 root       wheel   146 Mar 25  2016 rescue                      
drwxr-xr-x   2 root       wheel     7 Feb  2 18:57 root                        
drwxr-xr-x   2 root       wheel   132 Mar 25  2016 sbin                        
lrwxr-xr-x   1 root       wheel    11 Mar 25  2016 sys -> usr/src/sys          
drwxrwxrwt   6 root       wheel     6 Feb  3 20:09 tmp                        
drwxr-xr-x  15 root       wheel    15 Feb  2 18:27 usr                        
drwxr-xr-x  25 root       wheel    25 Feb  3 20:09 var                        
root@syncthing_1:/ #           


Anything silly done there either?
thats fine, just dont change the permissions for / cause that could screw up your jail
 

Spencer Skinner

Contributor
Joined
Dec 22, 2016
Messages
179
thats fine, just dont change the permissions for / cause that could screw up your jail

Ok no scratch that its not working its unable to sync, its able to access the directory but it isnt able to write anything to it. not quite sure. Ive litterally re installed syncthing just to make it clean again, probably un necacary
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Ok no scratch that its not working its unable to sync, its able to access the directory but it isnt able to write anything to it. not quite sure. Ive litterally re installed syncthing just to make it clean again, probably un necacary
so it's not working again?
 

Spencer Skinner

Contributor
Joined
Dec 22, 2016
Messages
179
so it's not working again?

Nope its broken again, right so what ive done is ive used your guide to add the 'admin' group and the 'spencer' user to the jail, ive set 'spencer' as the jails owner as shown in your guide.

Then ive set the owner groups and users on the sync directories to 'admin' and 'spencer'

Syncthing is unable to write to the server but is able to read from it and then send data to other clients
 

Spencer Skinner

Contributor
Joined
Dec 22, 2016
Messages
179
1b.PNG


here is all the permissions for the directories

Code:
root@syncthing_1:/ # ls -l /                                                   
total 162                                                                       
-rw-r--r--   2 root     wheel   966 Mar 25  2016 .cshrc                         
drwxr-xr-x   2 root     wheel     4 Feb  3 20:53 .plugins                       
-rw-r--r--   2 root     wheel   254 Mar 25  2016 .profile                       
-r--r--r--   1 root     wheel  6197 Mar 25  2016 COPYRIGHT                     
drwxr-xr-x   2 root     wheel    47 Mar 25  2016 bin                           
drwxr-xr-x   8 root     wheel    50 Mar 25  2016 boot                           
dr-xr-xr-x  14 root     wheel   512 Feb  3 21:25 dev                           
drwxr-xr-x  23 root     wheel   107 Feb  3 21:29 etc                           
drwxr-xr-x   3 root     wheel    52 Mar 25  2016 lib                           
drwxr-xr-x   3 root     wheel     5 Mar 31  2016 libexec                       
drwxr-xr-x   3 spencer  admin     3 Feb  3 21:04 media                         
drwxr-xr-x   2 root     wheel     2 Mar 25  2016 mnt                           
dr-xr-xr-x   1 root     wheel     0 Feb  3 21:34 proc                           
drwxr-xr-x   2 root     wheel   146 Mar 25  2016 rescue                         
drwxr-xr-x   2 root     wheel     6 Mar 25  2016 root                           
drwxr-xr-x   2 root     wheel   132 Mar 25  2016 sbin                           
lrwxr-xr-x   1 root     wheel    11 Mar 25  2016 sys -> usr/src/sys             
drwxrwxrwt   6 root     wheel     6 Feb  3 21:26 tmp                           
drwxr-xr-x  15 root     wheel    15 Feb  3 20:53 usr                           
drwxr-xr-x  25 root     wheel    25 Feb  3 21:25 var                           
root@syncthing_1:/ #                      


Code:
root@syncthing_1:/ # ls -l /media                                               
total 17                                                                       
drwxrwxr-x+ 13 spencer  admin  29 Feb  3 21:27 collegesync                     
root@syncthing_1:/ #
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Nope its broken again, right so what ive done is ive used your guide to add the 'admin' group and the 'spencer' user to the jail, ive set 'spencer' as the jails owner as shown in your guide.

Then ive set the owner groups and users on the sync directories to 'admin' and 'spencer'

Syncthing is unable to write to the server but is able to read from it and then send data to other clients
you should never change the owner or permission levels of the jails datasets. that will break them.

you should..
add the user and or group as you did
set the ownership/group permission levels of the dataset you will use for sync
change the syncthing service to use this user with 7XX, or add syncthing user to the group with 77X
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
View attachment 15783

here is all the permissions for the directories

Code:
root@syncthing_1:/ # ls -l /                                                  
total 162                                                                      
-rw-r--r--   2 root     wheel   966 Mar 25  2016 .cshrc                        
drwxr-xr-x   2 root     wheel     4 Feb  3 20:53 .plugins                      
-rw-r--r--   2 root     wheel   254 Mar 25  2016 .profile                      
-r--r--r--   1 root     wheel  6197 Mar 25  2016 COPYRIGHT                    
drwxr-xr-x   2 root     wheel    47 Mar 25  2016 bin                          
drwxr-xr-x   8 root     wheel    50 Mar 25  2016 boot                          
dr-xr-xr-x  14 root     wheel   512 Feb  3 21:25 dev                          
drwxr-xr-x  23 root     wheel   107 Feb  3 21:29 etc                          
drwxr-xr-x   3 root     wheel    52 Mar 25  2016 lib                          
drwxr-xr-x   3 root     wheel     5 Mar 31  2016 libexec                      
drwxr-xr-x   3 spencer  admin     3 Feb  3 21:04 media                        
drwxr-xr-x   2 root     wheel     2 Mar 25  2016 mnt                          
dr-xr-xr-x   1 root     wheel     0 Feb  3 21:34 proc                          
drwxr-xr-x   2 root     wheel   146 Mar 25  2016 rescue                        
drwxr-xr-x   2 root     wheel     6 Mar 25  2016 root                          
drwxr-xr-x   2 root     wheel   132 Mar 25  2016 sbin                          
lrwxr-xr-x   1 root     wheel    11 Mar 25  2016 sys -> usr/src/sys            
drwxrwxrwt   6 root     wheel     6 Feb  3 21:26 tmp                          
drwxr-xr-x  15 root     wheel    15 Feb  3 20:53 usr                          
drwxr-xr-x  25 root     wheel    25 Feb  3 21:25 var                          
root@syncthing_1:/ #                     


Code:
root@syncthing_1:/ # ls -l /media                                              
total 17                                                                      
drwxrwxr-x+ 13 spencer  admin  29 Feb  3 21:27 collegesync                    
root@syncthing_1:/ #
did you change the user syncthing runs as, or add the syncthing user to the admin group like I proscribed earlier?
 
Status
Not open for further replies.
Top