Resource icon

FN11.3 iocage jails - Plex, Tautulli, Sonarr, Radarr, Lidarr, Jackett, Transmission, Organizr

SeaFox

Explorer
Joined
Aug 6, 2013
Messages
98
Can anyone tell me why/how a snapshot was taken when I followed this resource? This is what my current snapshots are showing:
View attachment 48584

What step created this in the process? Where is this snapshot stored? How can I have consistent snapshots taken in case I need to start over?

That's in your screenshot is a snapshot of the stored FreeBSD releases used to make the jails. You want to snapshot the specific jail your app is running in.
So that would be b0rg/iocage/jails/[nameofjail]/root. That would snapshot the applications and settings in the jail. If you back that up one level (remove the "root" at the end) and then also check the box for the "recursive" snapshot it would make two snapshots, one of the FreeBSD system in the jail itself (like if you were about to update/upgrade the OS on it) and one of the /root dataset, too.
 
D

Deleted member 55502

Guest
Hello I'm on TN12.0-u4 and trying to follow the guides:

Code:
echo '{"pkgs":["mono","curl","ca_root_nss"]}' > /tmp/pkg.json
iocage create -n "jackettv2" -p /tmp/pkg.json -r 12.2-RELEASE ip4_addr="vnet0|***********" defaultrouter="*********" vnet="on" allow_raw_sockets="1"
rm /tmp/pkg.json
iocage exec jackettv2 mkdir -p /config
iocage fstab -a jackettv2 /mnt/******/apps/jackettv2 /config nullfs rw 0 0
iocage exec jackettv2 ln -s /usr/local/bin/mono /usr/bin/mono
iocage exec jackettv2 "fetch https://github.com/Jackett/Jackett/releases/download/v0.18.523/Jackett.Binaries.Mono.tar.gz -o /usr/local/share"
iocage exec jackettv2 "tar -xzvf /usr/local/share/Jackett.Binaries.Mono.tar.gz -C /usr/local/share"
iocage exec jackettv2 rm /usr/local/share/Jackett.Binaries.Mono.tar.gz
iocage exec jackettv2 "pw user add jackett -c jackett -u 818 -d /nonexistent -s /usr/bin/nologin"
iocage exec jackettv2 chown -R jackett:jackett /usr/local/share/Jackett /config
iocage exec jackettv2 mkdir /usr/local/etc/rc.d


All of that runs without error on my system.

However:

The gui does not come up.

The jail starts fine.

I can ping out from within the jail

And I can ping the jail fine from outside.
 

Skyler

Dabbler
Joined
Feb 8, 2014
Messages
28
After following this guide, I've run into this issue every time I update Plex. The resolution has been to rename the tmp folder located in \config\Plex\Plex MediaServer\Codecs to remove the ".tmp" at the end of the folder name (EX: EasyAudioEncoder-eae-69c1de6-31-freebsd-x86_64.tmp -> EasyAudioEncoder-eae-69c1de6-31-freebsd-x86_64). Based on what you've uncovered, this issue appears to be due to mounting the \config share (which this guide recommends to do), and is almost certainly permissions related.

Does anyone know how to fix this so I don't have to manually rename the folder every time?

Still having this issue crop up from time to time. Appears to only happen with EAC audio. Any idea why these tmp folders are being created?
 

sp00nlude

Dabbler
Joined
Sep 10, 2016
Messages
21
Hello I'm on TN12.0-u4 and trying to follow the guides:

Code:
echo '{"pkgs":["mono","curl","ca_root_nss"]}' > /tmp/pkg.json
iocage create -n "jackettv2" -p /tmp/pkg.json -r 12.2-RELEASE ip4_addr="vnet0|***********" defaultrouter="*********" vnet="on" allow_raw_sockets="1"
rm /tmp/pkg.json
iocage exec jackettv2 mkdir -p /config
iocage fstab -a jackettv2 /mnt/******/apps/jackettv2 /config nullfs rw 0 0
iocage exec jackettv2 ln -s /usr/local/bin/mono /usr/bin/mono
iocage exec jackettv2 "fetch https://github.com/Jackett/Jackett/releases/download/v0.18.523/Jackett.Binaries.Mono.tar.gz -o /usr/local/share"
iocage exec jackettv2 "tar -xzvf /usr/local/share/Jackett.Binaries.Mono.tar.gz -C /usr/local/share"
iocage exec jackettv2 rm /usr/local/share/Jackett.Binaries.Mono.tar.gz
iocage exec jackettv2 "pw user add jackett -c jackett -u 818 -d /nonexistent -s /usr/bin/nologin"
iocage exec jackettv2 chown -R jackett:jackett /usr/local/share/Jackett /config
iocage exec jackettv2 mkdir /usr/local/etc/rc.d


