Can't get it working correctly

Your ATV model (2 or 3) and firmware version (found under the ATV settings > general > about > Apple TV software):
Apple TV 3 (Model A1427) running 7.2 (7512)

The DNS server set on the ATV (found under the ATV settings > general > network > DNS):
10.0.4.2

The local IP address of the device that PlexConnect is installed on:
192.168.0.112
10.0.4.5
10.0.5.5
10.0.6.5
10.0.7.5
10.0.8.5
10.0.9.5

The device and operating system (including version number) that PlexConnect is installed on:
Server running Linux 3.16.0-30-generic (#40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015)

The device and operating system (including version number) that the Plex media server (PMS) is installed on:
Server running Linux 3.16.0-30-generic (#40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015)

The Plex media server (PMS) version number you are running (do not put ‘latest’):
0.9.14.4.1556-a10e3c2

The local IP address of the device that the Plex media server (PMS) is installed on:
192.168.0.112
10.0.4.5
10.0.5.5
10.0.6.5
10.0.7.5
10.0.8.5
10.0.9.5

The PlexConnect version number. If using Github source then a time and date of download (look at the creation date of the folder) and if you are using any non-standard setup or a fork.
Github 06.12.2015 07:59 UTC+1

The contents of your ‘Settings.cfg’ file (this is created at first clean shutdown of PlexConnect, using CTR+c)
[PlexConnect]
enable_plexgdm = False
ip_pms = 192.168.0.112
port_pms = 32400
enable_dnsserver = False
port_dnsserver = 53
ip_dnsmaster = 8.8.8.8
prevent_atv_update = True
enable_plexconnect_autodetect = False
ip_plexconnect = 0.0.0.0
hosttointercept = trailers.apple.com
port_webserver = 80
enable_webserver_ssl = True
port_ssl = 443
certfile = ./assets/certificates/trailers.pem
allow_gzip_atv = False
allow_gzip_pmslocal = False
allow_gzip_pmsremote = True
loglevel = High
logpath = .

A detailed description of the issue (the clearer you can make this the better):
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 = 192.168.0.112

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=XXXXXXXXXXXX&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.

Ensure you post your ‘PlexConnect.log’ file to pastebin and post the link (‘PlexConnect.log’ is located in your PlexConnect folder). If possible, follow these steps to create a “more detailed fresh” one:
Logfile without CSA URLs set (I do get a list of all my media in all three libraries but no images and as soon as I want to open a detail view something crashes and I have to restart my Apple TV): /uploads/default/original/3X/7/3/73e5323c353108090b92f1bbf849cd80e4cb81da.log
Logfile with CSA URLs set (I do NOT get a list of all my media in all three libraries but all images): /uploads/default/original/3X/6/1/612b173ec0fdf217cf897eddf54b2e2932e59aac.log

Discovery
“05:24:30 PlexAPI: Servers (local, plex.tv, MyPlex): 0”

The “0” actually can’t happen - as (if I remember correctly) it always adds “plex.tv” as “virtual” PMS for later access to the Plex Home users. Or did your comment refer “very first installation” refer to the very outdated Plex Inc. fork we discussed earlier?

Log

With CSA URL set - as I tried to explain in the other thread:
line 395: <url>http://trailers.apple.com/PMS(owned)/library/sections?PlexConnect=Library_View</url>
Your library page shows all your PMSs (“owned”), seem to work fine as later your NAS PMSs gets triggered and responds (line 537).
line 552: actually shows a “combined” PMS XML, that is only used internally and would contain data from multiple PMSs if available. Here the content is pretty much the same as you NAS’s response.
line 1055: Generated aTV XML. Looks great from aTV point of view. It can access thumbnails directly from PMS, aka media.an3k.lan:32400. Unfortunately - and this is what I pointed out earlier - when selecting an item, it will request it from PlexConnect with PMS id PMS(media.an3k.lan:32400)/ - which will start the confusion.
line 1239: Incoming request: PMS, path: media.an3k.lan:32400 /library/sections/1
As “media” doesn’t start with an number, PlexConnect doesn’t request content from a well defined PMS at that IP, but branches of to trigger “multiple PMSs”. But then the id is not contained in all, owned, shared, local or remote. So unfortunately NO PMS is called, and the internal XML representation essential empty: line 1248 and 1750: 09:11:38 PlexAPI: <MediaConverter friendlyName="media.an3k.lan:32400 Servers" size="0" />

…without CSA URL - the setup I would call “correct”.
Everything seems fine, the only issue is the relatively dump PMS address selection when it comes to machines with multiple IPs. Your aTV is 10.0.4.225, but the PMS address selected actually is 10.0.9.5, the last one in the list retrieved from myPlex. From PlexConnect, every thing is fine, it could most likely get data from either address.
Now the questions:

  • Has aTV access to the PMS in a foreign subnet? I don’t know about your exact layout…
  • Is aTV allowed to access https://10-0-9-5.b386b601d46544598b3cbc67666aa876.plex.direct:32400? In short aTV requests public address, that is actually represented by a local resource. This might be the real thing, a DNS rebind issue, that is disabled by most current routers by default.

@baa said:
…without CSA URL - the setup I would call “correct”.
Everything seems fine, the only issue is the relatively dump PMS address selection when it comes to machines with multiple IPs. Your aTV is 10.0.4.225, but the PMS address selected actually is 10.0.9.5, the last one in the list retrieved from myPlex. From PlexConnect, every thing is fine, it could most likely get data from either address.

Since PlexConnect sits right next to PMS and PlexPy (same linux server) it could access PMS by localhost, 127.0.0.1 and for sure every other IP the server has. That’s why I told PlexConnect to listen on 0.0.0.0 so that any aTV - regardless of the subnet it is in - can access PlexConnect with ease.

Now the questions:

  • Has aTV access to the PMS in a foreign subnet? I don’t know about your exact layout…

Definitely not. These networks are separated so that users from one network can’t even access devices in other networks. That’s why I used media.an3k.lan which points to the IP of PMS in the same subnet the client is in.
If aTV is 10.0.4.225 and asks for media.an3k.lan it gets 10.0.4.5
If aTV is 10.0.9.225 and asks for media.an3k.lan it gets 10.0.9.5

Is aTV allowed to access https://10-0-9-5.b386b601d46544598b3cbc67666aa876.plex.direct:32400? In short aTV requests public address, that is actually represented by a local resource. This might be the real thing, a DNS rebind issue, that is disabled by most current routers by default.

No, because that would evade nearly every security system currently standardized by IETF and others.

I have for example a management console which sits in the management VLAN (IP in a special subnet) that has access to all servers SSH, web interfaces and so on and even that computer cannot reach that URL.

But what I don’t understand:
If I set media.an3k.lan as CSA URLs and open Trailers on aTV I do get the category images but no content listing.
If I do NOT set media.an3k.lan as CSA and open Trailers on aTV I do NOT get category images (or other images at all) but content listings.

If I set media.an3k.lan as CSA URLs and open Trailers on aTV I do get the category images but no content listing.

Well, that’s what I tried to explain: PlexConnect itself has no trouble contacting your PMS. But, when asked to talk to PMS “media…” it THINKS this is a request to multiple PMSs. That’s how it is coded internally.
Possible quick fix: Modify you hostname to start with a digit: 1media… Might work, maybe not, I don’t really know. Or modify the python sources to be fine with your hostname, next to “plex.tv”.

If I do NOT set media.an3k.lan as CSA and open Trailers on aTV I do NOT get category images (or other images at all) but content listings.

With the ip as an ip and not a host name lookup, aTV requests all the media directly from your PMS at x.x.9.5. Sitting in x.x.5.x, aTV can’t reach that PMS. A possible countermeasure would be to improve the discovery process and the selection of the right ip address if multiple are given. Again, a change in python - but probably a good/needed one.