We failed to reach a server. Reason: Unauthorized

PlexConnect can’t find any PMS libraries and I get the mentioned error in PlexConnect log.

I installed it using the following routine:

  1. https://github.com/iBaa/PlexConnect#installation
  2. https://github.com/iBaa/PlexConnect/wiki/Install-Guide-Mac-Certificates#create-the-certificate
  3. https://github.com/iBaa/PlexConnect/wiki/Install-Guide-Mac-Certificates#add-the-certificate-files-to-plexconnect
  4. https://github.com/iBaa/PlexConnect/wiki/Install-Guide-Certificate-via-Ethernet

Because I have my own DNS server running and especially don’t want to have another DNS messing around (or using Google DNS at all (tracking!?!)) I modified Settings.cfg as shown here

ip_pms is the internal LAN ip address of the Linux server PMS is running on. PlexConnect is running on the same server (I could use 127.0.0.1).
ip_plexconnect has to be 0.0.0.0 so that all IPs the Linux server has are served.

I can access PlexConnect from my AppleTV, checked the settings and so on. Everything works fine, except the connection between PlexConnect and Plex Media Server.

PlexConnect Log -> http://pastebin.com/ujvZCmAh

Do I have to login into my Plex Account on AppleTV first or add a new user or what?

Answer: Yes

However, after being logged in and browsing the library it suddenly stopped working at all “Trying to connect to Trailer”. I completely purged PlexConnect and started from scratch but even without logging in after first launch PlexConnect now finds 1 Library but I still can’t even get any response from PlexConnect, thus AppleTV is permanently “Trying to connect to Trailer”.

Answer: Restart Apple TV.

Next problem: Whenever I open a media entry in Movies on Apple TV the whole Trailers / PlexConnect thing stops working and I have to restart the Apple TV. However after the first attempt to open the detail pane of a media entry PlexConnect completely stops working. I even can’t access any submenu in Settings (General appearance, etc.).

And there are no images at all.

Look at post #1 in this thread https://forums.plex.tv/discussion/72356/plexconnect-on-synology/p1

There is a section called “Using the Synology DNS Server package to capture trailers.apple.com

Maybe this will give an idea of what you have to do.

Thank you! Although I use a Linux server on which Plex Media Server, PlexPy and PlexConnect runs and my PlexConnect setup is actually working (connection between aTV3 and PlexConnect working) already I went through the whole Guide to see if there are some hints. In the section you mentioned I found that atv.plexconnect is also rerouted to the PlexConnect server IP address so I also added it to my DNS server. Everything else was already correctly setup. Sadly it doesn’t solve any of my problem :frowning:

Because of the bad PlexConnect documentation I don’t know if there are additional settings to be made to get it working or if PlexConnect itself is the problem.

I start the Trailers app on aTV and I see the PlexConnect main interface. I can get a list of all my movies and TV Shows (all without posters). I can see and edit the Settings too. As soon as I open a detail page for a media entry I don’t get any information from PlexConnect to aTV anymore and I have to restart aTV to get it working again. And by working I mean “more or less” because no posters, no media detail page, etc.

Yes, I disabled PIN for my Plex account.

I only see one difference between the very first installation and every after that one.
After the first launch I always got “05:24:30 PlexAPI: Servers (local, plex.tv, MyPlex): 0” in console. After I logged into my Plex Account on the aTV PlexConnect settings the first time it always is “05:24:30 PlexAPI: Servers (local, plex.tv, MyPlex): 1” even without logging into my Plex Account on aTV Plex Connect. So even after completely purging PlexConnect and my Apple TV and reinstalling it, it still says “05:24:30 PlexAPI: Servers (local, plex.tv, MyPlex): 1” - and after logging in it says “05:24:30 PlexAPI: Servers (local, plex.tv, MyPlex): 2”.

Ok, I guess I found something that can cause the problems. I deleted the logfile and set loglevel to High, started PlexConnect and tried to view a media detail page.

Log has entries like this:

05:48:35 ATVLogger: atv.onGenerateRequest done: http://trailers.apple.com/PMS(10.0.9.5:32400)/library/metadata/16024?includeExtras=1&PlexConnect=Movie_PrePlay&PlexConnectUDID=XXXXXXXXXXXX&PlexConnectATVName=Apple%20TV

My AppleTV has the IP 10.0.4.225 and in PlexConnect Settings.cfg I specified ip_pms = 127.0.0.1

Ok there is some serious bug in PlexConnect - or it’s actually not what as what it’s advertised as.

Since Plex itself doesn’t give a damn ■■■■ about different subnets (randomly choosing an IP address) I changed some settings.

My Linux server (on which PMS, PlexPy and PlexConnect is running) has the following IP addresses:

  1. 192.168.0.112
  2. 10.0.4.5
  3. 10.0.5.5
  4. 10.0.6.5
  5. 10.0.7.5
  6. 10.0.8.5
  7. 10.0.9.5

PMS is listening and serving content on all of these IPs. I now added A entry for media.an3k.lan for each of these IPs and added https://media.an3k.lan:32400,http://media.an3k.lan:32400 to the CSA URLs field in PMS so that this DNS name is sent to clients and not an IP address which is most of the time wrong (because the Plex logic here is plain stupid).

