Losing my mind - pkg depends on jailname?

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
So I was going to do a video about using @danb35 's plex install script. And, after some changes (interface name bad in 11.3), it sorta worked - only plexmediaserver would never install.

More changes, more changes, and I am now at a point that makes no sense at all. I can reliably reproduce the following behavior.

Create a jail named 'plex'. pkg won't install, complains it can't find pkg:

Code:
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:11:amd64/latest, please wait...
pkg: Error fetching http://pkg.FreeBSD.org/FreeBSD:11:amd64/latest/Latest/pkg.txz: Connection reset by peer
A pre-built version of pkg could not be found for your system.
Consider changing PACKAGESITE or installing it from ports: 'ports-mgmt/pkg'.
Command: pkg install plexmediaserver failed!
Failed to install plexmediaserver package


Try the exact same thing on a jail named 'lex'. And everything works fine:

Code:
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:11:amd64/latest, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
[lex] Installing pkg-1.13.2...
[lex] Extracting pkg-1.13.2: 100%
Updating FreeBSD repository catalogue...
[lex] Fetching meta.conf: 100%    163 B   0.2kB/s    00:01
[lex] Fetching packagesite.txz: 100%    6 MiB  97.1kB/s    01:07
Processing entries: 100%
FreeBSD repository update completed. 31560 packages processed.
All repositories are up to date.
Updating database digests format: 100%
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        plexmediaserver: 1.18.9.2578

Number of packages to be installed: 1

The process will require 367 MiB more space.
96 MiB to be downloaded.
[lex] [1/1] Fetching plexmediaserver-1.18.9.2578.txz: 100%   96 MiB   1.3MB/s    01:17
Checking integrity... done (0 conflicting)
[lex] [1/1] Installing plexmediaserver-1.18.9.2578...


No, I don't have another jail named plex. I had one called plex-old and one called Plex-Transcode, and I've now renamed them both out of sheer paranoia. And I can repeat this behavior - try it with a "plex" jail it fails; try it with a "lex" jail it succeeds.

root@freenas[~/freenas-iocage-plex]# iocage list
+-----+------+-------+--------------+------------------+
| JID | NAME | STATE | RELEASE | IP4 |
+=====+======+=======+==============+==================+
| 1 | LMS | up | 11.3-RELEASE | DHCP |
+-----+------+-------+--------------+------------------+
| 66 | PMS | up | 11.3-RELEASE | DHCP |
+-----+------+-------+--------------+------------------+
| 55 | hex | up | 11.3-RELEASE | DHCP |
+-----+------+-------+--------------+------------------+
| 72 | lex | up | 11.3-RELEASE | 192.168.3.129/24 |
+-----+------+-------+--------------+------------------+

If it was 4/1 I'd say FreeNAS is playing an April Fool's on me, but it's 4/4. This. Makes. No. Sense.

What gives? Any ideas, things I can track down?
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,974
I thought @danb35 script created the jail automatically as part of the install process.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
It does. Named plex. And then it fails. If I name it anything else - lex, pms, what have you - it works. Confirmed using the script, and using a manual create. As I say, I'm losing my mind over here.

I gave danb a PR to work around that, and a couple other changes, some more flavor than others. https://github.com/thorsteneb/freenas-iocage-plex
 
Joined
Jul 10, 2016
Messages
521
I cannot reproduce this. I suspect there's something with your network...

Renaming a jail in FreeNAS 11.3 does not change the hostname. Could it be that you have a host-file out there or setting in your dns server that assigns "plex" to a fixed IP address and your new plex jail conflicts with another instance?
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Thank you @Jurgen Segaert . That was it. Now, it's not a host file or a dns setting. I use public DNS, I don't have anything local going. FreeNAS, as well, cannot resolve the name "plex".

And, when two jails with the same hostname are running, I have issues. That might be due to my gateway, or it might be due to FreeNAS.

What I was testing is the use case where a user has an old plugin named "plex" and want's to use @danb35 's script to create a Plex jail, then move the metadata over. This is definitely one of the more common use cases for that script.

In my testing, if I shut down the plugin version of plex, renamed to plex-old and still with hostname plex, then a jail named plex with hostname plex can communicate; if plex-old is running, pkg will fail.

@danb35, in light of that, I feel good about changing the default name in the PR I gave you. The Plex plugin was named "plex" by default for a long time, and if there's a chance of creating a conflict, it's easier to change the name your script uses. "pms" is a suggestion, anything will do.

I'll do one more test, which is changing the hostname of the plex-old jail. If this theory holds, then that should resolve the issue as well. Edit: rc.conf and hosts inside the old jail aren't sufficient to resolve the issue. Stopping the old jail is.

Man, that was bizarre. I spent hours today trying to figure out what was going on.
 
Last edited:

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,737
You are from Germany, right? Fritzbox (most common CPE device here) will create a DNS entry for every new device (or jail, vm, whatever) registering via DHCP ...

HTH,
Patrick
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Born in Germany, live in the US. My gateway is a Fortigate. It’s entirely possible it does something on-box for hostnames that goes haywire when the same host name is seen twice, once via DHCP and once not.
 
Top