All of that runs without error on my system.

However:

The gui does not come up.

The jail starts fine.

I can ping out from within the jail

And I can ping the jail fine from outside.

I've been having the same problem - I think. I was running a 11.3 RELEASE jackett and deleted it from the UI. Creating a 12.2 RELEASE jackett cannot reach the web ui after restart. I recreated with 11.3 RELEASE and it works fine. I did notice that all my settings were still there from the previous install even tho I had deleted the jail and it's dataset. Could that be why the 12.3 isn't working as expected?
 
Last edited:

JV9

Dabbler
Joined
Aug 19, 2021
Messages
25

JJT211

Patron
Joined
Jul 4, 2014
Messages
323
Im posting this as notes for myself in the future.

I decided to nuke my old v2 Sonarr after multiple failed attaempts at trying to upgrade to v3. I created backup of config before I nuked it of course and then restored after install and updating to latest sonarr. I Had to combine this guide with another over at https://www.digimoot.com/truenas-sonarr-v3/ to get it to work

echo '{"pkgs":["mono","mediainfo","sqlite3","ca_root_nss","curl"]}' > /tmp/pkg.json
iocage create -n "sonarr" -p /tmp/pkg.json -r 12.2-RELEASE ip4_addr="vnet0|10.1.1.203/24" defaultrouter="10.1.1.1" vnet="on" allow_raw_sockets="1" boot="on" resolver="none"
rm /tmp/pkg.json
iocage exec sonarr mkdir -p /config
iocage exec sonarr mkdir -p /mnt/tv
iocage exec sonarr mkdir -p /mnt/mom
iocage exec sonarr mkdir -p /mnt/downloads
iocage fstab -a sonarr /mnt/volume/jails/sonarr /config nullfs rw 0 0
iocage fstab -a sonarr /mnt/volume/downloads /mnt/downloads nullfs rw 0 0
iocage fstab -a sonarr /mnt/volume/tv /mnt/tv nullfs rw 0 0
iocage fstab -a sonarr /mnt/volume/mom /mnt/mom nullfs rw 0 0
iocage exec sonarr ln -s /usr/local/bin/mono /usr/bin/mono

*** type jls to find jail # and jexec directly into jail ***



pkg install mediainfo sqlite3 ca_root_nss curl llvm80 libiconv nano wget


mkdir /usr/local/share/download
cd /usr/local/share/download
fetch https://download.sonarr.tv/v3/phant...onarr.phantom-develop.3.0.4.1033.linux.tar.gz -o /usr/local/share/download/
wget https://github.com/jailmanager/jailmanager.github.io/releases/download/v0.0.1/mono-6.8.0.105.txz

cd /usr/local/share/download
pkg install -y mono-6.8.0.105.txz
ln -s /usr/local/bin/mono /usr/bin/mono
tar -xzvf /usr/local/share/download/Sonarr.phantom-develop.3.0.4.1033.linux.tar.gz -C /usr/local/share
mv /usr/local/share/Sonarr /usr/local/share/sonarr
mkdir /usr/local/etc/rc.d
nano /usr/local/etc/rc.d/sonarr

*** exit jail and back to freenas shell ***

iocage exec sonarr "pw user add sonarr -c sonarr -u 351 -d /nonexistent -s /usr/bin/nologin"
iocage exec sonarr chown -R sonarr:sonarr /usr/local/share/NzbDrone /config
iocage exec sonarr mkdir /usr/local/etc/rc.d
iocage exec sonarr nano /mnt/iocage/jails/sonarr/root/usr/local/etc/rc.d/sonarr

#!/bin/sh