After I did that I finally got images shown on my aTV for the three libraries I have (Movies, TV Shows and Music). Great. But now I don’t get any content listed when I open eg. Movies on the aTV.

Log has entries like this:

07:40:07 ATVLogger: atv.onGenerateRequest done: http://trailers.apple.com/PMS(media.an3k.lan:32400)/library/sections/1?PlexConnect=Plex_Movie_Scanner&PlexConnectUDID=DY7HK5BNDRHN&PlexConnectATVName=Apple%20TV

Because my aTV has the IP 10.0.4.225 and asks the DNS server located at 10.0.4.2 it gets “10.0.4.5” as an answer and Plex is right there.
So with the wrong IP address sent to aTV I don’t get images (except the PlexConnect one in Settings) but a list of all the media I have. With the correct IP address I do get images but no list of media.

On my aTV PlexConnect tells me that the Plex Media Server said there is no Content.

In order to get support you need to fill this form https://github.com/iBaa/PlexConnect/wiki/How-to-report-an-issue

Please note however that your setup is not an usual one. Using your own DNS is not a trivial thing. Disabling your DNS and using PlexConnect’s one could be a start to debug your situation. Only after having PlexConnect working you should replace the DNS part by your own.

Well, from my point of view, there is so much wrong with these posts:

ip_plexconnect has to be 0.0.0.0

ip_plexconnect CAN NOT be 0.0.0.0. Not can it be 127.0.0.1 - since aTV uses this address to get in contact. From you aTV’s point of view, neither of the both address will point to your correct host.

bad PlexConnect documentation

Be my guest and help improving it.

in PlexConnect Settings.cfg I specified ip_pms = 127.0.0.1

Not sure where I talked about this the last time. But obviously your aTV won’t find PlexConnect anywhere when looking at 127.0.0.1…

serious bug in PlexConnect - or it’s actually not what as what it’s advertised as

Where? What exactly is that wrong or advertised in a different way?
Check out the disclaimer in Readme.md: “The software is provided as is. It might work as expected - or not. Just don’t blame us.”

Apple TV+

Looks like you modified your settings file somehow like ip_pms = media.an.... Not quite sure, but in my book, this is NOT an ip address. Not sure if you can call that a bug, but PlexConnect uses that /PMS(…) identifier to pinpoint to the responsible PMS - if, and only if, there is an IP given. It doesn’t feed it through your DNS. There shouldn’t be a need to do so, because per definition it’s an ip address, right?
Additionally that marker is used internally to address multiple “owned” or “shared” PMSs at once. This happens when it finds a non-numeric entry there…

That being said, how can I help?

@baa said:
Well, from my point of view, there is so much wrong with these posts:

Then my “How-to-report-an-issue” validated post about this was useless :slight_smile:

ip_plexconnect has to be 0.0.0.0

ip_plexconnect CAN NOT be 0.0.0.0. Not can it be 127.0.0.1 - since aTV uses this address to get in contact. From you aTV’s point of view, neither of the both address will point to your correct host.

I tested PlexConnects behavior and it looked like it’s just specifying the listening address, so if I set 10.0.5.5 it listens on that address, if I specify 0.0.0.0 it listens on all available addresses (that’s a Linux standard).

bad PlexConnect documentation

Be my guest and help improving it.

I just waited for this. I definitely will :slight_smile:

in PlexConnect Settings.cfg I specified ip_pms = 127.0.0.1

Not sure where I talked about this the last time. But obviously your aTV won’t find PlexConnect anywhere when looking at 127.0.0.1…

Fun thing is my aTV always found PlexConnect with 127.0.0.1 specified! And aTV doesn’t look at that address. It’s a stupid device, it just opens trailers.apple.com

serious bug in PlexConnect - or it’s actually not what as what it’s advertised as

Where? What exactly is that wrong or advertised in a different way?
Check out the disclaimer in Readme.md: “The software is provided as is. It might work as expected - or not. Just don’t blame us.”

I don’t mean it that way. What I meant was that PlexConnect is more or less advertised as an Translator Proxy. It receives an URL and fetches the requested data from PMS, translates it and sends it to aTV. But obviously it does not actually work like that.

http://trailers.apple.com/PMS(media.an3k.lan:32400)/library

Looks like you modified your settings file somehow like ip_pms = media.an.... Not quite sure, but in my book, this is NOT an ip address. Not sure if you can call that a bug, but PlexConnect uses that /PMS(…) identifier to pinpoint to the responsible PMS - if, and only if, there is an IP given. It doesn’t feed it through your DNS. There shouldn’t be a need to do so, because per definition it’s an ip address, right?
Additionally that marker is used internally to address multiple “owned” or “shared” PMSs at once. This happens when it finds a non-numeric entry there…

Nope. I set the Custom Server Access URLs in PMS Settings so instead of an IP PlexConnect uses the manually entered DNS name.

That being said, how can I help?

Maybe this post explains it better: https://forums.plex.tv/discussion/197313/cant-get-it-working-correctly

