Unable to Transcode Media Files

Server Version#: 1.21.3.4046
Player Version#: 4.51.1 (web) or 8.13.1.23036 (Android)

Recently rebuild my server and changed from Centos7 to RHEL8. Since the rebuild I have been unable to get anything to play where transcoding is required.
If I play files through my Nvidia Shield it works without issue, but using the web player or Android app fails to work and I receive an error

  • ‘Conversion failed. The transcoder exited due to an error.’

Did initially also have a lot of errors with the system failing to download codecs, but after manually downloading these those errors no longer occur but unsure if this would all be related.

Starting to run out of ideas to attempt myself so was hoping to get some assistance with this matter.

*Edit to put link to logs in reasonable location in post.
Plex Media Server.log (3.6 MB)

Cheers,

Where did you symlink PMS to? The mount is the root issue here.

The errors in your logs show “operation not permitted” when attempting to load codecs (which are shared objects). .so files are executable; therefore the partition containing them must allow exec permission.

Solutions:

  1. Add exec option to /etc/fstab for the partition actually containing Library
  2. Additionally, Create a proper systemd override file and discontinue use of symlinks.
Feb 24, 2021 17:26:55.841 [0x7f383f861e80] DEBUG - ChangestampAllocator: initialized to 5989825098825955424
Feb 24, 2021 17:26:55.841 [0x7f383f861e80] DEBUG - Opening 2 database sessions to library (com.plexapp.plugins.library.blobs), SQLite 3.26.0, threadsafe=1
Feb 24, 2021 17:26:55.847 [0x7f383f861e80] DEBUG - Running migrations. (EPG 0)
Feb 24, 2021 17:26:55.847 [0x7f383f861e80] WARN - [FFMPEG] - Error loading external lib: /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Codecs/367b3d4-3673-linux-x86_64/libh264_decoder.so: cannot open shared object file: Operation not permitted
Feb 24, 2021 17:26:55.847 [0x7f383f861e80] WARN - [FFMPEG] - Error loading external lib: /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Codecs/367b3d4-3673-linux-x86_64/libac3_decoder.so: cannot open shared object file: Operation not permitted
Feb 24, 2021 17:26:55.847 [0x7f383f861e80] WARN - [FFMPEG] - Error loading external lib: /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Codecs/367b3d4-3673-linux-x86_64/libaac_encoder.so: cannot open shared object file: Operation not permitted
Feb 24, 2021 17:26:55.847 [0x7f383f861e80] WARN - [FFMPEG] - Error loading external lib: /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Codecs/367b3d4-3673-linux-x86_64/liblibx264_encoder.so: cannot open shared object file: Operation not permitted
Feb 24, 2021 17:26:55.864 [0x7f383f861e80] DEBUG - [CERT] Installed certificate with fingerprint 2f:03:12

Thanks for the response, I shall have a look into this when I am home.
From my recollection of the setup though I did not create any symlinks and the only changes I made to fstab was mounting my media directory which isn’t where Plex is located.

Will advise further once I have a chance to double check my configuration and follow your advice though.

I have now examined this further, the /etc/fstab for the partiion containing the Library contained default settings (exec allowed)
No symlinks were in use in regards to the directories used by Plex, and the initial installation was perform from the repo ( Enable repository updating for supported Linux server distributions | Plex Support) so had thought most should be default settings

I have now also worked through some guides from ’ Customizing your Plex configuration - Plex Media Server / Desktops & Laptops - Plex Forum’ and relocated the plex metadata directories and confirmed plex:plex is owner, but continue getting same errors as before.

Plex Media Server.log (123.7 KB)
fstab.txt (833 Bytes)

Thanks for providing the updated log and info.

Wow :thinking:

This is strange.

Would you please

  1. Stop Plex
  2. Go into /home/plexdata/Library/Application Support/Plex Media Server/Codecs
  3. Delete everything you see EXCEPT the .device-id file (your license key)

Restart Plex.

By doing this, the Codecs Manager will download a few basic codecs as PMS starts.

Next, play something simple (MKV - HEVC - AAC / AC-3 ) which requires transcoding.

It will download fresh codecs and then start.

If it fails, please download and attach the logs again.

In the interrim, I will start to spin up a RHEL VM.

I have completed basic installation, updates, and loading of PMS

I have made some interesting observations.

  1. FireFox won’t play.
  2. Chrome will.

It didn’t matter if I used movies or tv, the results were the same.

Can you confirm?

So I have tried the above.
Stopped Plex, deleted Codecs (except .device-id), Starts plex.

Continues to fail, now stating that no Codecs are available.
Tried in both Chrome, and Edge and had the same problem, do not currently have FF for testing.

Plex Media Server.log (298.0 KB)

Cheers,

Thank you for the logs.

You cannot download cleanly.

The files are failing download checksum test.

