Updated my plex plugin - here's how

CraigD

Patron
Joined
Mar 8, 2016
Messages
343
The PLEX update broke PLEX for me

After about 2 hours we got Version 1.15.2.793 working (FreeNAS-11.0-U2 (e417d8aa5) non PLEX pass)

I couldn't get it working but my friend figured it out, I don't know how he did it

It shouldn't be this hard, my advise don't upgrade PLEX unless you have to

Have Fun
 

marcevan

Patron
Joined
Dec 15, 2013
Messages
432
It's a tad easier to update the old jails with a tar ball in 11.0 than it is in 11.2 Iocage, but I'm not one to try that stuff anymore. Just too much can go wrong.

But like I said prior, when there's a critical bug I'm facing and it's fixed by the plex team, 90 days is quite awhile to wait.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
But like I said prior, when there's a critical bug I'm facing and it's fixed by the plex team, 90 days is quite awhile to wait.
If you can't wait don't use the plugin. Installing in a standard jail is simple and easy to keep up to date.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
If you can't wait don't use the plugin. Installing in a standard jail is simple and easy to keep up to date.
...especially once you change to the "latest" rather than "quarterly" repository.
 

bbenz3

Explorer
Joined
Jan 22, 2012
Messages
70
So I attempted to build up a iocage build server last night to try and build the Plex plugin using the iocage plugin directions. That didn't work. However, if someone can't point me in the direction for how to properly build the plugin I would be happy to work on it.
 

marcevan

Patron
Joined
Dec 15, 2013
Messages
432
Don't build the plugin, build the jail.

Create a jail using FreeNAS GUI. It's still iocage, but it's called jails anyway and you give it a name "Plex" or whatever to establish the jail and use advanced setup with the top 3 check boxes checked.

Stop the jail then still in the jail page add storage from your media files to it's locations (I use it's Media folder so I create /TV or /Movies there).

Download the Plex file from Plex.tv and be sure it's for Unix or FreeNAS or basically not Linux, etc. If you use Windows and can copy it to a share on your freenas, just make sure you add that location to the jail's storage (even temporarily) so you can then go to shell, iocage list, then iocage console plex (or whatever name you gave it) and go copy the download back to the root folder of your Plex jail.

From there it's basically tar the file, then gunzip or however it's packed to unpack it and you'll of course need to make plex a service and there's plenty links in these forums for that (echo command _enable >> rc.conf) so it runs as a service and autostarts, etc.

That's the 5k foot level for what you need to do.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Download the Plex file from Plex.tv and be sure it's for Unix or FreeNAS or basically not Linux, etc. If you use Windows and can copy it to a share on your freenas, just make sure you add that location to the jail's storage (even temporarily) so you can then go to shell, iocage list, then iocage console plex (or whatever name you gave it) and go copy the download back to the root folder of your Plex jail.

From there it's basically tar the file, then gunzip or however it's packed to unpack it and you'll of course need to make plex a service and there's plenty links in these forums for that (echo command _enable >> rc.conf) so it runs as a service and autostarts, etc.
...and you can replace all this with pkg install plexmediaserver (or pkg install plexmediaserver-plexpass as appropriate).
 

bbenz3

Explorer
Joined
Jan 22, 2012
Messages
70
You missed the point of my question. I don't want to do that I want to help the community by building the plugin. I have built a jail, docker, and a stand alone VM to run Plex in. I'd rather not do that and would like to help by updating the plugin.
 

marcevan

Patron
Joined
Dec 15, 2013
Messages
432
Glad you're looking to help build the plugin; however, that is not something undertaken lightly nor is it under this forum's purview.
 

bbenz3

Explorer
Joined
Jan 22, 2012
Messages
70
Glad you're looking to help build the plugin; however, that is not something undertaken lightly nor is it under this forum's purview.

Yeah I can understand that. I just figured that I can either maintain my own setup or help fix it for everyone.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I want to help the community by building the plugin
The thing is, the plugins aren't something that's "built" any more. In 11.1 and earlier, plugins were .pbis--pretty much everything compiled into a single package (which was pretty much all done by one person). With 11.2, though, the "plugin" is pretty much a script describing what packages need to be installed, with some (limited) post-installation configuration. You can create your own, or if there are bugs in the official ones, I guess iX would accept pull requests to fix them. But if it's just a matter of upgrading a package to the latest version, that's a matter of waiting for iX to pull the updated package into their repo.
 

bbenz3

Explorer
Joined
Jan 22, 2012
Messages
70
The thing is, the plugins aren't something that's "built" any more. In 11.1 and earlier, plugins were .pbis--pretty much everything compiled into a single package (which was pretty much all done by one person). With 11.2, though, the "plugin" is pretty much a script describing what packages need to be installed, with some (limited) post-installation configuration. You can create your own, or if there are bugs in the official ones, I guess iX would accept pull requests to fix them. But if it's just a matter of upgrading a package to the latest version, that's a matter of waiting for iX to pull the updated package into their repo.

