My Plex is now FUBAR - Iocage issues...

Status
Not open for further replies.

Brad1976

Dabbler
Joined
Mar 31, 2015
Messages
40
So when the drop down menu in System -> Update claimed that 11.2 is stable, I installed it... I then started converting my jails from warden to iocage using the 11.2-Release of iocage since 11.1 was already EOL. I got to the point where I found out about the issues with the tun0 devices when attempting to install openvpn for my transmission. I waited about a week or two for the most recent release that was supposed to fix that bug, but it didn't work. Since I'm now effectively wasting the money I paid for my PIA subscription as I have nothing else that will be using it, I rolled back my install of Freenas to 11.1-U6 and attempted to start reinstalling my iocage jails from scratch.

I did the iocage clean command to clear all cashe and I even attempted to re-fetch 11.2 version of iocage, but then I found out about the incompatibility of the 11.1 kernel of the freenas host OS and the 11.2 kernel of iocage. So then I fetched the 11.1 version of iocage, even though it is EOL and attempted to recreate my jails again. Using the 11.1 Release of iocage, I created my jails. I ran into the problem where the jails had no internet connection, which I solved by turning off the vnet and setting a static ip. Then I ran into a problem with trying to use pkg where it was giving me kernel version incompatibility errors. I was able to solve that problem by manually creating the /pk/repos folders and putting in the FreeBSD.conf file, then running pkg update and upgrade commands. I modified the FreeBSD.conf file quite a few times until I was able to find the one and only site that just happens to NOT give me any kernel compatibility issues, which happens to be url: "pkg+http://pkg.freebsd.org/freebsd:11:x86:64/release_2/". Once I got pkg updated with no errors or warnings I then installed plex using "iocage exec PMS pkg install multimedia/plexmediaserver-plexpass". However, it only installs version 1.12.1.4885, and my old warden jail was running 1.13.5something... I use the localhost:32400/web to claim and activate the server, of which I am also able to access using my external port forward with no problems. However, the final hurdle I'm having is that once I run the rsync command to restore all my metadata, the server will no longer start up as a service within the jail... I have even attempted to rename the Preferences.xml file to Original-Preferences.xml before doing the restore, and then replace it after the restore is finished... (Side note -> I love rsync!!! Only it takes less than 5 min to restore just over 14Gb of metadata!!!!! Mind you it is going from one folder to another both on an SSD... lol) I have tried pretty much everything I can think of and I've pretty much exhausted my troubleshooting thoughts to the point where I want to now solve the problem with a liberal application of high explosive and do a full reinstall of the entire FreeNAS OS from the ground up.....

About the only thing I have NOT been able to find an answer for that I can think of..... Is it possible to do a full uninstall of everything iocage and then reinstall it all over again? I cannot help but think or suspect that there is some sort of kernel incompatibility because when I initially fired up the iocage for the VERY first time, it was in FreeNAS 11.2 and then I downgraded to 11.1..... Kind of like if I run an "iocage destroy" to blow away a jail and start all over again with the jail... Is it even possible to destroy everything iogace and start it all over again, or it is too "built-in" to the FreeNAS OS, kind of like the days when MS forced everyone to take all their non-OS related software with Windoze? lol

Thanks in advance to anyone who may be able to offer some help!!! And just a quick heads up that the only access I will have until Wednesday evening will be via remote access with SSH and FileZilla...
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
Given all the changes you have made back and forth between versions, I can think of two good options: 1) Do a fresh install of FreeNAS, or 2) set up PIA on your router (if it supports OpenVPN) and map the transmission IP address to use the VPN while everything else uses straight WAN. If it were me, I'd just do a clean install and start over. It will probably save you time in the long run.

I've had good luck with 11.2-RC2 so far, but I have not tried to install a VPN. Check the release notes.
 

Brad1976

