Thefrank / jellyfin-server-freebsd

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

Failed plugin update + reinstall, media won't play - suspect due to missing FFmpeg #60

Closed TNAS123 closed 6 months ago

TNAS123 commented 10 months ago

Basically everything said on: https://github.com/Thefrank/jellyfin-server-freebsd/issues/57 and https://github.com/Thefrank/jellyfin-server-freebsd/issues/35 and https://github.com/Thefrank/jellyfin-server-freebsd/issues/30

I tried to "update" jellyfin through the TrueNAS plugin system which totally broke it, web UI wouldn't load and nothing I could do fixed it.

So I uninstalled and reinstalled. Now none of my media will play with the error: "Playback Error: This client isn't compatible with the media and the server isn't sending a compatible media format."

Checked the logs and seeing the following:


[2023-09-05 11:37:13.400 +01:00] [WRN] [4] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: FFmpeg: Failed version check: "ffmpeg"

[2023-09-05 11:37:13.427 +01:00] [INF] [4] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: FFmpeg: ""

[2023-09-05 12:15:42.989 +01:00] [ERR] [68] Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request. URL "GET" "/videos/503d7aa0-5680-ef37-8c40-ec9034c2374d/live.m3u8".

System.ArgumentException: FFmpeg path not set.

In the "Playback settings" I see the "FFmpeg path" is empty, I swear when it was working maybe this had something like "/opt/..." , but now no matter what I choose Jellyfin is telling me: "We're unable to locate FFmpeg using the path you've entered. FFprobe is also required and must exist in the same folder. These components are normally bundled together in the same download. Please check the path and try again."

So I believe my issue is due to missing FFmpeg, but how can I fix it? Uninstalling and reinstalling doesn't fix it. (I confirmed during reinstallation the "FFmpeg packages" said they were installed correctly too).

I tried some of the solutions in the other closed issues, including installing Jellyfin via the TrueNAS terminal, no luck.

Any help to fix this would be really appreciated. I'm moderately technically capable so can follow basic troubleshooting instructions.

Thefrank commented 10 months ago

Same steps as from another troubleshooting: In the jail, can you:

freebsd-version -ru; uname -a pkg -vv | grep ^OSVERSION TrueNAS console:

freebsd-version -kru -j (JAIL_NUMBER) JAIL_NUMBER should be the number associated with the jail that runs jellyfin

Does ffmpeg work or does it crash with an error about a missing symbol?


Short version: FreeBSD 13.2 packages mostly won't work on FreeBSD 13.1 or older. Despite TrueNAS being on 13.1, a 13.2 jail should be able to run jellyfin. Generally, don't try and run jails that are newer than the kernel but in this case we can make an exception :)

TNAS123 commented 10 months ago

Hi @Thefrank - thanks for your help! Fingers crossed we can get this up and running again, I'm missing Jellyfin so much! Tried out Plex (which works) but I hate them displaying shows I can stream and trying to get me to buy services I don't want...

I re-installed jellyfin fresh through the plugin manager, confirmed that FFmpeg is NOT present in the playback settings again, and now providing the logs you requested:

freebsd-version -ru; uname -a

13.1-RELEASE-p7
13.1-RELEASE-p9
FreeBSD jfin-jail 13.1-RELEASE-p7 FreeBSD 13.1-RELEASE-p7 n245428-4dfb91682c1 TRUENAS amd64

pkg -vv | grep ^OSVERSION

OSVERSION = 1301000;

freebsd-version -kru -j (JAIL_NUMBER)

13.1-RELEASE-p7
13.1-RELEASE-p7
13.1-RELEASE-p7
13.1-RELEASE-p9

Does ffmpeg work or does it crash with an error about a missing symbol?

I'm not really sure the best way to answer this. The errors and logs I mentioned above are still valid and reproduced just now. image

[2023-09-05 23:13:57.796 +01:00] [ERR] [36] MediaBrowser.Providers.TV.EpisodeMetadataService: Error in "ffprobe"
System.InvalidOperationException: Cannot start process because a file name has not been provided.
   at System.Diagnostics.Process.Start()
   at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.StartProcess(ProcessWrapper process)
   at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.GetMediaInfoInternal(String inputPath, String primaryPath, MediaProtocol protocol, Boolean extractChapters, String probeSizeArgument, Boolean isAudio, Nullable`1 videoType, Boolean forceEnableLogging, CancellationToken cancellationToken)
   at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.GetMediaInfoInternal(String inputPath, String primaryPath, MediaProtocol protocol, Boolean extractChapters, String probeSizeArgument, Boolean isAudio, Nullable`1 videoType, Boolean forceEnableLogging, CancellationToken cancellationToken)
   at MediaBrowser.Providers.MediaInfo.FFProbeVideoInfo.ProbeVideo[T](T item, MetadataRefreshOptions options, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.MetadataService`2.RunCustomProvider(ICustomMetadataProvider`1 provider, TItemType item, String logName, MetadataRefreshOptions options, RefreshResult refreshResult, CancellationToken cancellationToken)
