Sonarr jail not working

thxtex

Dabbler
Joined
Dec 8, 2017
Messages
27
Hi

I have been spending hours trying to get this work without success. It looks like sonarr is running but I can not access the WebUI. I use the following to create the jail.
Code:
#!/bin/sh

echo '{"pkgs":["icu","libunwind","krb5","libnotify","libinotify","sqlite3","curl","ca_root_nss"]}' > /tmp/pkg.json
iocage create -n sonarr -p /tmp/pkg.json -r 13.2-RELEASE ip4_addr="vnet0|192.168.1.74/24" defaultrouter="192.168.1.1" vnet="on" allow_raw_sockets="1" allow_mlock="1" boot="on"
rm /tmp/pkg.json

iocage exec sonarr "curl -J -L 'https://services.sonarr.tv/v1/download/develop/latest?version=4&os=freebsd&arch=x64' -o /usr/local/share/sonarr.tar.gz"
iocage exec sonarr "tar -xzvf /usr/local/share/sonarr.tar.gz -C /usr/local/share"
iocage exec sonarr "rm /usr/local/share/sonarr.tar.gz"
iocage exec sonarr mkdir -p /config /mnt/datapool /usr/local/etc/rc.d /var/run/sonarr
#iocage fstab -a sonarr /mnt/Volume1/appdata/sonarr /config nullfs rw 0 0
iocage fstab -a sonarr /mnt/Volume2/Tank/ /mnt/datapool nullfs rw 0 0
iocage exec sonarr "pw user add sonarr -c sonarr -u 351 -d /nonexistent -s /usr/bin/nologin"

#Startscript as shown on https://wiki.servarr.com/sonarr/installation/freebsd
cp sonarr /mnt/Volume1/iocage/jails/sonarr/root/usr/local/etc/rc.d/sonarr

iocage exec sonarr chown -R sonarr:sonarr /usr/local/share/Sonarr /config /var/run/sonarr /usr/local/etc/rc.d/sonarr
iocage exec sonarr chmod u+x /usr/local/etc/rc.d/sonarr
iocage exec sonarr sysrc sonarr_enable=YES sonarr_user=sonarr sonarr_group=sonarr sonarr_data_dir=/config
iocage exec sonarr service sonarr start


The tail of sonarrs logfile is the following.