# $FreeBSD$
#
# PROVIDE: sonarr
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# sonarr_enable: Set to YES to enable sonarr
# Default: NO
# sonarr_user: The user account used to run the sonarr daemon.
# This is optional, however do not specifically set this to an
# empty string as this will cause the daemon to run as root.
# Default: media
# sonarr_group: The group account used to run the sonarr daemon.
# This is optional, however do not specifically set this to an
# empty string as this will cause the daemon to run with group wheel.
# Default: media
# sonarr_data_dir: Directory where sonarr configuration
# data is stored.
# Default: /var/db/sonarr

. /etc/rc.subr
name=sonarr
rcvar=${name}_enable
load_rc_config $name

: ${sonarr_enable:="NO"}
: ${sonarr_user:="sonarr"}
: ${sonarr_group:="sonarr"}
: ${sonarr_data_dir:="/config"}


pidfile="${sonarr_data_dir}/sonarr.pid"
command="/usr/sbin/daemon"
procname="/usr/local/bin/mono"
command_args="-f ${procname} /usr/local/share/sonarr/Sonarr.exe –data=${sonarr_data_dir} –nobrowser"

start_precmd=sonarr_precmd
sonarr_precmd() {
if [ ! -d ${sonarr_data_dir} ]; then
install -d -o ${sonarr_user} -g ${sonarr_group} ${sonarr_data_dir}
fi

export XDG_CONFIG_HOME=${sonarr_data_dir}
}

run_rc_command "$1"

iocage exec sonarr chmod u+x /usr/local/etc/rc.d/sonarr
iocage exec sonarr sysrc "sonarr_enable=YES"
iocage exec sonarr service sonarr start
 

tgn55

Dabbler
Joined
Jan 1, 2019
Messages
23
I have a single iocage jail running plexpass, sonarr, radarr, lidarr and sabnzbd. Been working nicely for years.
I have updated to TN12, and upgraded my jail to 12.3. Manually upgraded to mono-6.8.0.105. Tried to migrate to sonarr V3... failed, so I reverted so v2. Things seemed OK - I opened browser windows to all my apps, fine, no problem with the UI. Until...

