Why can i not upgrade my Plex jail using iocage upgrade command?

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
After upgrading FreeNAS from 11.2U7 to 11.3 via the GUI, i learned that i also need to upgrade my jails as the current plugins would not be able to update anymore.

I did this for Nextcloud using 'iocage upgrade nextcloud -R 11.3-RELEASE' and that worked flawless. It upgrade the jail and the nextcloud plugin to 11.3-RELEASE.

Tried the same with Plex but it doesn't work as apparently the plex.json file cannot be found. A bit digging shows that the name was changed to plexmediaserver.json. Why is that and is there a workaround to prevent having to do a new complete new install? It doesn't make sense to me to having to configure Plex once again from starters.
 
Joined
Jan 4, 2014
Messages
1,644

waqarahmed

iXsystems
iXsystems
Joined
Aug 28, 2019
Messages
136
Hello. So this has been fixed and will be available in upcoming 11.3 U1 release. However if you are stuck here, you would need to rollback your upgrade to the snapshot which was made before the upgrade. Once done, please do `iocage set plugin_name="plexmediaserver" plex_jail_name`. Once done, you need to navigate to the plex jail dataset and you should see a file named plex.json, you will have to convert that to plexmediaserver.json. Then if you choose to upgrade, it should work as desired and if you are okay without upgrading, that should work nicely as well. Please let me know if there are any issues. Thank you
 

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
Hello. So this has been fixed and will be available in upcoming 11.3 U1 release. However if you are stuck here, you would need to rollback your upgrade to the snapshot which was made before the upgrade. Once done, please do `iocage set plugin_name="plexmediaserver" plex_jail_name`. Once done, you need to navigate to the plex jail dataset and you should see a file named plex.json, you will have to convert that to plexmediaserver.json. Then if you choose to upgrade, it should work as desired and if you are okay without upgrading, that should work nicely as well. Please let me know if there are any issues. Thank you

I don't think i can roll back. But on the other hand, it never upgraded. I followed the instructions to rename and delete all snapshots as part of the guideline. However, once i did that it was still searching for the plex.json plugin. Please have a look at this thread and let me know if i can still fix this.
 
Joined
Jan 4, 2014
Messages
1,644
Hello. So this has been fixed and will be available in upcoming 11.3 U1 release. However if you are stuck here, you would need to rollback your upgrade to the snapshot which was made before the upgrade. Once done, please do `iocage set plugin_name="plexmediaserver" plex_jail_name`. Once done, you need to navigate to the plex jail dataset and you should see a file named plex.json, you will have to convert that to plexmediaserver.json. Then if you choose to upgrade, it should work as desired and if you are okay without upgrading, that should work nicely as well. Please let me know if there are any issues. Thank you

Would an alternative approach be for @ddaenen1 to save the Plex database, blow away and then reinstall the Plex plugin under 11.3 and restore the saved database?

EDIT: Just realised he is still on 11.2.
 
Last edited:

waqarahmed

iXsystems
iXsystems
Joined
Aug 28, 2019
Messages
136
I don't think i can roll back. But on the other hand, it never upgraded. I followed the instructions to rename and delete all snapshots as part of the guideline. However, once i did that it was still searching for the plex.json plugin. Please have a look at this thread and let me know if i can still fix this.
Iocage automatically creates a snapshot when you try to upgrade/update. Please confirm if you have that snapshot
 

waqarahmed

iXsystems
iXsystems
Joined
Aug 28, 2019
Messages
136
Oh sorry, you mention that you deleted the snapshot. Can you please state the current status of Plex plugin jail ? Is it on 11.2 and is it working as it should on that release ?
 

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
Oh sorry, you mention that you deleted the snapshot. Can you please state the current status of Plex plugin jail ? Is it on 11.2 and is it working as it should on that release ?

First of all, every time i have tried iocage upgrade command, it did create a snapshot but it doesn't progress. as it doesn't find the plex.json since the rename command has altered the jail directory to "plexmediaserver" but the plugin is still named "plex.json"