Feb 26, 2021 07:22:15.989 [0x7fe0125b4700] DEBUG - Completed: [192.168.1.15:3426] 200 GET /activities (10 live) TLS GZIP 0ms 429 bytes (pipelined: 6)
Feb 26, 2021 07:22:16.952 [0x7fdfddffb700] DEBUG - [Transcode] HTTP 200 response from GET https://plex.tv/api/codecs/h264_decoder?build=linux-x86_64-standard&deviceId=f574bde1-0af1-4cf4-a97e-8e1cd429c7bd&oldestPreviousVersion=1%2E21%2E3%2E4021-5a0a3e4b2&version=367b3d4-3673
Feb 26, 2021 07:22:16.953 [0x7fdfddffb700] DEBUG - [Transcode] HTTP requesting GET https://downloads.plex.tv/codecs/367b3d4-3673/linux-x86_64-standard/libh264_decoder.so
Feb 26, 2021 07:22:17.527 [0x7fdfddffb700] DEBUG - [Transcode] HTTP 200 response from GET https://downloads.plex.tv/codecs/367b3d4-3673/linux-x86_64-standard/libh264_decoder.so
Feb 26, 2021 07:22:17.532 [0x7fdfddffb700] ERROR - [Transcode] safe_fopen: fopen for '"/home/plexdata/Library/Application Support/Plex Media Server/Codecs/367b3d4-3673-linux-x86_64/libh264_decoder.so.tmp-18ad-8fe6-7f6a-f781"' failed: 1 (Operation not permitted)
Feb 26, 2021 07:22:17.532 [0x7fdfddffb700] ERROR - [Transcode] CryptoHash: Failed to open file: "/home/plexdata/Library/Application Support/Plex Media Server/Codecs/367b3d4-3673-linux-x86_64/libh264_decoder.so.tmp-18ad-8fe6-7f6a-f781"
Feb 26, 2021 07:22:17.532 [0x7fdfddffb700] ERROR - [Transcode] Codecs: Download failed: Failed to verify SHA1sum of codec!
Feb 26, 2021 07:22:17.533 [0x7fdfddffb700] ERROR - [Transcode] Error configuring transcoder: Decoder install failed: h264
Feb 26, 2021 07:22:17.533 [0x7fdfddffb700] DEBUG - [Transcode] Streaming Resource: Terminated session 0x7fdfc80afbb0:43h59qayjxa9hmgv6etb8qmx with reason Conversion failed. A required codec could not be found or failed to install.
Feb 26, 2021 07:22:17.533 [0x7fe011db3700] DEBUG - [Transcode] Killing job.
Feb 26, 2021 07:22:17.533 [0x7fe011db3700] DEBUG - [Transcode] Job was already killed, not killing again.
Feb 26, 2021 07:22:17.533 [0x7fe011db3700] DEBUG - [Transcode] Stopping transcode session 1vrzrzamtdza8dzlsud42h7h

Time to figure out what is wrong with the network / networking layer

Yeah that was something I had noted before.
I thought i had overcome that although not in a clean method by performing a wget on the codecs using the provided URL.
This did let me proceed past this particular error though it was not really a feasible solution. Trying to resolve the playback I had thought getting Codecs would be a good start though possibly it’s all related.

Plex gets the codecs when it needs them.

You shouldn’t be downloading codecs.

Did I misunderstand?

It opens the codec server, sends your device-id license key, then gets the codec back

If that mechanism is broken then I first look at SSL then basic networking (it’s HTTPS)

Yeah i was manually downloading them.
Didn’t think I should have been needing to do so but was just attempting to get things working.

In regards to networking, SELinux is disabled and i have opened the firewall ports as per the config file.
FirewallRules.txt (562 Bytes)

Do you allow all outbound?

Plex will open a HTTPS connection (equiv of wget https://.........)

It needs that reply.

The UDP ports you have should only be for LAN domain

I will need to check that configuration when I am back home, but I can imagine this very much may be an issue.
Will advise further once I have checked.
Thanks for the assistance so far.

From what I can determine all outbound traffic should be allowed, and I am receiving a ping and curl response from downloads.plex.tv

iptables
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Ping_Curl.txt (898 Bytes)

Why don’t you put wireshark or etherape on it ?

Look at the data out.

You should see the reply on the same socket.

curl opens the https port. The codec is the reply.
Look at how wget works. It’s the same technique.

That having been said:

  1. Unsolicited inbound connect – deny (always)
  2. Outbound – allow
  3. Reply to outbound – allow.

I’ve never been the strongest user of wireshark, never quite sure what I’m looking at, but nothing is looking obviously like a fault here, unless I’ve made a mistake with something.

First I attempted to play a file so it would auto download codecs. First 1000ish lines)
Then I did a curl and wget.

wireshark_log.txt (246.4 KB)
Full wireshark with no filters.
http_capture.zip (2.0 MB)

That looks like it’s downloading data (from plex.tv → target 192.168.1.51

Is that what it is meant to be doing?

From what I have determined when it downloads the codecs it looks as though it downloads a temp file, which it seems to not have execute permissions too, it cant confirm the file is correct, and then it is deleted.
Cannot work out why this would occur though. Plex has full permissions to the folder it is downloading too and permissions should not be stripped so much.

Mpeg4 decoder tmp files are in the folder, and then immediately removed permssions

That’s what’s happening.

  1. It knows what it’s getting.
  2. It then opens the socket to receive the coded; writing to the tmp file
  3. When done, it will sha1sum the file to confirm it’s valid
  4. If valid, it is renamed and marked active.

what you have there is a failure to receive.

OK, so I am still not sure where I have gone wrong here, but I have determined that if I tell Plex to run as root:root everything works correctly.
So something is wrong with my permissions though I am not certain what. For the meantime this gets me up and going and considering my system is isolated and runs nothing but plex its feasible but not a preferred solution.