Unable to Folder chmod mask without File chmod mask (which fails)

I’m running into a small permission issue on my Synology.

The main issues is, that to be able to allow Plex to remove files, I need the folder to have group write access. By default, Sonarr only gives the series folder read access for group.

So I changed the permission setting in to change the folder to 775 and the files to 664.
The change on the files gives me an EPERM error message, which can be explained to the fact that Sonarr isn’t the owner of the file but transmission is (using hardlink). It’s not a biggie, but it’s contaminating the logs.

Sonarr won’t allow me to only change the folder mask, if the files permission is empty, the settings won’t save.

Series Folder:
drwxrwxr-x 2 nzbdrone users 4096 Sep 29 08:54 S…

Series Episode:
-rw-rw-r-- 2 transmis users 1782340506 Sep 29 08:49 S…

Log error message:
Unable to apply permissions to: /volume1/Sonarr/S…/S…mkv: Error setting file permissions: EPERM

NzbDrone.Mono.LinuxPermissionsException: Error setting file permissions: EPERM
at NzbDrone.Mono.DiskProvider.SetPermissions (System.String path, System.String mask, System.String user, System.String group) [0x00107] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Mono\DiskProvider.cs:117
at NzbDrone.Core.MediaFiles.MediaFileAttributeService.SetMonoPermissions (System.String path, System.String permissions) [0x0000e] in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\MediaFiles\MediaFileAttributeService.cs:88

If the files are owned by the downloader why don’t you change the umask in transmission to 002 and disable the chmod in sonarr?

As far as i understood, in *nix, delete permissions aren’t file based but folder based. Plex already has write permissions on the file (664 and plex is in group)

Sonarr creates the series folder, and transmission doesn’t know it exists. So i don’t see how setting the transmission umask would affect the sonarr series folder.

Yes that’s correct, the folder permission rules for deleting.

Some time ago i did notice this in logs unable to set permissions so i disabled it and issued a cron for resetting to default permissions to 775(664) every 4 hours or so.

Now, i haven’t look recently but i just turn on the settings and added a series and the log shows correctly setting permission in 775 mode and folder also displays the folder owned as sonarr:users in 775 mode.
I am using debian 7 and the latest develop version. What version is in Synology?

The Synology package supports application updates, so I’m running the latest master.

I’ll do a recheck on the folder creation permission without chmod active in the logs when I get home.
I didn’t go through the logs, because deletes stopped working for newly added series after I disabled the feature, and just did a ls -ltr in *nix.

Edit: I think I fully broke it with my tinkering :blush: it’s not applying any permission atm. Shouldn’t go around and poking in the Syno layer and the *nix layer at the same time…

Edit2:
With chmod on:
15-9-29 13:23:39.4|Debug|DiskProvider|Setting permissions: 0775 on /volume1/Sonarr/A…
drwxrwxr-x 2 nzbdrone users 4096 Sep 29 13:23 A…

With chmod off:
Nothing in the log-files
d--------- 2 nzbdrone users 4096 Sep 29 13:26 A…
All files in the directory are also without permissions.

Edit 3: I need to tinker with the Sonarr dir permissions. mkdir in *nix is also creating the permissionless dirs atm.

Edit 4: Not exactly sure what I changed, but it seems to have to due to the fact that the Synology has an additional permission layer on top of the *Nix layer. Therefore trying to fix it through *nix was the wrong approach. Tinkering with the settings in the Synology layer resolved it.
Still find it strange change file and change folder can’t be used exclsuively though, and there is no way to only change one setting.

What happened your post was too long?

No, I just did reply instead of edit, which is against last poster forum guidelines, so I removed it.

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