This is my current status:

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]#


So it is on 11.2 and it still works.

And this is what i get when i try the iocage upgrade command in the current state:

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[~]#        


and this is what i got before i followed the renaming guideline:

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[~]#           
 

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
What does this iocage set plugin_name="plexmediaserver" plex_jail_name do?
 

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
Well, i fixed it myself and all is running perfectly now :cool:

1581691678090.png


1581690746440.png


Here is what i did:

- stopped the jail
- renamed the jail as per the recommendation of @Yorick with iocage rename plex plexmediaserver
- went into /mnt/Media/iocage/jails/plexmediaserver/ and renamed plex.json to plexmediaserver.json with mv plex.json plexmediaserver.json
- opened config.json in the same directory with nano and changed the plugin name from plex to plexmediaserver as per recommendation of @waqarahmed
- started the jail again - everything still worked and both jail and plugin now displayed as "plexmediaserver"
- ran the iocage upgrade plexmediaserver -r 11.3-RELEASE command and off went the upgrade
- rebooted the server to ensure i had a clean start and tested Plex.

All good at the end!
 
Last edited:

waqarahmed

iXsystems
iXsystems
Joined
Aug 28, 2019
Messages
136
Glad to hear that you had it sorted @ddaenen1 ; ) Though the jail renaming wasn't required, it should work otherwise as well.
 

waqarahmed

iXsystems
iXsystems
Joined
Aug 28, 2019
Messages
136
What does this iocage set plugin_name="plexmediaserver" plex_jail_name do?
Iocage needs to keep track of which plugin jail actually belongs to which plugin. So this property basically tells iocage that the jail which is created via this config, is actually a plex plugin.
 

fireheadman

Dabbler
Joined
Nov 13, 2016
Messages
49
Glad to hear that you had it sorted @ddaenen1 ; ) Though the jail renaming wasn't required, it should work otherwise as well.

I am having this issue also... and it will not work (I believe the rename is required or something has changed)
I built a "test" freenas server on 11.2-RELEASE in order to vet/test the upgrade path to 11.3-RELEASE this evening.
I created 3 jails on 11.2-RELEASE (sonarr, radarr, plex-plexpass)

The sonarr and radarr upgraded (albeit with odd errors on mono):
A reboot of the jail and it appears to be working.... I haven't configured the application for a final test.
And unsure why some of the pkgs were uninstalled when it could have retained them and upgraded them.... like bash I had to reinstall.
1582001762443.png


For Plex-PlexPass... it simply will not upgrade:
I think it wants plexmediaserver
1582001828043.png


These are out of the box plugin installs... I have not changed anything on them, just installed and gave them a static IP to test the upgrade path
I will be testing out the renaming mentioned above to see how this pans out.
1582001909043.png
 

Attachments

  • 1582001884031.png
    1582001884031.png
    39.5 KB · Views: 411

waqarahmed

iXsystems
iXsystems
Joined
Aug 28, 2019
Messages
136
@fireheadman you need to set the plugin_name property to "plexmediaserver-plexpass" and also change the name of the plugin manifest accordingly in the jail path as described above in comments. It should work as desired. Please let me know otherwise. Thank you
 

fireheadman

Dabbler
Joined
Nov 13, 2016
Messages
49
@fireheadman you need to set the plugin_name property to "plexmediaserver-plexpass" and also change the name of the plugin manifest accordingly in the jail path as described above in comments. It should work as desired. Please let me know otherwise. Thank you

TO clarify that... you mentioned needing to modify the json and jail name BEFORE the upgrade to 11.3-RELEASE.
Are you referring to the JAIL version only? Or do I need to perform this name change before I upgrade the entire FreeNAS OS to 11.3-RELEASE?

I will be able to test/re-test this later today (if my days goes accordingly)
 

fireheadman

Dabbler
Joined
Nov 13, 2016
Messages
49
Here's an update...
I think there is some confusion on this upgrade.....

The upgrade works, however there is an ill effect.
follow me on this... (and please correct me where wrong)