@moody_blue said:
In order to get support you need to fill this form How to report an issue · iBaa/PlexConnect Wiki · GitHub

Please note however that your setup is not an usual one. Using your own DNS is not a trivial thing. Disabling your DNS and using PlexConnect’s one could be a start to debug your situation. Only after having PlexConnect working you should replace the DNS part by your own.

A DNS server is too easy to cause the problem. All the PlexConnect DNS does is sending out eg. trailers.apple.com. A 192.168.0.2 (there’s TTL info somewhere too). It doesn’t matter where the DNS is as long as it is as reachable as the PlexConnect DNS would be and has the correct configuration for that domain.
I appreciate your response but asking someone to disable his DNS server (which will kill complete LAN and WAN connectivity) is a bit of a problem, especially because it wouldn’t help in this case since AppleTV successfully talks to PlexConnect and vice-versa.

Please follow Baa’s indications. I am not an expert on this matter. Sorry for the confusion I may have caused.

No problem. You didn’t :slight_smile:

ip_plexconnect… tested PlexConnects behavior and it looked like it’s just specifying the listening address

One thing it does, right. But then it also forwards this ip to aTV during DNS resolution. Well, not in your case obviously with your own DNS, but in general.

What I meant was that PlexConnect is more or less advertised as an Translator Proxy. It receives an URL and fetches the requested data from PMS, translates it and sends it to aTV. But obviously it does not actually work like that.

Yes, it is. And yes, it does. aTV requests an URL, which then may result in a request to a PMS. Or multiple. The responses are combined, pre-digested to fit to aTV’s need and send back. It does not forward the exact same request URL, that’s true.

Nope. I set the Custom Server Access URLs in PMS Settings so instead of an IP PlexConnect uses the manually entered DNS name.

No, it does not. See for example XMLConverter.py, line 373:

if PMS_address[0].isdigit() or PMS_address=='plex.tv':  # IP:port or plex.tv

It might not be the ideal approach, but this thing checks the PMS identifier coming on from aTV in /PMS(…). Either its first char is numeric - hinting at an ip - which results in a request to the one PMS specified. Or it is alphanumeric, then we treat it as request to multiple PMSs - like “owned”, “shared”, something like this. See PlexAPI.py/getXMLFromMultiplePMS(), lines 474ff.

I will check your other posts… :smiley:

@baa said:

ip_plexconnect… tested PlexConnects behavior and it looked like it’s just specifying the listening address

One thing it does, right. But then it also forwards this ip to aTV during DNS resolution. Well, not in your case obviously with your own DNS, but in general.

What I meant was that PlexConnect is more or less advertised as an Translator Proxy. It receives an URL and fetches the requested data from PMS, translates it and sends it to aTV. But obviously it does not actually work like that.

Yes, it is. And yes, it does. aTV requests an URL, which then may result in a request to a PMS. Or multiple. The responses are combined, pre-digested to fit to aTV’s need and send back. It does not forward the exact same request URL, that’s true.

Then why does it send the ip_plexconnect to aTV too? aTV knows the plexconnect ip by connecting to trailers.apple.com and aTV doesn’t need the PMS IP because PlexConnect sits in between and translates all the stuff between aTV and PMS.

Nope. I set the Custom Server Access URLs in PMS Settings so instead of an IP PlexConnect uses the manually entered DNS name.

No, it does not. See for example XMLConverter.py, line 373:

if PMS_address[0].isdigit() or PMS_address=='plex.tv':  # IP:port or plex.tv

It might not be the ideal approach, but this thing checks the PMS identifier coming on from aTV in /PMS(…). Either its first char is numeric - hinting at an ip - which results in a request to the one PMS specified. Or it is alphanumeric, then we treat it as request to multiple PMSs - like “owned”, “shared”, something like this. See PlexAPI.py/getXMLFromMultiplePMS(), lines 474ff.

This is the dirtiest hack I’ve ever seen. If dirty == dark this is even darker than VANTAblack :slight_smile:

I will check your other posts… :smiley:

Then why does it send the ip_plexconnect to aTV too? aTV knows the plexconnect ip by connecting to trailers.apple.com and aTV doesn’t need the PMS IP because PlexConnect sits in between and translates all the stuff between aTV and PMS.

Not quite. Not all the stuff. Only the XMLs. Every media request goes directly to PMS. aTV needs the address for those - and for telling PlexConnect which PMS is it interested in, in case you have multiple/shared ones attached as well.

Dirty hack? Maybe. But then it’s just an ID meant to be internal to PlexConnect. I guess we could have used just a # as well, but then it’s somehow grown that way. :smiley:

Thank you very much for your time, politeness and explanation! :slight_smile:

I wanted to quickly remove the “ip or plex.tv” stuff but obviously I don’t know python well enough yet … aaaand I just woke up thus I quickly added 1media.an3k.lan to my DNS pointing to the same IPs and used that DNS name as CSA URLs.
aTV / PlexConnect immediately worked. I got content listing and images and even could play a media entry. However my AppleTV crashed but that’s an Apple issue.

I can life this that hacked hack until I know how to code a better solution, which - in case I found one - I will send to you. And for the documentation: I can do that this or next week.