Yet another Sonarr/Radarr permission issue

ChiknNutz

Patron
Joined
Nov 6, 2015
Messages
217
I am moving over to iocage from warden jails and have done a lot of research prior to posting this, reviewing threads on here and elsewhere to no real conclusion. I have been using Sonarr & Sabnzbd for years on warden jails, no issues. I have recreated the jails in iocage and have tried very hard to get all settings identical between the warden and iocage jails, along with all settings. However, I am still having issues with both Sonarr and Radarr throwing error when trying to move the download as noted below.

Import failed, path does not exist or is not accessible by Sonarr: /media/downloads/tv/[file name]

I have reviewed several guides on the subject, here are my jail mounts and the permissions I've applied:

Source: /mnt/Rivendell/media/downloads
Destination: /mnt/iocage/jails/sonarr/root/downloads
-and-
Source: /mnt/Rivendell/media/tv
Destination: /mnt/iocage/jails/sonarr/root/tv

Here is are the permissions I've applied:
pw useradd -n media -u 816 -d /nonexistent -s /usr/sbin/nologin service sonarr onestop chown -R media:media /usr/local/sonarr sysrc 'sonarr_user=media' chown -R media:media /usr/local/share/sonarr service sonarr start

I am convinced it is of course a permission issue, but just not sure what else to do here. Guidance is most appreciated. Thank you.
 
Last edited:
Joined
Jan 7, 2015
Messages
1,155
SSH to the sonarr jail or the freenas host and enter sonarr jail iocage console SONARRJAIL and do
ll /
and see what user owns the folders tv and downloads. Is it media:media? The owner will likely be root if you didnt create them as media. Also im pretty sure the media user UID by default on freenas and in all jails should be/is/was uid=8675309 unless you need 816 for a reason. I cant confirm if this has changed, mine has been set for so long. The key is making the two media users uid and gid match each other (8675309 by default), the media user in the jail and the media user on the host. Then of course the user media should own the actual MEDIA datasets in question on the host. Its important if using the GUI to not own anything but your media to the media user of course. And before doing anything id do a recursive snapshot of every pool.

In any case once you have two media users (one jail, one host) with matching uid/gid's a simple chown media:media /tv && chown media:media /downloads will likely fix this issue. This command should be issued from a SSH terminal inside the sonarr jail.

Follow this exact same procedure with every jail you ever create and you will be rid of this forever.
 
Last edited:

ChiknNutz

Patron
Joined
Nov 6, 2015
Messages
217
Thanks for the reply. Here are the owners. I made that UID so long ago now, I don't recall why. Seems like that's what was recommended back then for whatever reason.

-rw-r--r-- 2 root wheel 957 Jun 22 2018 .cshrc -rw-r--r-- 2 root wheel 474 Jun 22 2018 .profile -r--r--r-- 1 root wheel 6197 Jun 22 2018 COPYRIGHT drwxr-xr-x 2 root wheel 47 Feb 2 09:52 bin/ drwxr-xr-x 9 root wheel 52 Feb 2 09:52 boot/ dr-xr-xr-x 12 root wheel 512 Feb 6 22:08 dev/ drwxrwxrwx 9 media nogroup 9 Feb 5 22:29 downloads/ drwxr-xr-x 27 root wheel 108 Feb 6 22:08 etc/ drwxr-xr-x 4 root wheel 56 Feb 2 09:52 lib/ drwxr-xr-x 3 root wheel 5 Jun 22 2018 libexec/ drwxr-xr-x 2 root wheel 2 Jun 22 2018 media/ drwxr-xr-x 2 root wheel 2 Jun 22 2018 mnt/ drwxr-xr-x 2 root wheel 2 Jun 22 2018 net/ dr-xr-xr-x 2 root wheel 2 Jun 22 2018 proc/ drwxr-xr-x 2 root wheel 148 Feb 2 09:52 rescue/ drwxr-xr-x 2 root wheel 8 Feb 6 21:52 root/ drwxr-xr-x 2 root wheel 137 Feb 2 09:52 sbin/ lrwxr-xr-x 1 root wheel 11 Feb 2 09:50 sys@ -> usr/src/sys drwxrwxrwt 8 root wheel 8 Feb 6 22:08 tmp/ drwxrwxrwx 42 media nogroup 42 Feb 3 20:50 tv/ drwxr-xr-x 14 root wheel 14 Feb 2 21:28 usr/ drwxr-xr-x 24 root wheel 24 Feb 6 22:08 var/
 
Joined
Jan 7, 2015
Messages
1,155
Do cat /etc/passwd from the host and jail to verify that the ID's match.

media:*:8675309:8675309:Media User:/var/empty:/usr/sbin/nologin
 

ChiknNutz

Patron
Joined
Nov 6, 2015
Messages
217
It seems that they do in fact match (816 that is) in both main host shell and jail shell.

