danb35 / freenas-iocage-plex

Scripted installation of Plex Media Server in a FreeNAS jail
GNU General Public License v3.0
58 stars 9 forks source link

Script fails in TrueNAS 12.2 #17

Open calperin opened 2 years ago

calperin commented 2 years ago

After follow the procedure in a new TrueNAS 12.2 install, i get

root@truenas12[/truenas-plex/freenas-iocage-plex]# ./plex-jail.sh Netmask not set, defaulting to /24 (255.255.255.0) Plex metadata path not set, defaulting to /mnt/Data/plex_data Plex media path not set, please mount media directory manually when done Not configuring hardware transcode Using stable-release plexmediaserver code Creating jail pms. This may take a minute, please be patient. pms successfully created! No default gateway found for ipv6.

I have the plex-config

JAIL_IP="192.168.1.19" DEFAULT_GW_IP="192.168.1.1" POOL_PATH="/mnt/Data"

and ran the ./plex-jail.sh from the directory I created for the download from git

My server has different NICs (Total 8), and the IP is in the same subnet of my Default Gateway.

I believe that this should be related to the pkg install problem, but not sure since I don't know your script

calperin commented 2 years ago

I 'm reading your script, and it is reporting for FreeNAS 11.x. It should work in TrueNAS 12?

GJSchaller commented 2 years ago

I am having a similar issue on TrueNAS 13:

Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
[pms] Installing pkg-1.17.5_1...
[pms] Extracting pkg-1.17.5_1: 100%
Updating FreeBSD repository catalogue...
pkg: http://pkg.freebsd.org/FreeBSD:13:amd64/latest/meta.txz: No address record
repository FreeBSD has no meta file, using default settings
pkg: http://pkg.freebsd.org/FreeBSD:13:amd64/latest/packagesite.pkg: No addressrecord
pkg: http://pkg.freebsd.org/FreeBSD:13:amd64/latest/packagesite.txz: No addressrecord
Unable to update repository FreeBSD
Error updating repositories!
Command: pkg install plexmediaserver failed!
Failed to install plexmediaserver package
* Stopping pms
  + Executing prestop OK
  + Stopping services OK
  + Tearing down VNET OK
  + Removing devfs_ruleset: 1004 OK
  + Removing jail process OK
  + Executing poststop OK
Destroying pms
root@TrueNAS[/mnt/data/scripts/freenas-iocage-plex]#
danb35 commented 2 years ago

I either missed or overlooked the original issue, likely because there's no such thing as TrueNAS 12.2. But the problem, both in the OP and for @GJSchaller, is networking for the jail in question.

GJSchaller commented 2 years ago

My config is simple, and works for other Jails / scripts with the same network settings:

JAIL_IP="10.0.0.245" DEFAULT_GW_IP="10.0.0.1" POOL_PATH="/mnt/data"

GJSchaller commented 2 years ago

As a test, I created several Jails and tried to run "pkg install plex" on them.

Base jail, 13.1, hardcoded IP address - pkg would not install Base jail, 13.1, using DHCP - pkg installed without issue Clone jail, 13.1, using DHCP - pkg installed without issue

I'm guessing something about the jail creation is not picking up DNS?

GJSchaller commented 2 years ago

I tried modifying the script a bit - with the following changes, it successfully installs pkg, but then fails when updating the manifest. I'm trying to compare the script to other, working scripts (like Nextcloud) to see why one works, and one does not, if that will help clear things up.

JAIL_IP=""
JAIL_INTERFACES=""
DEFAULT_GW_IP=""
INTERFACE="vnet0"
VNET="on"
POOL_PATH=""
JAIL_NAME="plex"
USE_HW_TRANSCODE="0"
PLEX_CONFIG_PATH=""
PLEX_MEDIA_PATH=""
USE_BETA=0
# USE_BASEJAIL="-b"
PLEXPKG=""
HW_TRANSCODE_RULESET="10"
DEVFS_RULESET=""
RULESET_SCRIPT="/root/scripts/plex-ruleset.sh"
GJSchaller commented 2 years ago

OK, I tired adding some comments to the script to see where it failed. After doing this, the script ran, created the jail, and completed without error - I got the final message to browse to the IP and configure Plex. Once I browsed to the URL, I got the UI and was able to log into Plex. My modified script is attached, if that helps clear things up.

plex-jail.sh.txt