Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plex + Logging/Debugging #216

Open
hikeeba opened this issue Feb 17, 2025 · 5 comments
Open

Plex + Logging/Debugging #216

hikeeba opened this issue Feb 17, 2025 · 5 comments

Comments

@hikeeba
Copy link

hikeeba commented Feb 17, 2025

Love this project and I'm excited to see where it goes.

Below are the details of my issue. I'm not sure if this is a Plex config issue or not, but it doesn't seem like it at the moment.

I'm using Pangolin to replace the need for Cloudflare tunnels, and I believe everything is set up as expected, but I am unable to get the Plex iOS app to see my home Plex server, through Pangolin, when not on my home network. I am able to see, and play videos, using the Plex website remotely, just not the iOS app.

  • Home Network
    • Plex is running in docker on Unraid, network mode is host, port is 32400.
    • Plex is configured w/ remote access disabled, relay disabled, and under networking Custom server access URLs is set to https://[my plex domain through pangolin]:443.
    • Newt is running in docker on Unraid, network mode is bridge.
  • VPS
    • Pangolin is running in AWS on EC2 in docker w/ public IP and domain pointed at it w/ TLS.
    • The resource pointing to Plex in Pangolin is HTTP, SSL enabled, and pointing to Unraid LAN IP with Plex port (32400).
  • What Works
    • Connecting to Plex website using browser, either on the home LAN or remotely through Pangolin.
    • Playing Plex videos using browser, either on the home LAN or remotely through Pangolin.
    • The Plex website works in the browser using both my domain, or app.plex.tv.
    • Playing Plex videos using iOS app while on the LAN.
  • What Doesn't Work
    • Connecting to Plex using the iOS app remotely. Cannot see the server (it shows as offline), and then of course play videos.

I've tried logging in/out of the app, reinstalling Plex on iOS, and rebooting my phone.

Ultimately I'm not sure if this issue is Plex or not, but I'd like to be able to diagnose it and if you could provide some details on how to do that I'd be grateful. Or if you have an idea on what I've misconfigured that would be awesome.

Best,
John

@hikeeba
Copy link
Author

hikeeba commented Feb 17, 2025

Well, I was able to pull from debugging logs from the Plex iOS app and here is what I see.

2025/02/16 22:12:23.960 (48751) 📝 PMKConnectionTestOperation.m:70 | Error during test of <PMKPlexServerConnection: 0x3004336b0>[ [mydomain]:443 - plex,published,direct,verified ] (remaining attempts 0): Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: unauthorized (401)" UserInfo={NSLocalizedDescription=Request failed: unauthorized (401), NSErrorFailingURLKey=https://[mydomain]:443/?X-Plex-Language=en-US&X-Plex-Device-Name=iPhone, com.alamofire.serialization.response.error.data={length = 13, bytes = 0x556e617574686f72697a65640a}, com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x302d8f780> { URL: https://[mydomain]:443/?X-Plex-Language=en-US&X-Plex-Device-Name=iPhone } { Status Code: 401, Headers {
    "Content-Length" =     (
        13
    );
    "Content-Type" =     (
        "text/plain; charset=utf-8"
    );
    Date =     (
        "Mon, 17 Feb 2025 03:12:23 GMT"
    );
    "x-content-type-options" =     (
        nosniff
    );
} }}
2025/02/16 22:12:23.960 (48546) ❌ PMKConnectionManager.m:1076 | Error when connecting to <PMKServer: 0x301529f80>[ Potamoi (be0975ed6c992c843a346fbc2c76bfcd9dc42096) - server,standard,hasPresence (1.41.4.9463-630c9f557) ] using <PMKPlexServerConnection: 0x3004336b0>[ [mydomain]:443 - plex,published,direct,verified ]: Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: unauthorized (401)" UserInfo={NSLocalizedDescription=Request failed: unauthorized (401), NSErrorFailingURLKey=https://[mydomain]:443/?X-Plex-Language=en-US&X-Plex-Device-Name=iPhone, com.alamofire.serialization.response.error.data={length = 13, bytes = 0x556e617574686f72697a65640a}, com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x302d8f780> { URL: https://[mydomain]:443/?X-Plex-Language=en-US&X-Plex-Device-Name=iPhone } { Status Code: 401, Headers {
    "Content-Length" =     (
        13
    );
    "Content-Type" =     (
        "text/plain; charset=utf-8"
    );
    Date =     (
        "Mon, 17 Feb 2025 03:12:23 GMT"
    );
    "x-content-type-options" =     (
        nosniff
    );
} }}
2025/02/16 22:12:23.966 (48541) ➖ PMSourceManager.m:565 | Processing Potamoi
2025/02/16 22:12:23.966 (48541) ➖ PMSourceManager.m:479 | Processing media providers for Potamoi
2025/02/16 22:12:23.966 (48541) ➖ PMSourceManager.m:494 | No media providers for Potamoi

@hikeeba
Copy link
Author

hikeeba commented Feb 17, 2025

The resource for Plex in Pangolin is set as Not Protected. So it looks like it's trying to connect, so the settings from Plex are working. Not sure when the auth failure though.

I haven't tried swapping from HTTP to TCP/UDP in Pangolin, but it doesn't seem like that should be needed.

@miloschwartz
Copy link
Member

miloschwartz commented Feb 17, 2025

Hi, this is an issue we've dealt with before and the work around right now is to create a raw TCP resource for TCP 32400 and then enter http://[vps-ip]:32400 into the custom URLs in the Plex iOS app. More info discussed in this thread on Discord.

I don't want to speak too soon, but I think we may have found the root cause of the problem and will have a fix out in the next update, allowing you to use the HTTPS resource as you expect. I think it has something to do with the iOS app sending requests with :443 appended to the end, thus causing Badger to not match it to the correct resource in the backend.

@hikeeba
Copy link
Author

hikeeba commented Feb 17, 2025

Thanks for the quick response! I'll try that workaround and wait for the next update.

@scroguard
Copy link

Hi, this is an issue we've dealt with before and the work around right now is to create a raw TCP resource for TCP 32400 and then enter http://[vps-ip]:32400 into the custom URLs in the Plex iOS app. More info discussed in this thread on Discord.

I don't want to speak too soon, but I think we may have found the root cause of the problem and will have a fix out in the next update, allowing you to use the HTTPS resource as you expect. I think it has something to do with the iOS app sending requests with :443 appended to the end, thus causing Badger to not match it to the correct resource in the backend.

i can confirm that you're on the right track with this. i had a similar issue when attempting to use caddy previously, as well as traefik, as a reverse proxy for plex. From what I've gathered the iOS app, as well as the XBOX one app, append the port number to the URL which indeed will cause a mismatch on the resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants