Thefrank / jellyfin-server-freebsd

jellyfin-server component for freebsd
185 stars 16 forks source link

I am too stupid to upgrade my installed Jellyfin instance (TrueNAS Core) #65

Open regimeG opened 9 months ago

regimeG commented 9 months ago

In the past, I always had trouble updating my installed Jellyfin instance. In the end, I always had to reconfigure everything.

Last time I was only able to install my Jellyfin server via this link (fetch https://raw.githubusercontent.com/spz2k9/iocage-plugin-jellyfin/master/jellyfin.json iocage fetch -P ./jellyfin.json --name jellyfin rm ./jellyfin.json) from this thread (https://github.com/spz2k9/iocage-plugin-jellyfin). I then uninstalled the official community plugin.

Now I see that Jellyfin 10.8.13 has been released here, but I'm too dumb to update my version.

Can you please help me to update my version without losing my configuration?

I am really lost. Many thanks in advance!

Thefrank commented 9 months ago

That looks like it was setup as a plugin jail which should make that easy. Try iocage update JAILNAME (where JAILNAME is the name of your jail)

regimeG commented 9 months ago

Thanks for the quick reply. I get the following error: /mnt/Pool1/iocage/jails/jellyfi/jellyfi.json was not found

Thefrank commented 9 months ago

Either remake the missing .json or remake the jail using a URI to the .git of that repo

regimeG commented 9 months ago

I'm afraid I've strayed off the road a bit. What do you suggest is the best way to run your Jellyfin server so that I can easily update it the intended way in the future?

Thefrank commented 9 months ago

If you don't have much experience with it and are using TrueNAS CORE I advise using a "thick" jail with just jellyfin and mounting in anything that you need. A "thin" jail or even a different jail manager (pot, cbsd, bastile, others...) under FreeBSD handle this much better than iocage and TrueNAS CORE. Their plugin system was OK until they killed it.

The "simple but not completely easy" for TrueNAS CORE would be: Create jail that will work for jellyfin; FreeBSD 13.2-Release or higher, mlock enabled, network enabled -> Install just jellyfin via pkg; motoring software is OK here (e.g., Zabbix) -> mount in resources you want jellyfin to use (e.g., "Music") -> Enjoy!... -> update jellyfin either using iocage from the host or pkg upgrade inside the jail.

regimeG commented 9 months ago

Thanks for your support, but I don't think I'm tech savvy enough to safely maintain Jellyfin in this way permanently.

So far I had the following plan:

  1. i wanted to install "wget".

->pkg install wget

  1. I wanted to navigate to the path.

-> cd /mnt/Pool1/iocage/jails/jellyfi

  1. then execute the following command there:

-> wget https://raw.githubusercontent.com/spz2k9/iocage-plugin-jellyfin/master/jellyfin.json

  1. then try the update again.

-> iocage update jellyfin

Unfortunately none of this works.

Can you perhaps tell me how I can restore the .jason file?

Thefrank commented 9 months ago

@spz2k9 Please add an INDEX file to your repo or copy the repo and add an INDEX to it. This will allow the creating of a plugin jail directly via iocage fetch -g https://github.com/spz2k9/iocage-plugin-jellyfin/ -n NAMEOFJAIL -P jellyfin

{
        "jellyfin": {
                "MANIFEST": "jellyfin.json",
                "description": "Jellyfin Server for FreeBSD",
                "name": "Jellyfin",
                "official": false,
                "primary_pkg": "jellyfin"
        }
}

Other fields include "icon" for the TrueNAS GUI. TrueNAS is removing "plugins" at some point in the future so it is not needed. iocage will still work. Result + "Plugins" GUI screenshot

root@iocage:~ # iocage fetch -g https://github.com/spz2k9/iocage-plugin-jellyfin/ --name jelltest -P jellyfin
Plugin: Jellyfin Server
  Official Plugin: False
  Using RELEASE: 13.2-RELEASE
  Using Branch: 13.1-RELEASE
  Post-install Artifact: https://github.com/spz2k9/iocage-plugin-jellyfin.git
  These pkgs will be installed:
    - libva-utils
    - libva-intel-media-driver
    - python39
    - jellyfin

Testing Host DNS response to pkg.FreeBSD.org
Testing jelltest's SRV response to pkg.FreeBSD.org
Testing jelltest's DNSSEC response to pkg.FreeBSD.org

Installing plugin packages:
  - libva-utils... 
  - libva-intel-media-driver... 
  - python39... 
  - jellyfin... 

Fetching artifact... 
Cloning git repository

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

Running post_install.sh
Updating iocage-plugins repository catalogue...
iocage-plugins repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
jellyfin_enable:  -> YES
Starting jellyfin.

Admin Portal:
http://192.168.0.195:8096

Doc URL:
https://github.com/Thefrank/jellyfin-server-freebsd

image

Thefrank commented 9 months ago

@regimeG above should be a much smoother solution for the future :)

