pabloromeo / clusterplex

ClusterPlex is an extended version of Plex, which supports distributed Workers across a cluster to handle transcoding requests.
MIT License
409 stars 33 forks source link

Plex `1.40.3+` Not Downloading Codecs #317

Closed llajas closed 1 week ago

llajas commented 2 weeks ago

Describe the bug It seems that a new update for Plex (1.40.3+, specifically) breaks the scripts ability to set the CLUSTERPLEX_PLEX_CODECS_VERSION variable properly, thus preventing codecs from downloading for workers.

To Reproduce Steps to reproduce the behavior: Deployed via Helm, set image tag to (or leave as) 'latest' Run ClusterPlex Attempts at playing media requiring transcoding will fail. Logs show several 404 errors, shortened below:

Starting Plex Media Server. . . (you can ignore the libusb_init error)
CLUSTERPLEX_PLEX_VERSION => '1.40.3.8555-fef15d30c'
CLUSTERPLEX_PLEX_CODECS_VERSION => ''
CLUSTERPLEX_PLEX_EAE_VERSION (extracted) => 'eae--42'
PLEX_ARCH => 'amd64'
EAE_VERSION => '2001'
CLUSTERPLEX_PLEX_CODEC_ARCH => linux-x86_64-standard
Codec location => /codecs/-linux-x86_64-standard
Found EAE_VERSION.txt => 2001
EAE is up to date
Codec libaac_decoder.so does not exist. Downloading...
--2024-06-18 14:31:24--  https://downloads.plex.tv/codecs//linux-x86_64-standard/libaac_decoder.so
Resolving downloads.plex.tv (downloads.plex.tv)... 104.18.0.127, 104.18.1.127, 2606:4700::6812:7f, ...
Connecting to downloads.plex.tv (downloads.plex.tv)|104.18.0.127|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2024-06-18 14:31:24 ERROR 404: Not Found.

Expected behavior Media plays without issue.

Screenshots N/A

Desktop (please complete the following information):

Additional context

Running strings "Plex Transcoder" | grep -Po '[0-9a-f]{7}-[0-9]{4}$' yields no values. Taking a peek into the file itself, it seems that the second half of the new string has been shifted from being 4 characters long and numbers only to 16 characters long, consisting of both numbers and letters now.

%s version ad47460-ffe81d9cd51bd27cb3fbbe09

Will open a PR with the below; proposed change updates the script to allow numbers as well as letters, searching for a minimum of 4 characters and including any that are beyond the initial 4 since there's no way of knowing what will happen in the future, upstream. Definitely open to suggestions.

root@clusterplex-worker-0:/lib/plexmediaserver# strings "Plex Transcoder" | grep -Po '[0-9a-f]{7}-[0-9]{4}$'
root@clusterplex-worker-0:/lib/plexmediaserver# strings "Plex Transcoder" | grep -Po '[0-9a-f]{7}-[0-9a-f]{4,}$'
ad47460-ffe81d9cd51bd27cb3fbbe09
albertsj1 commented 1 week ago

ah, I am hitting this as well. I was going to open a PR and noticed this is already open and has a PR waiting to be merged. I see @pabloromeo has approved the PR. Looking forward to PR #318 being merged. :)

I also noticed CLUSTERPLEX_PLEX_EAE_VERSION (extracted) => 'eae--42' doesn't seem to be getting a valid value. Looking at the source, there should be a version number between the two hyphens. I ran the strings command manually myself against the pms_original binary and there doesn't appear to be any version numbers list. This is what I get:

>> strings pms_original | grep Easy
EasyAudioEncoder-%s-%s
EasyAudioEncoder
EasyAudioEncoder-
pabloromeo commented 1 week ago

I'll try to merge it right now, which will hopefully fix the issue on "latest". I'll try to do a proper versioned release ASAP.

pabloromeo commented 1 week ago

"latest" docker tag should contain this fix. Please try it and let me know how it goes.

pabloromeo commented 1 week ago

Release https://github.com/pabloromeo/clusterplex/releases/tag/v1.4.12 is the pinned version that includes this fix.

llajas commented 1 week ago

I've updated my helm chart and I'm back to running on the latest Plex tag. Thanks @pabloromeo for merging!


Codec libzmbv_decoder.so does not exist. Downloading...
--2024-06-21 18:56:17--  https://downloads.plex.tv/codecs/ad47460-ffe81d9cd51bd27cb3fbbe09/linux-x86_64-standard/libzmbv_decoder.so
Resolving downloads.plex.tv (downloads.plex.tv)... 104.18.0.127, 104.18.1.127, 2606:4700::6812:7f, ...
Connecting to downloads.plex.tv (downloads.plex.tv)|104.18.0.127|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 86048 (84K) [application/octet-stream]
Saving to: ‘libzmbv_decoder.so’

     0K .......... .......... .......... .......... .......... 59% 1.85M 0s
    50K .......... .......... .......... ....                 100% 1.69M=0.05s

2024-06-21 18:56:17 (1.79 MB/s) - ‘libzmbv_decoder.so’ saved [86048/86048]

EAE_SUPPORT => 1
EAE_EXECUTABLE => /codecs/ad47460-ffe81d9cd51bd27cb3fbbe09-linux-x86_64-standard/EasyAudioEncoder/EasyAudioEncoder/EasyAudioEncoder
FFMPEG_HWACCEL => nvdec
ON_DEATH: debug mode enabled for pid [1088]
Computed CPU ops => 606008
Initializing Worker 46d3bc82-3363-45ee-841c-cd33df7c22a9|clusterplex-worker-0
Worker listening on port 3501
Worker connected on socket VmNxscYOpavJ6vBBAAAD