Host: media:*:816:816:media:/nonexistent:/usr/sbin/nologin

Sonarr Jail: media:*:816:816:User &:/nonexistent:/usr/sbin/nologin
 
Joined
Jan 7, 2015
Messages
1,155
So who owns the files inside /tv and /downloads from the sonarr jail? media?
 

ChiknNutz

Patron
Joined
Nov 6, 2015
Messages
217
That is correct. I also checked and user "media" is the owner of the "media" dataset.

drwxrwxrwx 9 media nogroup 9 Feb 5 22:29 downloads/ drwxrwxrwx 42 media nogroup 42 Feb 3 20:50 tv/
 
Joined
Jan 7, 2015
Messages
1,155
Also re reading your post you have this "Import failed, path does not exist or is not accessible by Sonarr: /media/downloads/tv/[file name]"
You have your mounts in the root of the drive /tv and /downloads respectively, so in sonarr it expects media to be in /media/downloads/tv which is owned by root as per your earlier post. Configure sonar to look in /tv for downloaded complete stored shows, and to look in /downloads for new stuff.
 

ChiknNutz

Patron
Joined
Nov 6, 2015
Messages
217
I believe that is what I have going, but maybe it's still not right. That fact that Sonarr recognizes the "/media/downloads/tv/[file name]" for the new stuff says to me the mount points are configured right, but it's still somehow a permission issue.
 
Joined
Jan 7, 2015
Messages
1,155
I have reviewed several guides on the subject, here are my jail mounts and the permissions I've applied:

Source: /mnt/Rivendell/media/downloads
Destination: /mnt/iocage/jails/sonarr/root/downloads
-and-
Source: /mnt/Rivendell/media/tv
Destination: /mnt/iocage/jails/sonarr/root/tv

Sonarr will see this path as /tv and /downloads.
 
Joined
Jan 7, 2015
Messages
1,155
Right now you are trying to import shows from /media/downloads/tv and there is likely no data there. You should be pointing it to /downloads. And setting your root folders of your already downloaded and filed shows to /tv
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Your path for the mount point in your download client jail need to be the same path as in sonarr/radarr. Currently they are not so you're getting a path not doing error.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Right now you are trying to import shows from /media/downloads/tv and there is likely no data there. You should be pointing it to /downloads. And setting your root folders of your already downloaded and filed shows to /tv
This is wrong
 
Joined
Jan 7, 2015
Messages
1,155
I think its not wrong, totally, while I agree his mount points and directories should be the same across jails, what I have said about where the media is located is spot on. If what he has said is accurate then currently his downloads according to sonarr live in /downloads inside the sonarr jail. Same for /tv, below is his root directory inside the sonarr jail.

-rw-r--r-- 2 root wheel 957 Jun 22 2018 .cshrc
-rw-r--r-- 2 root wheel 474 Jun 22 2018 .profile
-r--r--r-- 1 root wheel 6197 Jun 22 2018 COPYRIGHT
drwxr-xr-x 2 root wheel 47 Feb 2 09:52 bin/
drwxr-xr-x 9 root wheel 52 Feb 2 09:52 boot/
dr-xr-xr-x 12 root wheel 512 Feb 6 22:08 dev/
drwxrwxrwx 9 media nogroup 9 Feb 5 22:29 downloads/
drwxr-xr-x 27 root wheel 108 Feb 6 22:08 etc/
drwxr-xr-x 4 root wheel 56 Feb 2 09:52 lib/
drwxr-xr-x 3 root wheel 5 Jun 22 2018 libexec/
drwxr-xr-x 2 root wheel 2 Jun 22 2018 media/
drwxr-xr-x 2 root wheel 2 Jun 22 2018 mnt/
drwxr-xr-x 2 root wheel 2 Jun 22 2018 net/
dr-xr-xr-x 2 root wheel 2 Jun 22 2018 proc/
drwxr-xr-x 2 root wheel 148 Feb 2 09:52 rescue/
drwxr-xr-x 2 root wheel 8 Feb 6 21:52 root/
drwxr-xr-x 2 root wheel 137 Feb 2 09:52 sbin/
lrwxr-xr-x 1 root wheel 11 Feb 2 09:50 sys@ -> usr/src/sys
drwxrwxrwt 8 root wheel 8 Feb 6 22:08 tmp/
drwxrwxrwx 42 media nogroup 42 Feb 3 20:50 tv/
drwxr-xr-x 14 root wheel 14 Feb 2 21:28 usr/
drwxr-xr-x 24 root wheel 24 Feb 6 22:08 var/

