File permission problems everywhere

Every time I add a new show I’m getting the following permissions error.

I can’t see where the problem is, if I su to the sonarr user I can create the “/home/username/Video/tv/Blah” directory no problem.

Obviously the /home/username folders are owned by the user username, but the group is owned by “users” who the sonarr user is a part of (actually I’ve set the sonarr user to have “users” as its primary group.

System.UnauthorizedAccessException: Access to the path "/home/<removed>/Video/tv/Blah" is denied.
  at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00000] in <filename unknown>:0
  at System.IO.Directory.CreateDirectory (System.String path) [0x00000] in <filename unknown>:0
  at NzbDrone.Common.Disk.DiskProviderBase.CreateFolder (System.String path) [0x00000] in <filename unknown>:0
  at NzbDrone.Core.MediaFiles.DiskScanService.Scan (NzbDrone.Core.Tv.Series series) [0x00000] in <filename unknown>:0
  at NzbDrone.Core.MediaFiles.DiskScanService.Handle (NzbDrone.Core.Tv.Events.SeriesUpdatedEvent message) [0x00000] in <filename unknown>:0
  at NzbDrone.Core.Messaging.Events.EventAggregator.PublishEvent[SeriesUpdatedEvent] (NzbDrone.Core.Tv.Events.SeriesUpdatedEvent event) [0x00000] in <filename unknown>:0

What’s the issue? I can’t see what I may have missed

Humm, I’m not sure if I’ve solved it 100% yet but I’ve set it in Sonarr Settings > Media Management > Permissions

Chmod Task 775
chwon user sonarr
chown Group users

Only root can chown files and give them away, so its recommended that those fields are left blank.

The ownership settings apply to files Sonarr imports and folders it creates, the error above is because Sonarr can’t even create the folder. It looks like a permissions issue, check the permissions on /home/username/Video/tv/, but beyond that I’m not sure.

You’re also not running mono with the --debug flag.

Yes, you’re right about the chowning. I’ve checked and If I do a file rename and clean up I’m now able to do the rename, but can’t do the chown at the end. No loss so long as it can be modified by the group.

Well I’m not sure what fixed it, I don’t know if Sonarr doesn’t pick up group changes to its user while it’s still running, a restart may have fixed that

Ok I didn’t know I had to, I’ve fixed that in the running service just in case I need it.

Reference: https://github.com/Sonarr/Sonarr/wiki/Log-Files

You don’t need debug logging enabled all the time, the --debug mono switch reports more information to logs (line numbers is the big one) when its enabled, otherwise when something crashes we can’t tell exactly where its coming from.

Ok I think I see another problem here, when Sonarr moves a file from the /completed directory to the /TV/Series directory it’s leaving permissions like sonarr:sonarr 775 - In order for plex to pick this stuff up it at least needs to be in the users group.

How can I make Sonarr move files so that it’ll do something like sonarr:users 775?

Ok after digging around in the forums I’ve found this NzbDrone falsely claiming a lack of permissions when permission is given to group rather than user

Problem was that the permissions were set in the service file, I edited it as such:

[Service]
User=sonarr
Group=users

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