Dabbler
Joined
Mar 31, 2015
Messages
40
I was really hoping NOT to do a full reinstall, simply due to the time available to me. Lol However, if I have to I can and will... 11.2-RC2 was working AWESOME for me as well, right up until I attempted to config openvpn within the transmission jail where I ran into the bug where openvpn cannot dynamically create the tun0 device and fails to start the service everytime... That's when I patiently waited a week or two for the most recent release where it was supposed have been fixed, but wasn't... As for configuring the router, I currently have the server at on location but there will be plans in he future to possibly relocate it if I end up moving, in which the router will not be coming with me. And I would like to not have to buy myself another router as our ISP modem / routers wont support VPN configs... Trust me, I considered it... lol Thanks for the feedback!!!
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
If you back up your FreeNAS configuration, doing a clean re-install and restoring your configuration is simple and very straightforward. Not a big deal at all and your data will not be affected. It has been my experience that this is often quicker than trying to fix a problem that became too messy. Also, be sure to back up your Plex meta data so that you don't have recreate everything.

If you don't want to do a clean FreeNAS install, I would think that you could destroy all your jails and then delete the iocage dataset that is created when you activate iocage. At that point, everything should be gone... but I will admit that I have never tried to do this. It would actually be less work to just do a clean FreeNAS install and restore the configuration.

Good luck.
 

Brad1976

Dabbler
Joined
Mar 31, 2015
Messages
40
Hey pschatz100. I finally have a bit of time to work on this tonight. I was trolling the Plex forums, and stumbled across the possibility of simply deleting the Preferences.xml file and it should end up creating a new one when I fire up Plex for the first time. So I plan on creating a new iocage jail, get Plex installed, import the metadata (still love how rsync copies 14Gb of data in under 5 min lol) and see what happens when I fire up Plex after that... All my previous attempts, I installed Plex, fired it up to claim the server in my Plex-Pass account and then restored all the data... I'll let you know the results. Failing that, I'll see about deleting the entire Iocage dataset, reboot entire server and install Iocage from scratch to see what happens... (Might as well see if I can contribute to the greater cause to see what happens. *polishing halo* lol) If that too fails, I'll do the full reinstall, but that might have to wait for another couple of weeks just to make sure I'm all prepped...) Fortunately, while it will be a PITA kind of nuisance, I'm not too worried about the data overall as I do have a complete backup on a totally separate server running Win 10, in NTFS partitions... I've been running that since I first started using FreeNAS simply because ZFS was new to me and I had lost data before. However, I'm now trying to save up enough cointo build a separate server with alarge enough pool and then also make my backup server a FreeNAS box as well! (Yeah, two separate servers because one never can be TOO careful in the even of a critical hardware failure!) ;) lol

Anyway.... *fingers crossed* ;) Thanks again for the advise!!!
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
You can try deleting the Plex Preferences.xml file and see if that helps anything. You will just have to re-enter your Plex configuration information. As far as reinstalling iocage, I wouldn't bother. It will be less work and more likely to succeed if you do a new FreeNAS install
 

garm

Wizard
Joined
Aug 19, 2017
Messages
1,556
Reinstalling FreeNAS won’t do much as iocage is self contained. You can nuke the jail and start over, but you might have messed up the templates when you did your back and forth?

What I think you should do is sit tight and wait the release of 11.2, it should be out any minute now. Once the successful upgrades start pouring in to the forum do the same and rebuild the jails causing you issues. I don’t do much network magic on jail level so I can’t help out to much about that, but 11.2-RC2 has been stable enough for me with multiple vlans and routes using vnet.
 

Brad1976

Dabbler
Joined
Mar 31, 2015
Messages
40
Update -> I ended up running completely deleting the iocage dataset and then did a full shutdown of the server, waited about 5 min (put a load of laundry on lol) and fired it back up. I activated a new iocage dataset and fetched 11.2-Release. I the created a new PMS jail using the CLI but when I ran "pkg update" I still had the kernel mismatch error... I then did a backup of the OS config and downloaded the latest ISO and made myself a new bootable USB. I shut down the server and the paranoid side of me disconnected all the SATA cables from the mobo to the drives and I removed one of the SuperDOM's. I installed a new fresh install of 11.2 FreeNAS OS. Got the other SuperDOM installed and made a mirror of the OS drive. I then got all other drives working and imported the pools via the GUI. (I'm not getting the occasional "unrecoverable error" alert from one of the drives, but quite frankly I'll worry about that part later. lol

