Updated my plex plugin - here's how

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
Can you update that to show the full traceback?

And no, I did not need to update the mount point.
Done. I noticed just now it was not entirely complete
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
And there you have it:

FileNotFoundError: [Errno 2] No such file or directory: '/mnt/Media/iocage/.plugins/github_com_freenas_iocage-ix-plugins_git/plex.json'


I recommend renaming your plex jail to either plexmediaserver, or plexmediaserver-plexpass. The latter is the "beta" version and can only (legally) be used with plexpass; the more stable version will of course also work with plexpass.

When you "ls /mnt/Media/iocage/.plugins/github_com_freenas_iocage-ix-plugins_git/" you'll find that the two json files related to plex in there are plexmediaserver.json and plexmediaserver-plexpass.json. That was the point of the original post: Once the jail is renamed to match either one, iocage commands that update or upgrade work.
 

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
And there you have it:

FileNotFoundError: [Errno 2] No such file or directory: '/mnt/Media/iocage/.plugins/github_com_freenas_iocage-ix-plugins_git/plex.json'


I recommend renaming your plex jail to either plexmediaserver, or plexmediaserver-plexpass. The latter is the "beta" version and can only (legally) be used with plexpass; the more stable version will of course also work with plexpass.

When you "ls /mnt/Media/iocage/.plugins/github_com_freenas_iocage-ix-plugins_git/" you'll find that the two json files related to plex in there are plexmediaserver.json and plexmediaserver-plexpass.json. That was the point of the original post: Once the jail is renamed to match either one, iocage commands that update or upgrade work.
Unfortunately it is not working. I get another error

Code:
root@FreeNAS-L3426[~]# iocage list
+-----+-----------------+-------+--------------+------+
| JID |      NAME       | STATE |   RELEASE    | IP4  |
+=====+=================+=======+==============+======+
| 4   | plexmediaserver | up    | 11.2-RELEASE | DHCP |
+-----+-----------------+-------+--------------+------+
root@FreeNAS-L3426[~]# iocage upgrade plexmediaserver -r 11.3-RELEASE
Snapshotting plexmediaserver...
Updating plugin INDEX...
/mnt/Media/iocage/jails/plex/plex.json was not found!
root@FreeNAS-L3426[~]#        


Seems to me the jail is now renamed but still there is a need for plex.json whilst it is now renamed to plexmediaserver.json
 
Last edited:

G8One2

Patron
Joined
Jan 2, 2017
Messages
248
You might need to be in the plex root before you run "iocage upgrade plexmediaserver -r 11.3-RELEASE"
 

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
You might need to be in the plex root before you run "iocage upgrade plexmediaserver -r 11.3-RELEASE"
nope, tried that. It doesn't find the iocage command. Interestingly enough. Everything still works fine so it must be something to do with the naming of the plugin. Maybe i should rename the json-file from plexmediaserver to plex?
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
I'm wondering what's going on with iocage, why it is looking for plex/plex.json after rename. On my system, that jail directory is now plexmediaserver-plexpass, and the json inside it is plexmediaserver-plexpass.json.

What's in /mnt/Media/iocage/jails for you? Where is that plex jail, and what is the json inside called?

I'm assuming you stopped, renamed, and restarted that jail.
 

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
so this is interesting:
Code:
root@FreeNAS-L3426[~]# cd /mnt/Media/iocage/jails
root@FreeNAS-L3426[/mnt/Media/iocage/jails]# ls -a
.        ..        plexmediaserver
root@FreeNAS-L3426[/mnt/Media/iocage/jails]# cd plexmediaserver
root@FreeNAS-L3426[/mnt/Media/iocage/jails/plexmediaserver]# ls -a
.            config.json        plugin
..            fstab            root
config_backup.json    plex.json
root@FreeNAS-L3426[/mnt/Media/iocage/jails/plexmediaserver]# iocage list
+-----+-----------------+-------+--------------+------+
| JID |      NAME       | STATE |   RELEASE    | IP4  |
+=====+=================+=======+==============+======+
| 1   | plexmediaserver | up    | 11.2-RELEASE | DHCP |
+-----+-----------------+-------+--------------+------+
root@FreeNAS-L3426[/mnt/Media/iocage/jails/plexmediaserver]#


I renamed the jail, as per your guideline, first stopped it, renamed and started again but in the jail, the plugin is still named plex.json. The thing is though, the directory name has changed to plexmediaserver
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
It’s entirely plausible that I may have renamed my json at some point, the one inside the jail that is. It’s been up and running for a while
 

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
It’s entirely plausible that I may have renamed my json at some point, the one inside the jail that is. It’s been up and running for a while
The thing is, it is searching for plex/plex.json whereas now it has become plexmediaserver/plex.json
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Yes, which puzzles me. Iocage is looking in the old location.
In my case, there were FreeNAS updates and reboots between the rename and the eventual upgrade command. Why iocage is looking for your jail in an old location, and how to teach it not to do that, I do not know.
 

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
Yes, which puzzles me. iocage is looking in the old location.
In my case, there were FreeNAS updates and reboots between the rename and the eventual upgrade command. Why iocage is looking for your jail in an old location, and how to teach it not to do that, I do not know.