Sonarr started reporting System.UnauthorizedAccessException: Access to the path is denied. ---> System.IO.IOException: Operation not permitted on trying to import files from my Completed downloads folder. Naturally, I checked all permissions (I had not changed anything, but ran the customary chown -R on the relevant directories "just to be sure" All ownerships, fine, and all permissions as expected.

Here's the kicker... I have pretty much identical setups for radarr and sonarr... same jail, same download folders etc, same u/g and permissions on everything in sight. Radarr works fine. No errors importing a newly d/l'd movie. Sonarr? Nup. Access to path denied.

Both processes running under the same user/group. Same jail, filesystem etc etc... so what the heck causes sonarr to throw an access exception... and radarr (and lidarr) are just fine. It has me stumped.

Yeah I've restarted the jail, all the obvious stuff. Searched forums for days... no joy.

Anyone got suggestions? If you wanna see log files... I can supply.

Cheers,
 
Last edited:

ThreeDee

Guru
Joined
Jun 13, 2013
Messages
700
I have a single iocage jail running plexpass, sonarr, radarr, lidarr and sabnzbd. Been working nicely for years.
I have updated to TN12, and upgraded my jail to 12.3. Tried to migrate to sonarr V3... failed, so I reverted so v2. Things seemed OK - I opened browser windows to all my apps, fine, no problem with the UI. Until...

Sonarr started reporting System.UnauthorizedAccessException: Access to the path is denied. ---> System.IO.IOException: Operation not permitted on trying to import files from my Completed downloads folder. Naturally, I checked all permissions (I had not changed anything, but ran the customary chown -R on the relevant directories "just to be sure" All ownerships, fine, and all permissions as expected.

Here's the kicker... I have pretty much identical setups for radarr and sonarr... same jail, same download folders etc, same u/g and permissions on everything in sight. Radarr works fine. No errors importing a newly d/l'd movie. Sonarr? Nup. Access to path denied.

Both processes running under the same user/group. Same jail, filesystem etc etc... so what the heck causes sonarr to throw an access exception... and radarr (and lidarr) are just fine. It has me stumped.

Yeah I've restarted the jail, all the obvious stuff. Searched forums for days... no joy.

Anyone got suggestions? If you wanna see log files... I can supply.

Cheers,
are these plugins or manual installs?
So you have 4 different things installed in the same jail? .. not separate jails?
Latest jail version is 12 p11 (I think .. I just updated my manually installed Plex and UniFi Controller jails but I'm at work so can't look to verify)
 

tgn55

Dabbler
Joined
Jan 1, 2019
Messages
23
Manual installs... I have no plugins, and yes, all in the same jail. .That's what makes it hard to understand! All permission stuff SHOULD be the same, right? Why can one process be able to read/write just fine... and the other process, under the identical user/group - not? It makes no sense.

I have scrutinized the config files, the rc.d setup... everything looks identical between sonarr and radarr (and lidarr, for that matter)

Not to mention it was all working perfectly prior to my upgrade (and downgrade) of Sonarr. I confess something may have gone awry with the mono upgrade... I did a bunch of stuff, and on testing, if the app came up just fine, I assumed all was good. I suppose there is a possibility that the permission thing actually bit me at the mono upgrade point... rather than sonarr upgrade. It's not clear... just sayin it's a possibility. Then again - if it was mono to blame... why wouldn't that also screw up radarr? My brain kinda blacks out at this point!

Also, note that my sabnabd downloads are still working - files written into my Completed directory just fine. Proven with a radarr D/L. Radarr picked up the file, moved & renamed it into my Movies folder. Normal operations working. But sonarr ... spits the dummy.

Just to recap, my setup is as follows:
TrueNAS 12
iocage jail 12.3-RELEASE
mono 6.8.0.105
python38-3.8.12_1
sabnzbdplus-3.3.0,1
sonarr2.0.0.5344
radarr3.2.2.5080

Extract from log file attached, and ps aux output from the jail root shell
 

Attachments

  • sonarr.txt
    5.4 KB · Views: 177
  • ps dump.txt
    1.9 KB · Views: 160

JJT211

Patron
Joined
Jul 4, 2014
Messages
323
^^ Having everything in the same jail makes for a lot of unnecessary complexity. I had a nightmare of a time trying to get that mono installed correctly ad Radarr/Sonarr upgraded properly. See a few posts above of what I had to go through to get Sonarr working properly. Luckily Sonarr was its own jail. I cant imagine being in your predicament. I would've bitten the bullet, nuked it all and built it back up again properly. Thats what I would
 

tgn55

Dabbler
Joined
Jan 1, 2019
Messages
23
Thanks, I have conceded that I need to rebuild, just have not got to do it yet.

Still, it bugs me that radarr, sonarr etc were all playing nicely in the one jail... until a few weeks back, when, having some time over Christmas, I thought I'd get around to doing some maintenance/upgrades. Bad move!

I have also trawled the sonarr forum... other folk have had issues, gurus like bakerboy ALWAYS just say "it's permissions"... but there has to be more to it than that... I've checked and rechecked permission, user/group ownership - it's all good. Seriously. I've been a Unix sysadmin since around 1980, (that's NOT a typo !!) - I kinda know a thing or two. Radarr works - sonarr doesn't (but used to).

Anyway, I plan on using your script to install sonarr v3... in a separate jail. I too had some issues with my first attempt. I will probably get it working - I just hate walking away from something broken that I cannot fix... or at least, understand what is the root cause. Ah well... we'll see

Thanks for your interest. I will update when I make some progress.

T.
 

FrankNAS

Contributor
Joined
Dec 3, 2017
Messages
111
So...in ports/pkg:
Current sonnar for FreeBSD:12:amd64 latest is 3.0.6.1342_1
Current radarr for FreeBSD:12:amd64 latest is 4.0.4.5922

Try moving to those and see if that helps (pkg upgrade should cover that). Backup config or snapshot the jail before doing so.
That version of sonarr is from early 2020 and shouldve been upgraded automagically when you upgraded the jail to 12.3. As for radarr, that could EITHER be the dotnet or the mono version; the status page will let you know which one it is.

edit:

Code:
media 49998  0.0  2.2 258132 179780  -  IsJ  Fri02    0:07.78 /usr/local/bin/mono /usr/local/share/NzbDrone/NzbDrone.exe --data=/config/sonarrdata --nobrowser (mono-sgen)
media 50324  0.0  3.1 335048 253240  -  SJ   Fri02   31:13.93 /usr/bin/mono --debug /usr/local/share/NzbDrone/NzbDrone.exe /data=/config/sonarrdata /nobrowser /restart (mono-sgen)


did it fail to restart correctly after update?
 
Last edited:

tgn55

Dabbler
Joined
Jan 1, 2019
Messages
23
I've made some progress... but also, discovered some additional "weirdness", which I am not quite ready to report on (needs more investigation)

Bottom line: I managed to get Sonarr v3 working, in a completely new jail, containing ONLY sonarr. Only after also performing an upgrade to the latest version (from within sonarr). That's the good news. Now - the "bad" news...

As stated above, I had checked and recheck every possible permission, owner/groups etc... to no avail. Bakerboy (on the sonarr forum) insisted that "the logs never lie", or words to that effect, and anyone having problems must still have incorrect permissions. Well... I think there is more to it than that. Why?

OK, so I created a new (iocage) jail. I used a different complete downloads folder (sabnzbd config). I put a single download file in that folder... and fired up sonarr, hoping to be able to import it. Guess what my logs showed (and yes, this is real... no confusion, I cleared logs, starting with a new jail, new logs yada yada...)

I got the same file/folder cannot be accessed error... but REFERRING TO FILES AND THE FOLDER PATH IN MY ORIGINAL SETUP! Got that? an import error containing a path that does not even exist in my new jail. Yes, it existed in my old jail, that had a different "completed" d/l folder !!! At this point, after muttering a few WTF's... rubbing my eyes to see if was dreaming or whatever... Yep. My nice shiny new sonarr was barfing trying to import a file (files, actually) that were "ghosts" from a previous jail (the jail hosting sabnzbd, actually)

I eventually got to a clean state only after resorting to opening the Activity tab ( I think it was there...), nuking everything in sight, messing about with sonarr_data_dir in the rc.d/sonarr file (basically, scratching at ANYTHING that might be implicated... and, after a few more hours of head-scratching, finally got sonarr "happy". Ie, no import errors.

I *think* my conclusion is this: it ain't necessarily just about permissions! I don't yet understand how what I described can happen, it seems just too bizarre. Along the way, I also messed about tweaking mount points (both manually, and also via the TrueNAS GUI)... I had standard (755) folder permission, no custom ACLs or anything funky. Just straight out the box setup.

So... how do I end up with files/folder paths "leaking" from a different jail into the new one? My suspicion is there is stuff inside the sonar.db file, but this is where I am up to in my investigation. Sill a few too many unanswered questions. Unless - some other sage can enlighten me/us?

What I do know is this: ALL my permissions were right... and it still did NOT work... still reported file/folder access errors - which were completely spurious.

Sorry this is a bit long-winded - but I've seen so many people reporting issues with this, I'm hoping it helps someone.

I kind want to revert so I can show some logs and stuff.. but, honestly, after banging my head on this wall for about 3 weeks, and FINALLY got it working, I am a tad reluctant to break it again ;-)

If I do discover anything repeatable I will post a follow-up.

Regards,
T.
 

rawkus

Explorer
Joined
Feb 13, 2014
Messages
69
I cant seem to rebuild new jails anymore and i can't figure out why. I am using the steps below but I cant seem to get Lidarr to start. can anyone tell me what i am missing?
running TrueNAS core 13.0 -U5.3. I was previously able to follow this guide and successfully set up all jails. Im using the steps below but Lidarr wont start. I'm assuming its something simple but I cant seem to figure it out.


Code:
echo '{"pkgs":["mono","mediainfo","sqlite3","ca_root_nss","curl","chromaprint"]}' > /tmp/pkg.json

iocage create -n "lidarr" -p /tmp/pkg.json -r 13.2-RELEASE ip4_addr="vnet0|192.168.1.107/24" defaultrouter="192.168.1.1" vnet="on" allow_raw_sockets="1" boot="on"

rm /tmp/pkg.json

iocage exec lidarr mkdir -p /config

iocage exec lidarr mkdir -p /music

iocage exec lidarr mkdir -p /mnt/media

iocage fstab -a lidarr /mnt/tank/apps/lidarr /config nullfs rw 0 0

iocage fstab -a lidarr /mnt/tank/media/downloads/sabnzbd /mnt/media nullfs rw 0 0

iocage fstab -a lidarr /mnt/tank/media/music /music nullfs rw 0 0

iocage exec lidarr ln -s /usr/local/bin/mono /usr/bin/mono

iocage exec lidarr "fetch https://github.com/Lidarr/Lidarr/releases/download/v1.4.0.3554/Lidarr.develop.1.4.0.3554.freebsd-core-x64.tar.gz -o /usr/local/share"

iocage exec lidarr "tar -xzvf /usr/local/share/Lidarr.develop.1.4.0.3554.freebsd-core-x64.tar.gz -C /usr/local/share"

iocage exec lidarr "rm /usr/local/share/Lidarr.*.tar.gz"

iocage exec lidarr "pw user add media -c media -u 816 -d /nonexistent -s /usr/bin/nologin"

iocage exec lidarr "pw user add lidarr -c lidarr -u 351 -d /nonexistent -s /usr/bin/nologin"

iocage exec lidarr "pw groupadd -n media -g 816"

iocage exec lidarr "pw groupmod media -m lidarr"


iocage exec lidarr chown -R media:media /usr/local/share/Lidarr /config

iocage exec lidarr mkdir /usr/local/etc/rc.d






from inside the jail's shell   ee /usr/local/etc/rc.d/lidarr


************************************************************************

#!/bin/sh


# $FreeBSD$

#

# PROVIDE: lidarr

# REQUIRE: LOGIN

# KEYWORD: shutdown

#

# Add the following lines to /etc/rc.conf to enable lidarr:

# lidarr_enable="YES"


. /etc/rc.subr

name=lidarr

rcvar=${name}_enable

load_rc_config $name


: ${lidarr_enable="NO"}

: ${lidarr_user:="media"}

: ${lidarr_group:="media"}

: ${lidarr_data_dir:="/config"}


pidfile="${lidarr_data_dir}/lidarr.pid"

command="/usr/sbin/daemon"

procname="/usr/local/bin/mono"

command_args="-f ${procname} /usr/local/share/Lidarr/Lidarr.exe -- data=${lidarr_data_dir} --nobrowser"


start_precmd=lidarr_precmd

lidarr_precmd() {

if [ ! -d ${lidarr_data_dir} ]; then

install -d -o ${lidarr_user} -g ${lidarr_group} ${lidarr_data_dir}

fi


export XDG_CONFIG_HOME=${lidarr_data_dir}

}


run_rc_command "$1"

****************************************************************************



es

iocage exec lidarr chmod u+x /usr/local/etc/rc.d/lidarr

iocage exec lidarr sysrc "lidarr_enable=YES"

iocage exec lidarr service lidarr start



Lidarr should be available at http://192.168.1.107:8686
 
Last edited:

FrankNAS

Contributor
Joined
Dec 3, 2017
Messages
111
I cant seem to rebuild new jails anymore and i can't figure out why. I am using the steps below but I cant seem to get Lidarr to start. can anyone tell me what i am missing?
running TrueNAS core 13.0 -U5.3. I was previously able to follow this guide and successfully set up all jails. Im using the steps below but Lidarr wont start. I'm assuming its something simple but I cant seem to figure it out.
Lidarr has its own package now: https://www.freshports.org/net-p2p/lidarr
Code:
Runtime dependencies:
  1. ca_root_nss>0 : security/ca_root_nss
  2. icu>0 : devel/icu
  3. krb5>0 : security/krb5
  4. libiconv>0 : converters/libiconv
  5. libinotify>0 : devel/libinotify
  6. libunwind>0 : devel/libunwind
  7. chromaprint>0 : audio/chromaprint
Library dependencies:
  1. libsqlite3.so : databases/sqlite


Please wait until `1.4.5.3639_1` shows up on the pkg mirrors as older versions that contain `USES=iconv` wont work unless you install libiconv.
If you want to manually install and manage it take note of the changed depends (e.g., `mono` has not been used for a long time)
 
Top