I deleted the old iocage dataset and created a new one, fetched the 11.2-Release again and created a new PMS dataset via the CLI. This time, when I got to "pkg update", the kernel matched. I was even able to find the same version of Plex through pkg that I had installed on my Warden jail, but sadly, I'm now facing an issue that whenever I attempt to restore all the database and metadata from my previous Warden install, when I try to access the PMS again via the local IP in my browser, I keep getting the error that the server won't respond, even though I'm able to ping the server and when I check the service, the service is apparently running... I know it's a Plex issue and not a FreeNAS issue though...

I unfortunately won't be able to keep working on it until the weekend, and even then I'm not sure how much time I'm going to get... However for the sake as a reference in case anyone else ends up having issues, I'll keep you all updated! :)
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
I deleted the old iocage dataset and created a new one, fetched the 11.2-Release again and created a new PMS dataset via the CLI. This time, when I got to "pkg update", the kernel matched. I was even able to find the same version of Plex through pkg that I had installed on my Warden jail, but sadly, I'm now facing an issue that whenever I attempt to restore all the database and metadata from my previous Warden install, when I try to access the PMS again via the local IP in my browser, I keep getting the error that the server won't respond, even though I'm able to ping the server and when I check the service, the service is apparently running... I know it's a Plex issue and not a FreeNAS issue though...

I unfortunately won't be able to keep working on it until the weekend, and even then I'm not sure how much time I'm going to get... However for the sake as a reference in case anyone else ends up having issues, I'll keep you all updated! :)
Did you create the iocage jail by hand, or through the GUI? Did you implement Vimage (VNET) option? Plex needs that to work properly. Also, you can try deleting the Preferences.xml file. You will have to re-enter your Plex preferences but sometimes this will help straighten things out. Much of this is discussed in the Plex forums.
 

Brad1976

Dabbler
Joined
Mar 31, 2015
Messages
40
Funny how you should mention the Plex forums... I couldn't sleep last night and made bookmarks in my phone laying in bed from a LOT of research... lol

To answer your question though, yes I created the jail via CLI. I've been using FreeNAS since 9.8 and LOVED 9.10. Stable enough to withstand a NUKE as far as what I used it for! And yes, I know there will be growing pains, for 11, so not upset. Just don't like not knowing how to fix things. lol

Almagamating various sources, this is what I've been doing for the installation of Plex:

Step 1: Create the jail
Code:
iocage create -n "PMS" -r 11.2-RELEASE ip4_addr="vnet0|192.168.xxx.xxx/24" defaultrouter="192.168.xxx.xxx" vnet="on" allow_raw_sockets="1" boot="on"


Step 2: Attach storage using the iocage fstab command
Code:
iocage fstab -a PMS /mnt/Tank/Movies /media/Movies nullfs rw 0 0
iocage fstab -a PMS /mnt/Tank/Music /media/Music nullfs rw 0 0
iocage fstab -a PMS /mnt/Tank/TVShows /media/TVShows nullfs rw 0 0
iocage fstab -a PMS /mnt/Tank/TVShowsArchive /media/TVShowsArchive nullfs rw 0 0
iocage fstab -a PMS /mnt/Jails/JailBackups/PlexMediaServer /media/Backup nullfs rw 0 0


Step 3: Update pkg
Code:
iocage exec PMS pkg update


Step 4: Install Plex
Code:
iocage exec PMS pkg install multimedia/plexmediaserver-plexpass


Step 5: Config to start Plex automatically
Code:
iocage exec PMS sysrc plexmediaserver_plexpass_enable=YES


Step 6: Create a media group and add plex to the group. (I happen to use the group method for permissions and my jails so all the various jails can work together.)
Code:
iocage console PMS
pw groupadd -n media -g 816
pw groupmod media -m plex
exit


Step 7: Start up the service
Code:
iocage exec PMS service plexmediaserver_plexpass start


Step 8: Access the web GUI via http://192.168.xxx.xxx:32400/web and claim the server

Step 9: Stop the plex service
Code:
iocage exec PMS service plexmediaserver_plexpass stop


Step 10: Make a backup copy of the "Preferences.xml" file by simply renaming it to "Original-Preferences.xml"