[2023-09-05 22:52:10.750 +01:00] [ERR] [4] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: FFmpeg validation: The process returned no result
[2023-09-05 22:52:10.750 +01:00] [WRN] [4] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: FFmpeg: Failed version check: "ffmpeg"
[2023-09-05 22:52:10.776 +01:00] [INF] [4] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: FFmpeg: ""
[2023-09-05 23:15:34.141 +01:00] [ERR] [55] Jellyfin.Server.Middleware.ExceptionMiddleware: Error processing request. URL "GET" "/videos/043a9ddb-da08-6cef-a129-edafc1bdff35/live.m3u8".
System.ArgumentException: FFmpeg path not set.
Thefrank commented 10 months ago

In the jail: which ffmpeg if it returns a path then type ffmpeg

TNAS123 commented 10 months ago

Hi @Thefrank apologies for the mobile screenshot only I'm just away from my pc but I can confirm an error appears to be present given that command.

Screenshot_20230905_234226_com brave browser_edit_1842419414173554

Thefrank commented 10 months ago

That version of FFmpeg was built against FreeBSD 13.2 when strverscmp was introduced hence the error of "symbol@SYMBOLVERSION". You will need to use a FreeBSD 13.2 jail to use it

Thefrank commented 10 months ago

If you want to try and just upgrade the jail using TrueNAS's iocage you can try iocage upgrade --release 13.2-RELEASE NAMEOFJAIL (where NAMEOFJAIL is the name of your jellyfin jail) I have no idea how iocage manages upgrades on pluginjails so this might not work

spz2k9 commented 10 months ago

The manual install added in the readme will create a 13.2 jail so it should work.

https://github.com/spz2k9/iocage-plugin-jellyfin

TNAS123 commented 10 months ago

Hi @Thefrank unfortunately no luck with iocage upgrade --release 13.2-RELEASE NAMEOFJAIL After running it I got:

...
Installing plugin packages:
  - libva-utils...
  - libva-intel-media-driver...
  - python39...
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

jfin-jail successfully upgraded!