I fixed it! Here is how
 

kskreider

Dabbler
Joined
Sep 13, 2017
Messages
18
I got my iocage upgraded to 11.3 fine but can no longer go in and manually update the Plex plugin installation as I used to on 11.2.

I also lost access to my Plex server settings and am afraid that it may have to do with me stupidly changing permissions.
 

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
I got my iocage upgraded to 11.3 fine but can no longer go in and manually update the Plex plugin installation as I used to on 11.2.

I also lost access to my Plex server settings and am afraid that it may have to do with me stupidly changing permissions.

I wouldn't panic too much. I had the same issue. Have you rebooted FreeNAS? Have you checked the server's IP address? Did it change by any chance? I noticed that after the upgrade of the jail and plugin, i couldn't access Plex server settings anymore. It appears that 11.3 deals differently with network DHCP as 11.2. You may find that your server now has a different IP which caused the issue for me.
 

kskreider

Dabbler
Joined
Sep 13, 2017
Messages
18
I wouldn't panic too much. I had the same issue. Have you rebooted FreeNAS? Have you checked the server's IP address? Did it change by any chance? I noticed that after the upgrade of the jail and plugin, i couldn't access Plex server settings anymore. It appears that 11.3 deals differently with network DHCP as 11.2. You may find that your server now has a different IP which caused the issue for me.


The IP didn't change as I can still access the plex.tv via the web. I am not sure how comfortable I am not worrying about it since I have my Plex accessible remotely and now I have no control over those settings. I have no access to any of the server settings and because of this that includes metadata info like adding covers to movies.
 

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
The IP didn't change as I can still access the plex.tv via the web. I am not sure how comfortable I am not worrying about it since I have my Plex accessible remotely and now I have no control over those settings. I have no access to any of the server settings and because of this that includes metadata info like adding covers to movies.

With IP, i meant the FreeNAS server IP, not the IP of the Plex jail.
 

kskreider

Dabbler
Joined
Sep 13, 2017
Messages
18
With IP, i meant the FreeNAS server IP, not the IP of the Plex jail.
That did not change. Also I rebooted a couple of times but after doing a system upgrade I had about 6 spontaneous reboots as well
 

SlackerDude

Explorer
Joined
Feb 1, 2014
Messages
76
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.

Update March 2020: The jail name seems to be incidental, it's the plugin name that matters. Ignore the original post, which applied to 11.2 only. If you're creating the plugin in 11.3-U1 or later, you'll be fine. If it was created before that, you should be able to 'iocage set plugin_name="plexmediaserver" plex_jail_name' or, of course, 'iocage set plugin_name="plexmediaserver-plexpass" plex_jail_name' if you're running the "beta" code. Possibly rename the plex.json inside the jail to plexmediaserver.json, or plexmediaserver-plexpass.json if you use the beta code. And that should resolve all your upgrade woes. I think 11.2 might have done that behind the scenes when renaming a plugin jail, and that's why what I describe below worked for me.

--

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
# Edit: On 11.3 the json files are in /mnt/MYMOUNTPOINT/iocage/.plugins/github_com_freenas_iocage-ix-plugins_git/
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

Edit: "iocage upgrade plexmediaserver-plexpass -r 11.3-RELEASE" worked for me after moving from 11.2 to 11.3

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.
Edit: UI update works with renamed jail in 11.3; no luck for me in 11.2
Hi Yorick, I believe I am missing something, not sure what. I have renamed the jail from plex to plexmediaserver, got rid of any related snapshots, and get this when attempting to upgrade the jail:
Code:
root@freenas[~]# iocage snaplist plexmediaserver
+------------------------------------+-----------------------+-------+-------+
|                NAME                |        CREATED        | RSIZE | USED  |
+====================================+=======================+=======+=======+
| ioc_plugin_upgrade_2020-03-23      | Mon Mar 23  5:43 2020 | 823K  | 112K  |
+------------------------------------+-----------------------+-------+-------+
| ioc_plugin_upgrade_2020-03-23/root | Mon Mar 23  5:43 2020 | 12.5G | 3.06M |
+------------------------------------+-----------------------+-------+-------+
root@freenas[~]# iocage upgrade -r 11.3-RELEASE plexmediaserver
Snapshotting plexmediaserver...
Snapshot already exists
Updating plugin INDEX...
/mnt/media/iocage/jails/plex/plex.json was not found!

Any idea as to what I'm missing?
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
What you are missing is likely this note in the OP:

> Update March 2020: The jail name seems to be incidental, it's the plugin name that matters.
 

SlackerDude

Explorer
Joined
Feb 1, 2014
Messages
76
What you are missing is likely this note in the OP:

> Update March 2020: The jail name seems to be incidental, it's the plugin name that matters.
I found my error. I needed to edit the config.json file to change the name of the plugin. All is well with the universe again. Many thanks to you! :smile:
 
Top