Yeah I have started to get that. I attempted to "create my own" and used the updated repo that iX has for "unstable" that includes the newest version of the Plex plugin just to see if that would work. It didn't. Within reason I think I could fix it if I understood the process for porting it from what Plex provides (or from FreeBSD) and then provide it back to the community. I know that iX has a full time job of just managing the FreeNAS/TrueNAS baselines so if I could help I would love to.
 

rjgould

Dabbler
Joined
May 28, 2011
Messages
32
I got my Plex Media Server plugin updated. This wasn't entirely intuitive, so here's the process I followed.

https://www.ixsystems.com/blog/december-freenas-plugins-updates/ is the blog post that mentions update from CLI.

In my case, I had Plex Media Server (Plexpass) installed, and it came in as a jail named "plex". TL;DR: That naming was the problem.

Attempting to update from UI (11.2-U1) claimed it was successful, but the Plex version hadn't changed.
Attempting to update from CLI complained about a missing plex.json, which was the required clue.

To fix:

Edit: I stopped the jail before doing this, and started it after. I'm assuming it needs to be stopped, but I didn't try it while running.

Open CLI from UI
# Ctrl-Insert and Shift-Insert are your friend to avoid excessive typing - allows copy/paste in the web CLI window
iocage list
# Get the name of your jail. In my case it was plex, adjust as necessary on your system
iocage rename plex plexmediaserver-plexpass
# That step will differ depending on which you want: Rename to plexmediaserver or to plexmediaserver-plexpass
# The goal here is to match the json. See also /mnt/MYMOUNTPOINT/iocage/.plugin_index
iocage list
# Just to verify that worked
iocage snaplist plexmediaserver-plexpass
# Or indeed plexmediaserver, whichever one you have. If this is empty great; if not, we need to remove a snapshot first
iocage snapremove plexmediaserver-plexpass -n NAME_THAT_SNAPLIST_SHOWED_YOU
# Otherwise you just get "we already have a snapshot" on update attempt, not very helpful.
iocage update plexmediaserver-plexpass
# Or plexmediaserver, if that's what you have. This should now show messages about updating your plex plugin, as the name matches the .json

It's quite possible that after rename and removal of previous-failed-attempt snapshot, the UI update button would have worked just as well. I didn't test that.
Thanks for this, it had been bothering me for ages that I could not get my plugin to update properly. Turns out it was just because the original iocage plugin name for the jail was just "plex" and this completely sorted it out.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
I tried updating from UI for the first time in a long time, with the 11.3RC1. And it worked! No more need for iocage commands.

This was with a plugin jail renamed from “plex” to “plexmediaserver-plexpass”, see original post. I’m not sure how a fresh install names the jail.
 

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
I tried updating from UI for the first time in a long time, with the 11.3RC1. And it worked! No more need for iocage commands.

This was with a plugin jail renamed from “plex” to “plexmediaserver-plexpass”, see original post. I’m not sure how a fresh install names the jail.

Would you anticipate that after the rename, the iocage upgrade -r 11.3-RELEASE command would also work?
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Would you anticipate that after the rename, the iocage upgrade -r 11.3-RELEASE command would also work?

Yes. It did for me. I upgraded Plex to 11.3-RELEASE from command line, then updated its version from GUI. Both went smoothly.
 

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
Yes. It did for me. I upgraded Plex to 11.3-RELEASE from command line, then updated its version from GUI. Both went smoothly.
Did you also need to update the mount point in the jail?
 

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
This is what i get when i try to do iocage upgrade in the current state:

Code:
root@FreeNAS-L3426[~]# iocage upgrade plex -r 11.3-RELEASE
Snapshotting plex...
Snapshot already exists
Updating plugin INDEX...
Traceback (most recent call last):
  File "/usr/local/bin/iocage", line 10, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/iocage_cli/upgrade.py", line 40, in cli
    ioc.IOCage(jail=jail, skip_jails=skip_jails).upgrade(release)
  File "/usr/local/lib/python3.7/site-packages/iocage_lib/iocage.py", line 2065, in upgrade
    ).upgrade(jid)
  File "/usr/local/lib/python3.7/site-packages/iocage_lib/ioc_plugin.py", line 1251, in upgrade
    self.iocroot, 'jails', self.jail, f'{plugin_name}.json'
  File "/usr/local/lib/python3.7/shutil.py", line 248, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/local/lib/python3.7/shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/Media/iocage/.plugins/github_com_freenas_iocage-ix-plugins_git/plex.json'
root@FreeNAS-L3426[~]#                
 
Last edited:

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Can you update that to show the full traceback?

And no, I did not need to update the mount point.
 
Top