Then I noticed the webUI was unresponsive. From the jail terminal I used pkg info jellyfin which told me jellyfin was not installed. So i did pkg install jellyfin which reinstalled it successfully in the jail. No errors. Restarted the jail, accessed the WEBUI ok but STILL the issue persists, there is no FFmpeg path set and all the same errors :(

What steps would you recommend now? Should I uninstall via the package manager and follow @spz2k9 's suggestion?

This does sound like an issue with the "community plugin installer" no? If it's ultimately installing an inoperable version of Jellyfin, could the issue be fixed within the "official/unofficial TrueNAS plugin"?

Any further help would be appreciated, I'm really missing my Jellyfin library :(

spz2k9 commented 10 months ago

@TNAS123 You can keep the current config for future use or delete it doesn't mather. The manual install will create a new jail named "jellyfin" (you can change the name of the jail by changing it after the --name parameter) and it will be displayed like if it was installed by the UI... the only difference is the UI will use the version 2 script which will create a 13.1 jail (in which ffmpeg doesn't work) and the manual install will use the version 4 script which will create a 13.2 jail... everything should work (i've tested some configs).

I've asked IX to update the config, but it will take some time to merge and deploy.

TNAS123 commented 10 months ago

Hi @spz2k9 thanks for the note, I'm following the steps on the readme you provided but it looks like I'm getting an error on the second command? iocage fetch -P ./jellyfin.json --name jellyfin

Full terminal output:

root@truenas[~]# fetch https://github.com/spz2k9/iocage-plugin-jellyfin/blob/master/jellyfin.json
jellyfin.json                                         8152  B   97 MBps    00s
root@truenas[~]# iocage fetch -P ./jellyfin.json --name jellyfin
Traceback (most recent call last):
  File "/usr/local/bin/iocage", line 10, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/iocage_cli/fetch.py", line 181, in cli
    ioc.IOCage().fetch(**kwargs)
  File "/usr/local/lib/python3.9/site-packages/iocage_lib/iocage.py", line 1072, in fetch
    plugin_obj.fetch_plugin(props, 0, accept)
  File "/usr/local/lib/python3.9/site-packages/iocage_lib/ioc_plugin.py", line 307, in fetch_plugin
    iocage_lib.ioc_common.validate_plugin_manifest(conf, self.callback, self.silent)
  File "/usr/local/lib/python3.9/site-packages/iocage_lib/ioc_common.py", line 1155, in validate_plugin_manifest
    logit(
  File "/usr/local/lib/python3.9/site-packages/iocage_lib/ioc_common.py", line 107, in logit
    callback(content, exception)
  File "/usr/local/lib/python3.9/site-packages/iocage_lib/ioc_common.py", line 60, in callback
    message = _log['message']
KeyError: 'message'
spz2k9 commented 10 months ago

@TNAS123 Sorry... the url in the readme was the wrong one. I've fixed it. Can you try with the new url?

TNAS123 commented 10 months ago

@spz2k9 SUCCESS!!! I followed the steps and I'm back up and running! Thank you so much for your help. I'm so glad I don't have to use Plex any more haha

So was the root cause in the end I tried to use the plugin "updater" which broke it all? Should I stay away from that button in the future? I would hate to mess up my install again.

Given that the fix for this will be pushed to the "official/unofficial" community plugin installer in due course, I'm happy for this issue to be closed. Thanks again @spz2k9 and @Thefrank

spz2k9 commented 10 months ago

@TNAS123 Well... I think the update button only update the jail release and reinstall the packages listed in the plugin manifest (which jellyfin and ffmpeg are not currently)... that's why you ended with a non working jail with missing packages. I've added the package to the manifest in the version 3 & 4... but it might take a while before it's merge in the master and deployed in the next release. Also... even if the version 3 gets released since ffmpeg wont work on 13.1 it's not gonna be a real fix... it'll only be fixed when version 4 gets merged and released.

ageekhere commented 9 months ago

Then should Jellyfin plugin updates be put on hold until updating works without breaking?

Thefrank commented 9 months ago

The breaking is happening because ffmpeg for FreeBSD 13 requires FreeBSD 13.2 due to FreeBSD 13.2 introducing new symbols. The plugin can create a 13.2 jail; it is just a matter of TrueNAS picking up the changes to the plugin and pushing them out to clients

Drago245 commented 7 months ago

Good evening Thefrank and other contributors. I seem to be having a similar problem here. I followed the same troubleshooting steps and am getting the same results for ffmpeg. Is there a known way to update the jail to 13.2 without needing to create a new jail and install Jellyfin manually? I tried iocage update (jailname) and iocage upgrade --release 13.2-RELEASE (jailname) The first command just says there isn't an update to perform, the second returns "13.1-RELEASE is missing 'src.txz', please refetch!"

When I try to refetch that using iocage fetch 13.1-RELEASE I'm prompted to select the desired release, of which 13.1 is not an option.

I'd appreciate any help. Always thankful for the work that you guys do!

Thefrank commented 7 months ago

@Drago245 you want upgrade not update

Drago245 commented 7 months ago

@Drago245 you want upgrade not update

I tried both commands with 'upgrade' rather than update, but it still hangs up on "missing src.txz, please refetch!"

when I attempt to fetch 13.1-RELEASE, I get options to fetch 12.4, 13.2, or 14.0. But 13.1 isn't available apparently.

Thefrank commented 7 months ago

iocage fetch 13.2-RELEASE iocage upgrade --release 13.2-RELEASE (jailname) should do the trick. it will take your 13.1 jail to 13.2.

Drago245 commented 7 months ago

Screenshot from 2023-11-27 13-20-22

This is the return I get when attempting that second command. The first command ran properly.

Thefrank commented 7 months ago

I see now! It is a plugin jail. I am not sure how iocage handles that. Asking for the src is a bit silly as it is neither building the new version from source nor is it desired in something that is lightweight (i.e. plugin jail). 13.2 is even explicitly listed https://github.com/spz2k9/iocage-plugin-jellyfin/blob/7429611ad2504dcf426c296330c82d6d10aa6202/jellyfin.json#L3

Your best bet might be to make a new plugin from 13.2 :(

Drago245 commented 7 months ago

Okay I ended up manually making a new plugin from a 13.2 jail, and everything works properly now. It was very simple and straightforward due to the great documentation. Thanks for the help and for your continued work on this project!