If he is trying to import shows from the sonarr web app and using /media in any part of the path its not going to fly. My bet is in his old jail he was using the /media directory and the sub directories tv and downloads are not there because they are now mounted in /tv and /downloads
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
I think its not wrong, totally, while I agree his mount points and directories should be the same across jails, what I have said about where the media is located is spot on. If what he has said is accurate then currently his downloads according to sonarr live in /downloads inside the sonarr jail. Same for /tv, below is his root directory inside the sonarr jail.



If he is trying to import shows from the sonarr web app and using /media in any part of the path its not going to fly. My bet is in his old jail he was using the /media directory and the sub directories tv and downloads are not there because they are now mounted in /tv and /downloads
Having/media is just fine as long as it's the same in both jails. Where you create your mount points doesn't matter they can be 5 levels deep or at the root path, it's just a path nothing special.
 
Last edited:
Joined
Jan 7, 2015
Messages
1,155
No i realize its simply for beautification. For all purpose I know they are the same directories just represented differently to the jails. Thanks!
 

ChiknNutz

Patron
Joined
Nov 6, 2015
Messages
217
Ok, I redid the mount points in Sonarr as follows but still get the "import failed" error. Both mount points (as noted in my initial post) generate the same error. I know this is probably something elementary but am currently at a loss. Point to note, as I am creating the mount points, when selecting the folders, I can see all the media inside of them, so would expect Sonarr to be able to see them as well. This is why I feel it is a permission-related issue and not a mount point issue.

Import failed, path does not exist or is not accessible by Sonarr: /media/downloads/tv/Criminal.Minds.S15E06.720p.HDTV.x264-AVS/

Source: /mnt/Rivendell/media/downloads/tv
Destination: /mnt/iocage/jails/sonarr/root/downloads/tv
-and-
Source: /mnt/Rivendell/media/tv
Destination: /mnt/iocage/jails/sonarr/root/tv
 
Joined
Jan 7, 2015
Messages
1,155
Ok, im going to go thru this one more time.. Sonarr is telling you that it is trying to import shows from /media/downloads/tv/Criminal.Minds.S15E06.720p.HDTV.x264-AVS/.... But the actual directory you should be importing from is /downloads/tv/Criminal.Minds.S15E06.720p.HDTV.x264-AVS as you have it

Option 1.
You should make your mounts be this,

Source: /mnt/Rivendell/media/downloads/tv
Destination: /mnt/iocage/jails/sonarr/root/media/downloads/tv
-and-
Source: /mnt/Rivendell/media/tv
Destination: /mnt/iocage/jails/sonarr/root/media/tv

Then because I know that your /media folder is owned by root you should do chown media:media /media inside the sonarr jail or issue iocage exec sonarr chown media:media /media

Option 2.
Simply tell Sonarr to import shows from /downloads/tv instead.
 

ChiknNutz

Patron
Joined
Nov 6, 2015
Messages
217
Why do you say /media is owned by root? It is owned by "media" as noted here.

1581121792465.png
 
Joined
Jan 7, 2015
Messages
1,155
the root folder /media inside your sonarr jail (where you will be mounting to, is owned by root)

-rw-r--r-- 2 root wheel 957 Jun 22 2018 .cshrc
-rw-r--r-- 2 root wheel 474 Jun 22 2018 .profile
-r--r--r-- 1 root wheel 6197 Jun 22 2018 COPYRIGHT
drwxr-xr-x 2 root wheel 47 Feb 2 09:52 bin/
drwxr-xr-x 9 root wheel 52 Feb 2 09:52 boot/
dr-xr-xr-x 12 root wheel 512 Feb 6 22:08 dev/
drwxrwxrwx 9 media nogroup 9 Feb 5 22:29 downloads/
drwxr-xr-x 27 root wheel 108 Feb 6 22:08 etc/
drwxr-xr-x 4 root wheel 56 Feb 2 09:52 lib/
drwxr-xr-x 3 root wheel 5 Jun 22 2018 libexec/
drwxr-xr-x 2 root wheel 2 Jun 22 2018 media/
drwxr-xr-x 2 root wheel 2 Jun 22 2018 mnt/
drwxr-xr-x 2 root wheel 2 Jun 22 2018 net/
dr-xr-xr-x 2 root wheel 2 Jun 22 2018 proc/
drwxr-xr-x 2 root wheel 148 Feb 2 09:52 rescue/
drwxr-xr-x 2 root wheel 8 Feb 6 21:52 root/
drwxr-xr-x 2 root wheel 137 Feb 2 09:52 sbin/
lrwxr-xr-x 1 root wheel 11 Feb 2 09:50 sys@ -> usr/src/sys
drwxrwxrwt 8 root wheel 8 Feb 6 22:08 tmp/
drwxrwxrwx 42 media nogroup 42 Feb 3 20:50 tv/
drwxr-xr-x 14 root wheel 14 Feb 2 21:28 usr/
drwxr-xr-x 24 root wheel 24 Feb 6 22:08 var/
 
Top