Debian Plex Server: Transcoding Fails with 401 Unauthorized Errors

Server Version#: Version 1.41.3.9292
Player Version#: Latest (mobile, desktop, web)

Hi everyone. I spent the past two days searching the various forums and resources, and half a dozen hours trying to troubleshoot my issue with ChatGPT, but I am at my wits’ end.

I have a plexmediaserver installed on my debian server (6.1.0-28-amd64) running on an Intel Adler Lake n100 minipc.

I cannot get the transcoding to work, hardware or software: the player shows a spinning wheel for a minute and then throws an error message.

On the backend, the transcode seems to be working (high CPU usage and the transcode temporary directory is filling). Logs show 401 Unauthorized POST errors during playback attempts.

I have tried logging in both locally and remotely, from a computer (desktop and web), from a mobile phone (app and web). From a friend house (desktop). In all cases, I can access the server just fine, and direct play if available, but once transcoding is on the table, then media won’t play.

I have configured my router to whitelist and enable PAT on the 32400 port I manually set, and tried going with UPnP instead, but to no avail.
I also tried reaching my server using the *.plex.direct on my browser, and it works just fine (except for transcoding, that is).

I have set up a temporary test plexmediaserver on my windows computer, and everything works fine there - direct play, transcoding, both locally and remotely.

I have tried resetting my token, and updating it everywhere, but no dice - though I’m not very comfortable with this part.

I have checked every filesystem permission, and everything appears to be in order.

Here is what the logs look like when I try playing a media that requires transcoding:
https://pastebin.com/r177k7it (verbose on, from mobile app on external ip)
Plex Logs 2 - Pastebin.com (verbose off, from desktop app locally)

I am really at a loss, and I don’t know what else to try. I would appreciate if a kind soul could come to my aid!

Thank you
soum

apt install or download the .deb file straight from Plex?

I installed it via apt, using Plex’s official repository

Drag and drop the server debug zip file here from the https://app.plex.tv/web wrench > Troubleshooting > download logs:

1 Like

It…won’t let me :confused: I get a 500 Internal Error when I try to download the logs or the database. I tried restarting it but I’m still met with the same message. Should I manually grab them?
Thanks!

Edit: That was a permission error. It couldn’t access /tmp/. Here you go
Plex Media Server Logs_2024-12-13_18-04-12.zip (2.4 MB)

Yes, default location is /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs .

1 Like

You have an invalid character in Network “List of IP addresses and networks that are allowed without auth”, should be 192.168.1.0/24

Are you sure you want local clients to have admin access?

1 Like

Oops. Nicely spotted. No, it was just one of the many unsuccessful attempts at fixing the issue. I tried it this afternoon but forgot to remove it. It is now, though

Hardware Transcoding is working and not failing on the server. Remove the network entry and restart. Mostly it is the clients disconnecting from the server… You have what looks like DNS rebinding issues and your remote networking isn’t working.

There are 3 predefined directories that I would have avoided using, /home,/media and /mnt due to permissions being overwritten during OS upgrades.

1 Like

Done. Still no dice on the mobile or the web app, but the transcoding works on the desktop of my windows computer. I’m enclosing the logs.

Can you expand on the “your remote networking isn’t working”? I had read about DNS rebinding potential issues, but my ISP is sort of annoying and imposes their own DNS server. It mentioned in these cases to go for a private proxy and DNS setup, but it looked costly and apparently not very well received by plex.
For what it’s worth, my /etc/network/interfaces uses the google DNS

Got it for the dirs. I’ll change them.
Plex Media Server Logs_2024-12-13_18-50-07.zip (2.6 MB)

Under Network uncheck " Enable server support for IPv6", looks like the phone keeps trying to connect over ipv6.

What router do you have? Need to get plex.direct entered into the private domain section of DNS. No chance of using 8.8.8.8 or 1.1.1.1 for DNS?

1 Like

Done. No dice either :frowning: Not sure if it’s of any interest, but the transcoding also works if I connect externally to my desktop app (using a VPN on my windows PC).
I asked a friend to give it a try. She reported that one movie was playing fine, but not another one. I’ve tried from my mobile the one she reported as OK, and it worked for me as well, but most likely because it was direct play).
Plex Media Server Logs_2024-12-13_19-25-08.zip (2.2 MB)

I’m using my ISP router, which is quite lacking in terms of configuration. The only DNS things I can do is name my devices or use DynDNS:

I must ask though, wouldn’t the DNS rebinding also impact external connections to the windows computer that is on the same network?

DNS Rebinding is for internal network protection only, dynamic dns is normal and beneficial externally for remote users to find their way to your public IP. What model of Router is that?

Oddities from your last set of logs
Do you have Plex Media Server install on 192.168.1.123? This is what seems to be giving the 401 errors and conflicting with the main server.

192.168.100.1, if this is a VPN then it may be what is interfering with the local loopback adapter on the Debian server.

1 Like

Thanks for replying :slight_smile:

.123 is my PC, I still have a plexmediaserver instance, apparently running but mapped to a different port. Uninstalled now, but no dice.

Also. Oh. My. God.! You’re correct, 192.168.100.1 was the culprit. It is the IP address of the veth0 interface connecting to my VPN namespace, and for some reason plex was routing the transcoding traffic through it?

Modifying the AllowedNetworks setting to “127.0.0.1,192.168.1.0/24” seemingly fixed the issue. I will ask my friend to confirm tonight but it worked on my mobile and on my PC using a VPN. I will flag the “Solution” once I hear from her, just in case.

Thank you so much!! :slight_smile:

Just to reiterate, any address added to “List of IP addresses and networks that are allowed without auth” gives devices admin access to your sever without login and should only be done if you are trying to work around no internet access or have full control of all the devices.

Hmm…that’s a fair point. Would you have a safer and better solution to recommend?

The field is empty by default since it isn’t necessary to run Plex, I would clear it out.

Okay. I understand the concern, and I admit that I was being a bit too liberal with my approach earlier.
But I have tried experimenting with ip tables but couldn’t get anything to work as expected; the transcoding was still failing.
So I have reverted to using the AllowedNetwork field, but I have restricted it to my server local IP address only. AFAIK, if someone were to exploit it, it would mean they’d already breached the server, and at that point, they’d have virtually the same nuisance power over Plex as they would over the rest of the system. I think it is a fair compromise for the time being (that most likely will last, hah).

Thanks again for your kind help. It was driving me crazy!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.