Step 11: Restore all data from previous install
Code:
rsync -av /mnt/Jails/JailBackups/PlexMediaServer/Data/ /mnt/Jails/iocage/jails/PMS/root/usr/local/plexdata-plexpass/"Plex Media Server"


And here is where I run into the brick wall... When I attempt to start the server service again, I get no errors and when I even run the service ___ status command I get the return that it's running as a pid. However, when I attempt to access the server again via the local host web gui I continuously get that there is no response... I have tried the following solutions so far:

1. Deleting the data within the quotations for PlexOnlineHome="", PlexOnlineMail="". PlexOnlineToken="" and PlexOnlineUsername="".
2. Deleting the Preferences.xml file all together, but when I attempt to restart the service Plex is not recreating the file.
3. Actually using the same Preferences.xml file that I have backed up from my Warden jail, even when it's the exact same version between both the warden jail and the iocage jail, which happens to be V1.13.8.5395-10d48da0d.

I'll have about an hour to work on it tomorrow evening and I was going to see about running a chown command AFTER I run the rsync command to restore all the data and see if that might make a difference, but I don't see how since it's always been owned by the plex user within the warden jail.

I don't have my phone with me at the moment that has the bookmarks on it, so can't remember exactly what the other commans were, but I'm also going to try and see if I can use the "ln" command to make a link to a separate dataset on my mirrored SSD's that has all my jails running on it, so that should anything happen to the Plex jail in the future, all my data and metadata will be safe... (I happen to have just a little over 14Gb that gets moved by that rsync...
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
Well, with all the manipulation you have attempted to do with iocage, it is quite possible that something is missing or a version of some component is mismatched. If it were me, I would do a fresh FreeNAS install to a new boot device, then initialize iocage to a new dataset, install Plex and configure it. Nothing fancy and no need to worry about data until you have Plex running properly. Create the jail using the GUI - it should be OK, now.

I did something similar in the early days of plugins after I totally messed things up. That's one of the risks when working from the CLI when you don't completely understand what you are doing. At the end of the day, I spent a lot more time trying to figure things out than I spent just starting over. The good thing is that your data is not at risk.

Also, I would not try to install OpenVPN again until the issues with tun are resolved. Check the changelog for 11.2 to see if they say anything about this.

Edit: Someone posted a workaround for OpenVPN, that seems to work for 11.2-RC2.
 
Last edited:

raidflex

Guru
Joined
Mar 14, 2012
Messages
531
I would have not started the Plex server before restoring your data. I have done multiple Plex data restores over the years including from warden to iocage and had no issues.

Remove the jail and reinstall Plex. Copy over the Plex database and also make sure that the permissions are correct before starting the server and then start Plex.

VNET and raw sockets will need to be on also.


Edit:

Also, I would not try to install OpenVPN again until the issues with tun are resolved. Check the changelog for 11.2 to see if they say anything about this.

Edit: Someone posted a workaround for OpenVPN, that seems to work for 11.2-RC2.

Personally I would run OpenVPN on your router/firewall. I keep my networking to my PFsense firewall and Cisco managed switch.
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
VNET and raw sockets will need to be on also.
Been using Plex since it was available for FreeBSD. I don't have raw sockets on. Why do you need it?

VNET: yes.
 

mjt5282

Contributor
Joined
Mar 19, 2013
Messages
139
I have been successfully running PIA openvpn with (i believe) working port forwarding for transmission in its own jail for several weeks. so i can say this works fine on 11.2rc2 and 11.2 release. PMS-PP I also have running fine.
 

raidflex

Guru
Joined
Mar 14, 2012
Messages
531
Been using Plex since it was available for FreeBSD. I don't have raw sockets on. Why do you need it?

VNET: yes.

There is additional networking functionality that raw sockets provides. I enabled it just for compatibility and have had no issues, but you may be able to run without it.
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
There is additional networking functionality that raw sockets provides. I enabled it just for compatibility and have had no issues, but you may be able to run without it.
Enabling raw sockets opens up some potential security vulnerabilities, which is why it is off by default. If you need it for some advanced networking functionality, then OK. But I would not enable it unless you have a particular requirement for it. Plex does not need it.
 

Brad1976

Dabbler
Joined
Mar 31, 2015
Messages
40
Update - I managed to get it working... I have no idea how, but the first method I got it to work, I was NOT able to duplicate... Once, I was able to get the following to work:

1. Create a new iocage jail
2. Install PMS-PP
3. Login and claim the server install and call it PMS
4. Transfer all the metadata from my Warden Jail instance to the new iocage PMS instance
5. Start up the iocage instance and all the metadata was there and still showed what was played and not for each of the seperate 5 Plex user accounts I have.

I was NOT able to duplicate it this time as I had to basically follow each step from the Plex forums. This time, while my Warden Plex server was called "Plex Media Server - Warden" (named so to be able to tell them apart); once I finished transferring the data from the Warden Jail to the iocage jail and fired up the iocage jail instance, Plex showed the PMS server but it was named with the Warden. I still know it was the iocage install that was working because I had a seperate web browser logged into the FreeNAS OS in legacy mode and the plexmediaserver_1 was still shut down completely... So I just went into Plex Settings -> General and renamed the server instance to PMS and that will be good enough for me!!! :smile: Wife os now happy and well, you know what they say!!! Rotflmao

I won't be in a big rush on this part, but I did attempt one little twist... When I added the storage to my iocage jail I used the fstab command and it worked without a hitch to add the source to the destination "/media/Movies", "/media/TVShows" etc... I did attempt one twist where I have a seperate dataset on the same mirrored SSD the jails run from, and I attempted to add another fstab the add one for the /usr/local/plexdata/"Plex Media Server""" (or whatever it is... Please forgive if that's not 100% accurate as I'm in bed and should be sleeping right now... lmao) Needless to say it didnt qork unless I had all my metadata and directory structure locally copied into the iocage jail. Is there any technical reason why that wouldn't work like it does when I add the storage for the media content to the iocage jail? I have seen a few posts around where someone has done this using the "ln" (link) command... What's the major difference, technically speaking, between using fstab vs ln commands? (And in case I'm not clear, the intent here would be to have all your data and metadata for plex in a totally outside dataset so that it will always be protected just in case something with the Plex jail itself goes nuclear as well as to make backups of the data easier to administer as well... (My current critical system failure protection is that I have backups of all data on a completely seperate system.....)

Aside from that, my next step will be to get Transmission working with my PIA OpenVPN and then Medusa and Couchpotato (or perhaps its successor whatever it's called as I havent gotten around to that part of my research) and a few other stuff. Thanks for the help everyone!!!

Me
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
Glad you got your Plex working. Search the forums for comments about OpenVPN. There are some recent comments about getting it to work on older versions of FreeNAS.
 

raidflex

Guru
Joined
Mar 14, 2012
Messages
531
I won't be in a big rush on this part, but I did attempt one little twist... When I added the storage to my iocage jail I used the fstab command and it worked without a hitch to add the source to the destination "/media/Movies", "/media/TVShows" etc... I did attempt one twist where I have a separate dataset on the same mirrored SSD the jails run from, and I attempted to add another fstab the add one for the /usr/local/plexdata/"Plex Media Server""" (or whatever it is... Please forgive if that's not 100% accurate as I'm in bed and should be sleeping right now... lmao) Needless to say it didnt qork unless I had all my metadata and directory structure locally copied into the iocage jail. Is there any technical reason why that wouldn't work like it does when I add the storage for the media content to the iocage jail? I have seen a few posts around where someone has done this using the "ln" (link) command... What's the major difference, technically speaking, between using fstab vs ln commands? (And in case I'm not clear, the intent here would be to have all your data and metadata for plex in a totally outside dataset so that it will always be protected just in case something with the Plex jail itself goes nuclear as well as to make backups of the data easier to administer as well... (My current critical system failure protection is that I have backups of all data on a completely separate system.....)

Why not just keep the Plex database on your main pool in the default location? I keep my jails on my main pool and have no performance issues at all running many different app.

I would keep your actual media/data outside the jail and then just setup snapshots for the jails. This way if something goes wrong you can just go back to a previous snap. I try to keep things simple, all data is store on my main pool in RAIDZ2. Personally I would not even bother with SSD unless you intend to run bhyve VMs were you need better performance or you have a jail that has high IOP requirements.

The less moving parts the less points of failure.
 
Status
Not open for further replies.
Top