Code:
2024-02-11 14:03:12.7|Info|email_encryption|Starting migration of Log DB to 201
2024-02-11 14:03:12.7|Info|NzbDrone.Core.Datastore.Migration.Framework.NzbDroneSQLiteProcessor|INSERT INTO "VersionInfo" ("Version", "AppliedOn", "Description") VALUES (201, '2024-02-11T13:03:12', 'email_encryption')
2024-02-11 14:03:12.7|Info|NzbDrone.Core.Datastore.Migration.Framework.NzbDroneSQLiteProcessor|Committing Transaction
2024-02-11 14:03:12.7|Info|FluentMigrator.Runner.MigrationRunner|201: email_encryption migrated
2024-02-11 14:03:12.7|Info|FluentMigrator.Runner.MigrationRunner|=> 0.0024825s
2024-02-11 14:03:13.0|Info|Microsoft.Hosting.Lifetime|Now listening on: http://[::]:8989
2024-02-11 14:03:13.3|Info|QualityProfileService|Setting up default quality profiles
2024-02-11 14:03:13.4|Info|Microsoft.Hosting.Lifetime|Application started. Press Ctrl+C to shut down.
2024-02-11 14:03:13.4|Info|Microsoft.Hosting.Lifetime|Hosting environment: Production
2024-02-11 14:03:13.4|Info|Microsoft.Hosting.Lifetime|Content root path: /
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
just put sonarr in the pkgs list at the beginning (and take out all the other stuff as it's now in the dependencies of sonarr) and don't do your own messing around to download and install it... ???
 

thxtex

Dabbler
Joined
Dec 8, 2017
Messages
27
just put sonarr in the pkgs list at the beginning (and take out all the other stuff as it's now in the dependencies of sonarr) and don't do your own messing around to download and install it... ???
Ok, so I tried that. Tried with the following script. It gives the same result. No working WebGUI.
Code:
#!/bin/sh
#
# Install sonarr in iocage jail.
#
#
echo '{"pkgs":["sonarr"]}' > /tmp/pkg.json
iocage create -n sonarr -p /tmp/pkg.json -r 13.2-RELEASE ip4_addr="vnet0|192.168.1.74/24" defaultrouter="192.168.1.1" vnet="on" allow_raw_sockets="1" allow_mlock="1" boot="on"
rm /tmp/pkg.json

iocage exec sonarr mkdir -p /config /mnt/datapool
iocage fstab -a sonarr /mnt/Volume2/Tank/ /mnt/datapool nullfs rw 0 0
iocage exec sonarr chown -R sonarr:sonarr /config /usr/local/share/sonarr

iocage exec sonarr sysrc sonarr_enable=YES sonarr_user=sonarr sonarr_group=sonarr sonarr_data_dir=/config
iocage exec sonarr service sonarr start


The end of the logfile looks like this.
Code:
2024-02-19 22:40:05.1|Info|MigrationLogger|*** 168: add_additional_info_to_pending_releases migrating ***
2024-02-19 22:40:05.1|Info|add_additional_info_to_pending_releases|Starting migration of Log DB to 168
2024-02-19 22:40:05.1|Info|MigrationLogger|*** 169: add_malayalam_and_ukrainian_languages migrating ***
2024-02-19 22:40:05.1|Info|add_malayalam_and_ukrainian_languages|Starting migration of Log DB to 169
2024-02-19 22:40:05.3|Info|OwinHostController|Listening on the following URLs:
2024-02-19 22:40:05.3|Info|OwinHostController|  http://*:8989/
2024-02-19 22:40:05.6|Info|SonarrBootstrapper|Starting Web Server
2024-02-19 22:40:06.1|Info|UpdaterConfigProvider|Update mechanism BuiltIn not supported in the current configuration, changing to External.
2024-02-19 22:40:06.2|Info|QualityProfileService|Setting up default quality profiles
2024-02-19 22:40:06.2|Info|LanguageProfileService|Setting up default language profiles


I have no problems installing the sonarr Plugin. That one works fine.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
2024-02-19 22:40:05.3|Info|OwinHostController| http://*:8989/ 2024-02-19 22:40:05.6|Info|SonarrBootstrapper|Starting Web Server
That looks like a working sonarr instance...

Are you sure you used the right address to connect?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
And could you ping the jail and see the status of the service (service sonarr status)
 

xCatalystx

Contributor
Joined
Dec 3, 2014
Messages
117
Does sonarr own both dirs? I had an issue (when i upgraded) were the service would run but the UI would timeout. I chown and restarted the service.

chown -R sonarr:sonarr /usr/local/share/sonarr
chown -R sonarr:sonarr /usr/local/sonarr/

edit: seem you set the /config env - check /config aswell
 

thxtex

Dabbler
Joined
Dec 8, 2017
Messages
27
And could you ping the jail and see the status of the service (service sonarr status)
Yes it is running.

Code:
root@sonarr:/ # service sonarr status
sonarr is running as pid 8226.
root@sonarr:/ #
 

thxtex

Dabbler
Joined
Dec 8, 2017
Messages
27
Does sonarr own both dirs? I had an issue (when i upgraded) were the service would run but the UI would timeout. I chown and restarted the service.

chown -R sonarr:sonarr /usr/local/share/sonarr
chown -R sonarr:sonarr /usr/local/sonarr/

edit: seem you set the /config env - check /config aswell
As you can see I do the chown in the script. I also checked to be sure.

Both /config and /usr/local/share/sonarr are set correct.
I don't have /usr/local/sonarr/ because I have settings stored in /config.
 

xCatalystx

Contributor
Joined
Dec 3, 2014
Messages
117
No problem - I only mentioned it because i had 2 separate instances were the perms went all weird so it was more a just incase maybe check.

Maybe just RM the jail and try again?

I just did the following and it worked (in a new jail):
iocage create -n sonarr_test -r 13.2-RELEASE ip4_addr="" defaultrouter="" vnet="on" allow_raw_sockets="1" allow_mlock="1" boot="on"
iocage console sonarr_test
echo 'FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/\${ABI}/latest\" }' > /usr/local/etc/pkg/repos/FreeBSD.conf.test
pkg
pkg update && pkg upgrade
pkg install sonarr
sysrc sonarr_enable=YES sonarr_user=sonarr sonarr_group=sonarr
chown -R sonarr:sonarr /usr/local/share/sonarr
service sonarr start

So maybe start with barebone setup - if sonarr starts and the webui is happy:
>stop the service
>rm the old config dir
>add your fstab mount and 'sysrc sonarr_data_dir'
>check the owner:group
>start service and hopefully webui pops up
 

thxtex

Dabbler
Joined
Dec 8, 2017
Messages
27
Ok, sorry for wasting all your time..... I have found the issue.... Should have checked that the chosen IP adress is not in use by something else....
With a different IP adress even my first script works fine.
 
Top