regimeG commented 9 months ago

First of all, thank you for the great help. Jellyfin has become very, very important to me and I now have a TrueNAS Mini+. Expensive enough that I have no other alternative at the moment. One-click solution via plugin was extremely attractive to me, so I went with TrueNas. I never intended to operate outside of the GUI. So I don't know if I have a repo, where it is or how to deal with it. My system consists of the pure TrueNAS Core and your link to install Jellyfin. ...just so you know what my level of knowledge is.

For now, please let's go through your instructions step by step.

How exactly do I add an index to my repo?

spz2k9 commented 9 months ago

@Thefrank adding the INDEX file could be an option... not sure if it would break something on TrueNas end as they're the one that control the INDEX file and none of the other plugins have one.

Also they merged the "new" 13.2 plugin last week so the plugin should be working in the next release if it's not already working.

regimeG commented 9 months ago

So I could switch back to the community plugin? That would of course be the best solution. But would the configuration be adopted? Because I have currently installed Jellyfin via your link (fetch https://raw.githubusercontent.com/spz2k9/iocage-plugin-jellyfin/master/jellyfin.json iocage fetch -P ./jellyfin.json --name jellyfin rm ./jellyfin.json)

Thefrank commented 9 months ago

The community plugin will be the best and easiest until iXsystems gets rid of plugins which could be as soon as the next minor release but more likely the next major release.

Most simple: You can export (or just copy out) your settings and import them into the plugin. Best: If you mounted in a dataset for your configuration/settings/cache just mount that into the new jail.

regimeG commented 9 months ago

What will replace the plug-in system afterwards? How will all the people who use Nextcloud, Plex or Syncthing, for example, continue to run these important services?

regimeG commented 9 months ago

Ok, I'm giving up at this point. Maybe the language barrier is too great for me to express myself clearly, or maybe I just don't understand you.

I can't find an export function for the Jellyfin settings, nor do I understand what you mean by "mount in a dataset". I must really be too stupid.

I just leave everything as it is and hope that the security holes are not exploited for as long as possible.

I have to admit, I'm pretty down after you described the perspective for TrueNAS Core and the plugins. I'll pop in here from time to time and see if there's any news. Maybe it won't be as bad as you fear.

Sorry for the inconvenience and thanks a million for your patience.

regimeG commented 9 months ago

What will replace the plug-in system afterwards? How will all the people who use Nextcloud, Plex or Syncthing, for example, continue to run these important services?

Ok, I found something about it myself. https://www.truenas.com/blog/the-future-of-truenas-plugins-is-apps/

spz2k9 commented 9 months ago

@regimeG I've made a test plugin with TrueNAS-13.0-U6.1 (The latest) and now the jail does get created with 13-2. I've also updated my own jellyfin plugin with the UI (in the jail pannel) and now it's running 13.2-RELEASE-p5. So it seems the commit for the jail did get shipped with the update to U6.1.

spz2k9 commented 9 months ago

@regimeG Yes seems plugins will probably be removed... but Apps are only for Scale (for now at least)... but the thing is to properly use the Apps on Scale is more complex than on Core.

regimeG commented 9 months ago

@regimeG I've made a test plugin with TrueNAS-13.0-U6.1 (The latest) and now the jail does get created with 13-2. I've also updated my own jellyfin plugin with the UI (in the jail pannel) and now it's running 13.2-RELEASE-p5. So it seems the commit for the jail did get shipped with the update to U6.1.

Yep, I've just tested it too. The only problem that remains for me is how to transfer the settings from your plugin to the community plugin. Respectively from Jellyfin to Jellyfin. Updating your plugin leeds again to the error, that the .json file is missing.

The fact that I have to set up Jellyfin again is actually less of a problem for me. The bigger problem is that my family and friends' clients would all have to log in again. I would like to prevent that, if possible.

spz2k9 commented 9 months ago

@regimeG Json file missing? Weird I didn't get that error when updating the plugin from the jail UI.

regimeG commented 9 months ago

fetch https://raw.githubusercontent.com/spz2k9/iocage-plugin-jellyfin/master/jellyfin.json iocage fetch -P ./jellyfin.json --name jellyfin rm ./jellyfin.json

this is the command I used to install your plugin. It's in the last line...

spz2k9 commented 9 months ago

Oh. ok... I still had the 13.1-RELEASE-p9 plugin installed and did an update with the update button in the Jail pannel... to upgrade it to 13.2-RELEASE-p5.

image

spz2k9 commented 9 months ago

To copy from the OLD jail to the NEW jail... I suppose the only way would be to copy the files from /var/db/jellyfinserver from only jail to the other. I don't recall how I had the jail path in my script... I'd have to check.

regimeG commented 9 months ago

Oh. ok... I still had the 13.1-RELEASE-p9 plugin installed and did an update with the update button in the Jail pannel... to upgrade it to 13.2-RELEASE-p5.

image

Mine is 13.2-RELEASE-p4 How can I replace the missing json file?

spz2k9 commented 9 months ago

13.2-p4 it's rather recent... and the update button doesn't update it to 13.2-p5?

That JFin jail is the old one?

regimeG commented 9 months ago

No, when I click on Update in your installed plugin, the error with the missing json file appears.

spz2k9 commented 9 months ago

Oh okay. It might be a bug in the manual install process. It wasn't something I tested fully. One thing that could be done is create a new jail let's say a "JFin-New" and then copy the configuration folder from the actual to the new jail.

i'll need the output of this command and the names of both old and new jail.

regimeG commented 9 months ago

Create the new jail with the UI - you mean install the community plugin?

spz2k9 commented 9 months ago

yes. Install the plugin under a new name... and configure the mountpoint. Then we'll try to copy all the configuration files from the old one to the new one.

regimeG commented 9 months ago

Ok, done. The output of iocage get -p is Pool1

I just remembered that I marked the jail as read only. Is it possible that this is why the update is not working?

spz2k9 commented 9 months ago

hmm... that would be more a question for @Thefrank as I'm not that much experienced with BSD operating system... I'm more a linux guy... but that said... I don't think the read only woud cause problem. I think it's more a thing that the UI search the json file that created the initial jail... and in the manual install procedure I delete it.

Anyway the manual install should not be usefull now since it's up to date with the 13.2 release.

Now i'm missing the name of the new jail.

And check that this command does list folder and files like : config / data / log ....

ls -l /mnt/Pool1/iocage/jails/JFin/root/var/db/jellyfinserver

regimeG commented 9 months ago

I have modified your command so that it fits my installation.

ls -l /mnt/Pool1/iocage/jails/jellyfin/root/var/db/jellyfin

...and yes, the corresponding folders are listed.

The new jail is called Jellyfin2

spz2k9 commented 9 months ago

Oh sorry... you're right as I'm still using the old package from TheFrank and now the one in the official repo.

Okay now check the output of this one : ls -l /mnt/Pool1/iocage/jails/jellyfin2/root/var/db/jellyfin

It should be almost the same output than for the jellyfin jail... if it is and the jellyfin2 is stopped proceed to copy from jellyfin to jellyfin2 with this command :

cp -R /mnt/Pool1/iocage/jails/jellyfin/root/var/db/jellyfin/* /mnt/Pool1/iocage/jails/jellyfin2/root/var/db/jellyfin

Then try to start jellyfin2 and check if everything is working. It might not work as the user and group might not copy over and might require to do a chown on all files and folder... but we'll see.

regimeG commented 9 months ago

Copying has worked. But now I can no longer connect to Jellyfin2 with the assigned IP.

Thefrank commented 9 months ago

curl -i http://IP_OF_JELLYFIN:8096/health from TrueNAS console if that fails then try from inside the jail

regimeG commented 9 months ago

Both shells: curl: (6) Could not resolve host: IP_OF_JELLYFIN

Thefrank commented 9 months ago

so the jail is not up? does iocage list -l show it as up?

spz2k9 commented 9 months ago

The files took forever to copy but I've managed to reproduce the error. One of the folder doesn't exist probably.

Stop the jail then do those to create and set the correct user and groups... then try again.

mkdir -p /mnt/Pool1/iocage/jails/jellyfin2/root/var/cache/jellyfin chown -R 868:868 /mnt/Pool1/iocage/jails/jellyfin2/root/var/db/jellyfin chown -R 868:868 /mnt/Pool1/iocage/jails/jellyfin2/root/var/cache/jellyfin

if it still doesn't start then do this command to get the error message :

tail -n30 /mnt/Pool1/iocage/jails/jellyfin2/root/var/db/jellyfin/log/log_20231214.log

regimeG commented 9 months ago

Your command contains "jellyfinserver" again. Should I replace it again or do we need it for the command this time?

spz2k9 commented 9 months ago

Yes I've updated the comment... the thing is since I never updated the plugin to the official jellyfin... I'm still running jellyfinserver and not jellyfin... so you might be right it might be jellyfin. The correct user:group has been fixed since it's not root:wheel it's 868:868 as it's updated later in the script.

The correct folder will be shown in the error message of this logfile :

tail -n30 /mnt/Pool1/iocage/jails/jellyfin2/root/var/db/jellyfin/log/log_20231214.log

regimeG commented 9 months ago

At first glance, everything is back. Wow, how much you've helped me. That was voodoo beyond my abilities. Admirable!

regimeG commented 9 months ago

Ok, the clients apparently still have to log in again. But at least everything from the server is back.

spz2k9 commented 9 months ago

Great. Yes it will disconnect everyone since it's a new IP, but it will be the same user and password. You could swap the IP to prevent that... but it will break the old jail. You might want to keep both for 2-3 days to compare that everything is working as intended before either swapping IPs or deleting it.

regimeG commented 9 months ago

Good plan, that's how I do it.

But it is correct that version 10.8.10 and not 10.8.13 is still installed?

spz2k9 commented 9 months ago

According to the ports page here (https://www.freshports.org/multimedia/jellyfin/) the latest for FreeBSD 13 is 10.8.10_3... so it should be the latest. Maybe the linux versions are more recent.

spz2k9 commented 9 months ago

Also... you can try the "update" button on the new jail... it should work since it was created with the UI.

regimeG commented 9 months ago

I only ask because "Thefrank" has already listed the newer version and recommends an update as soon as possible because of the security gaps.

spz2k9 commented 9 months ago

Oh... well... I don't really know then. I'll leave that question for @Thefrank.

regimeG commented 9 months ago

How can I thank you in the end? Let me send you money for a beer or a whisky. Really! It's a necessity for me.

spz2k9 commented 9 months ago

It's all fine. I don't have any way to receive payement nor do I require one for this job.

regimeG commented 9 months ago

Oh man, now I have to go to sleep with a bad conscience.