Updated the json/jail name
This where the upgrade immediately detours.....

Code:
freenas% sudo iocage set plugin_name="plexmediaserver" plex-plexpass
Password:
plugin_name: plex-plexpass -> plexmediaserver

freenas% cd /mnt/tankless/iocage/jails/plex-plexpass/
freenas% sudo mv plex-plexpass.json plexmediaserver.json


Run the upgrade....
Code:
freenas% sudo iocage upgrade plex-plexpass
* Ruleset 5 does not exist, using defaults
Snapshotting plex-plexpass...
Snapshot already exists
Updating plugin INDEX...
Running upgrade...
Snapshotting plex-plexpass...
Updating plugin INDEX...
Updating plugin artifact...
Cloning git repository

Branch 11.3-RELEASE does not exist at https://github.com/freenas/iocage-plugin-plexmediaserver.git!
Using "master" branch for plugin, this may not work with your RELEASE
Removing old pkgs...
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 64 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
<lots of pkgs removed ..... truncated output>
Number of packages to be removed: 64

Installing new pkgs...
Repo: iocage-plugins already exists, skipping!

Testing Host DNS response to pkg.cdn.trueos.org
Testing plex-plexpass's SRV response to pkg.cdn.trueos.org
Testing plex-plexpass's DNSSEC response to pkg.cdn.trueos.org

Installing plugin packages:
  - plexmediaserver...
  - ffmpeg...
Cloning git repository

Branch 11.3-RELEASE does not exist at https://github.com/freenas/iocage-plugin-plexmediaserver.git!
Using "master" branch for plugin, this may not work with your RELEASE

plex-plexpass successfully upgraded!


Here is the iocage output. (jail was powered off for this)
1582068234968.png


The ill effect of this upgrade from changing json and jail name
This is causing the upgrade to now think this is a NON-plexpass installation.

...which causes the PlexPass version to be removed and the older version to be installed.
This is not the desired outcome I wanted.
1582068978046.png

1582069060690.png


Sounds like the freenas devs need to update the upgrade workflow to handle the plex-plexpass plugin, which is a standard plugin in the available plugins. This may have odd/unknown effects from ripping out the current version and placing an older version in its place (user settings were set for a newer version)
1582069597723.png


To make it more interesting...
11.2-RELEASE says nothing about PlexPass being BETA... which is does now in 11.3-RELEASE... so What the heck is up with that?
1582069920155.png
 

fireheadman

Dabbler
Joined
Nov 13, 2016
Messages
49
I'll also add...
if you enter your jail/iocage
install the plexmediaserver-plexpass pkg... then uninstall plexmediaserver and reboot

you will possibly be back on track?
Your json file and iocage name will still reflect plexmediaserver, but you old plex will be back online. (unsure how this will impact future updates)

I noticed when I did the steps in the previous post, I now had 2 plex servers.
my old "plexpass" server was OFFLINE and a new plex server was now showing....

After uninstalling plexmediaserver pkg and re-installing the plexpass server pkg (plus reboot), it went back to the original plexpass server being online. I believe the plexmediaserver creates a new plex profile?
 

fireheadman

Dabbler
Joined
Nov 13, 2016
Messages
49
found a missing piece...
for plexpass, you need to rename the json and plugin_name to "plexmediaserver-plexpass" and "plexmediaserver-plexpass.json"
I reviewed the iocage-ix-plugins list over at github for the freenas names.

Afterwards, I was able to successfully upgrade the jail using:
sudo iocage upgrade -r 11.3-RELEASE plex-plexpass

...which kept everything in place.
 

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
found a missing piece...
for plexpass, you need to rename the json and plugin_name to "plexmediaserver-plexpass" and "plexmediaserver-plexpass.json"
I reviewed the iocage-ix-plugins list over at github for the freenas names.

Afterwards, I was able to successfully upgrade the jail using:
sudo iocage upgrade -r 11.3-RELEASE plex-plexpass

...which kept everything in place.
That was exactly what i was going to tell you. Glad you figured it out yourself.
 
Top