You need to tell docker containers which user they have to “simulate” inside the container (PUID/PGID variables) for access as well. Easiest is to use the same user for all your containers, which has access to all folders it needs. Or different users in the same group, you get the idea.
Secondly, really don’t create all the bullshit separate volumes as advised by the linuxserver containers like /tv and /downloads etc.
Just create a single mount with the same name which points to the same location on your host and do this for all your docker containers. Then create subfolders underneath as required. Something generic like /data or /media…
That’s definitely the easiest. Both (or more) containers will share the same access rights on folders and if that user/group has sufficient access then everything Just Works
I don’t have NZBGet, but my torrent setup (Transmission, Jackett, Sonarr, and Radarr) is all Dockerised and running as admin, with only Plex being native.
If the Sonarr container is running as admin, then I’d suggest either running NBZGet as admin too, or running Sonarr as 777 (and disabling the chmod permissions in Sonarr, or at least testing it without first).
If you instead decide to use NZBGet in Docker, run it as admin (and keep Sonarr as admin).
Basically, run everything that will be interacting with each other, or the same files, under one user and set of permissions.
EDIT: I’ve never done it, but from what I’ve seen, trying to install apps natively onto an off-the-shelf NAS is a pain, unless the manufacturer supplies their own package (e.g. NZBGet).
My attention has turned to NZBGet, and the permissions it sets on downloads. I now believe that Sonarr isn’t able to move and rename because the file permissions set by NZBGet prevent it.
When I get Permissions in ADM’s file manager on folders inside:
volume1/Downloads/Completed_Shows/
*Including new series folders created by Sonarr
I notice that the Owner and Group permissions are:
Back to NZBGet > Settings > Security. Based on the info I found here: https://forum.nzbget.net/viewtopic.php?t=3140 I made sure the DaemonUsername = admin. Then changed the UMask = 0000
Then NZBGet > Settings > Unpack. Set UnrarCmd = unrar x -ai to ignore file attributes (permissions) that might be kept for the downloaded file.
No joy.
I think I need some way of changing the file ownership applied by NZBGet on new downloads to:
you’ll get a bunch of results, but typically go with the wisdom of the masses and choose the most popular one - though check when it was last updated. LinuxServer maintain a lot of images and are always a sure thing.
click on (in this case) linuxserver/nzbget and scroll down to (in this case) Usage
open Portainer and click on Containers, and then Add Container
now we’re basically going to translate what is under Usage into Portainer, anything I skip over leave as default
Name: NZBGet (or whatever you like really)
Image: linuxserver/nzbget (you can also use certain tags if you want to use dev builds, or an older version, but not adding one will just use the latest release build, the same as using linuxserver/nzbget:latest)
Manual network port publishing: click publish a new network port host: 6789 (or anything that isn’t already used, you’ve already noticed that Asustor adds a 1 to the start of the port number to avoid any conflicts. Whatever port you specify may need to be forwarded on your router and in ADM > Settings > Manual Connect > EZ-Router > Self define - e.g. NZBGet, TCP, 6789, 6789, 6789) container: 6789
Volumes: click map additional volumes container: /config (then click Bind) host: /volume1/Docker/NZBGet/config (or wherever you want, this is just the template Asustor would use)
Click map additional volumes again container: /downloads (then click Bind) host: /volume1/Download (or wherever you want)
Env: click add environment variable name: PUID value: 999 (or whatever is being used by Sonarr)
Click add environment variable again name: PGID value: 999 (or whatever is being used by Sonarr)
Click add environment variable again name: TZ value: Europe/London (or whatever is being used by Sonarr)
Restart policy:Unless stopped
Then click Deploy the container!
Hopefully it will be just that simple for you. Either way, let me know
Sorry, I just have to chime in here, whenever I see people pointing to the linuxserver containers.
Try to avoid making a plethora of specific mounts such as /downloads, /tv, /movies, /books, whatever.
The only exception is /config and this one is both absolutely required and needs to point to a uniqe folder on your host for a specific container. So the advice above (/volume1/Docker/NZBGet/config) is good
Instead, use a single mount with a generic name like /data or /media if you prefer, then make subfolders underneath as required. E.g. /data/downloads, /data/series, /data/movies…
Why?
All containers will have the same /data mount, so when your download client reports something is ready for pickup by sonarr in /data/downloads, sonarr will recognize this path and you don’t have to fiddle with remote path mappings.
Secondly, mounts are treated as separate hardddisks in docker (simplified explanation), so whenever a file needs to be moved, it will be a slow copy operation, even though behind the scenes it might be the same physical harddisk.
Move from /downloads to /tv = slow copy + delete. Move from /data/downloads to /data/series = instant move.
If you combine this with running related containers (download client, sonarr, radarr, …) with the same user/group combo (PUID and PGID) that has sufficient access on the underlying folder of your /data mount, you’ll never have permission issues either.
For Asustor (not sure about other NAS manufacturers, so I won’t generalise), root folders aren’t accessible in the UI, you have to specify a volume and then a share folder - for me that’s /volume1/Media, with subfolders within that.
Change MainDir to /downloads and DestDir to /downloads/complete or seemingly ${MainDir}/complete would work too (might need to use \ instead of /, but I assume not).
Basically the path you have set for container is what NZBGet will see, and then Docker will translate that to the path you have set for host.
See if that fixes the restart issue, if not then try:
Portainer > Containers > NZBGet > Container details > Restart policies > Always > Update
The weird thing is if I manually set the permissions to be consistent with the containing folders and force NZBGet to reprocess I get the same error in Sonarr’s logs.
I’ve played around with Sonarr > Settings > Media Management > Permissions > OFF / ON with permissions set as 0777 folders and 0666 FIies.
And set the NZBGet > Settings > Unpack > UnrarCmd > ${AppDir}/unrar x -ai
(This should ignore file attributes (permissions) of the downloaded file).
Just haven’t found the magical combination it seems.
Sonarr sends the request for the episode or season pack to NZBGet
NZBGet downloads into .../NZBGet/incomplete
once the download finishes it moves the files to .../NZBGet/complete
Apologies for my ignorance here, but are tags then used to move the files again to .../NZBGet/complete/tv, /films, /music, etc.?
if .rar extensions are found it extracts them
When NZBGet extracts, does it extract the file(s) to, for example, .../tv/Breeders.S01E03.1080p.AMZN.WEB-DL, or to .../tv/Breeders?
If the latter, is this something you have specifically set up? If so, you’d need to undo this so it uses the former and let Sonarr do the organising, because NZBGet is feeding Sonarr the location of the .rar files.
Or have I misunderstood, and it’s actually creating copies to both locations? Or have I really misunderstood?
Correct (NZBGet logs show - Unrar: All OK. Then Deleting archive files)
In Sonarr > Settings > Download Client > NZBGet > Catagory = tv
I do this because I only use Sonarr for tv shows. Looking at NZBGet’s categories I notice the setting for ‘DestDir’. If left blank it creates the ‘tv’ directory, so that’s working correctly.
Not sure if that’s correct or not. But the permissions on:
volume1/Download/NZBGet/complete/tv/Breeders.S01E06.1080p.AMZN.WEB-DL/Breeders.S01E06.1080p.AMZN.WEB-DL.DD+5.1.H.264-iKA.mkv are: