PlexConnect can't find my server but is logged in MyPlex

Hello,

I have been struggling with PlexConnect the whole week-end, with few results.
PlexConnect is up and ready on my Raspberry Pi. The aTV is able to access internet with the Pi as the DNS server.
I can log in into MyPlex with PlexConnect on the Apple TV.
The issue is: PlexConnect can’t find the PSM server.
On the contrary, the iOS app are able to reach my PMS and read content, the same for the webapp.
Please find below the details of my setup…
After a lot of reading on the forum, I have fine tuned a bit my installation, with no success…

I have spotted an error with Python:
URLError: <urlopen error [Errno -5] No address associated with hostname>
you will see the logs below…

Thks in advance for your help.

Your ATV model (2 or 3) and firmware version (found under the ATV settings > general > about > Apple TV software): aTV 3, firmware 7.2
The DNS server set on the ATV (found under the ATV settings > general > network > DNS): 192.168.x.xx (address of the Raspberry Pi running PlexConnect
The local IP address of the device that PlexConnect is installed on: 192.168.x.xx
The device and operating system (including version number) that PlexConnect is installed on: Raspberry Pi B, Raspbian Jessie, Python 2.7.9
The device and operating system (including version number) that the Plex media server (PMS) is installed on: Nas Synology DS 415+, DSM DSM 5.2-5644 Update 2
The Plex media server (PMS) version number you are running (do not put ‘latest’): 0.9.14.4
The local IP address of the device that the Plex media server (PMS) is installed on: 192.168.x.xz
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. 0.5-dev-101215

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.x.xz
port_pms = 32400
enable_dnsserver = True
port_dnsserver = 53
ip_dnsmaster = 8.8.8.8
prevent_atv_update = True
intercept_atv_icon = True
icon = movie-trailers
enable_plexconnect_autodetect = True
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 = Normal

PlexConnect.log (High):
192.168.x.xx= plexconnect IP address
192.168.x.yz= aTV IP address
192.168.x.xz= PMS IP address

18:30:24 PlexConnect: started: 18:30:24
18:30:24 PlexConnect: Version: 0.5-dev-101215
18:30:24 PlexConnect: Python: 2.7.9 (default, Mar 8 2015, 00:52:26)
[GCC 4.9.2]
18:30:24 PlexConnect: Host OS: linux2
18:30:24 PlexConnect: PILBackgrounds: Is PIL installed? True
18:30:24 Settings: getsetting enable_plexconnect_autodetect=True
18:30:24 PlexConnect: IP_self: 192.168.x.xx
18:30:24 Settings: getsetting hosttointercept=trailers.apple.com
18:30:25 ATVSettings: init class CATVSettings
18:30:25 ATVSettings: load settings
18:30:25 Settings: getsetting enable_dnsserver=True
18:30:25 DNSServer: started: 18:30:25
18:30:25 Settings: getsetting port_dnsserver=53
18:30:25 Settings: getsetting ip_dnsmaster=8.8.8.8
18:30:25 Settings: getsetting prevent_atv_update=True
18:30:25 DNSServer: ***
18:30:25 DNSServer: DNSServer: Serving DNS on 192.168.x.xx port 53.
18:30:25 DNSServer: intercept: [‘trailers.apple.com’] => 192.168.x.xx
18:30:25 DNSServer: restrain: [‘mesu.apple.com’, ‘appldnld.apple.com’, ‘appldnld.apple.com.edgesuite.net’] => 127.0.0.1
18:30:25 DNSServer: forward other to higher level DNS: 8.8.8.8
18:30:25 DNSServer: ***
18:30:25 WebServer: started: 18:30:25
18:30:25 Settings: getsetting port_webserver=80
18:30:25 WebServer: ***
18:30:25 WebServer: WebServer: Serving HTTP on 192.168.0.xx port 80.
18:30:25 WebServer: ***
18:30:25 Settings: getsetting enable_webserver_ssl=True
18:30:25 WebServer: started: 18:30:25
18:30:25 Settings: getsetting port_ssl=443
18:30:25 Settings: getsetting certfile=./assets/certificates/trailers.pem
18:30:25 Settings: getsetting certfile=./assets/certificates/trailers.pem
18:30:25 WebServer: ***
18:30:25 WebServer: WebServer: Serving HTTPS on 192.168.x.xx port 443.
18:30:25 WebServer: ***
18:30:32 DNSServer: DNS request received!
18:30:32 DNSServer: Source: (‘192.168.x.xy’, 55425)
18:30:32 DNSServer: Domain: api-global.netflix.com
18:30:32 DNSServer: ***forward request
18:30:32 DNSServer: -> DNS response from higher level
18:30:32 DNSServer: DNS request received!
18:30:32 DNSServer: Source: (‘192.168.x.xy’, 61659)
18:30:32 DNSServer: Domain: nmtracking.eu-west-1.prodaa.netflix.com
18:30:32 DNSServer: ***forward request
18:30:32 DNSServer: -> DNS response from higher level
18:30:33 DNSServer: DNS request received!
18:30:33 DNSServer: Source: (‘192.168.x.xy’, 59146)
18:30:33 DNSServer: Domain: secure.netflix.com
18:30:33 DNSServer: ***forward request
18:30:33 DNSServer: -> DNS response from higher level
18:30:36 DNSServer: DNS request received!
18:30:36 DNSServer: Source: (‘192.168.x.xy’, 58072)
18:30:36 DNSServer: Domain: se.itunes.apple.com
18:30:36 DNSServer: ***forward request
18:30:36 DNSServer: -> DNS response from higher level
18:30:36 DNSServer: DNS request received!
18:30:36 DNSServer: Source: (‘192.168.x.xy’, 56279)
18:30:36 DNSServer: Domain: p43-buy.itunes.apple.com
18:30:36 DNSServer: ***forward request
18:30:36 DNSServer: -> DNS response from higher level
18:30:36 DNSServer: DNS request received!
18:30:36 DNSServer: Source: (‘192.168.x.xy’, 55713)
18:30:36 DNSServer: DNS request received!
18:30:36 DNSServer: Source: (‘192.168.x.xy’, 55713)
18:30:36 DNSServer: Domain: ichnaea.netflix.com
18:30:36 DNSServer: ***forward request
18:30:36 DNSServer: -> DNS response from higher level
18:30:36 DNSServer: DNS request received!
18:30:36 DNSServer: Source: (‘192.168.x.xy’, 56158)
18:30:36 DNSServer: Domain: a4.mzstatic.com
18:30:36 DNSServer: ***forward request
18:30:36 DNSServer: -> DNS response from higher level
18:30:40 DNSServer: DNS request received!
18:30:40 DNSServer: Source: (‘192.168.x.xy’, 53124)
18:30:40 DNSServer: Domain: trailers.apple.com
18:30:40 DNSServer: ***intercept request
18:30:40 DNSServer: -> DNS response: 192.168.x.xx
18:30:40 WebServer: http request header:
Host: trailers.apple.com
Accept-Encoding: gzip, deflate
Accept: /
Accept-Language: fr;q=0.9, en;q=0.8
Cookie: s_vi=[CS]v1|2A82003805012E1C-6000011260535F14[CE]
Connection: keep-alive
X-Apple-TV-Resolution: 1080
X-Apple-TV-Version: 7.2
User-Agent: AppleTV/7.2 iOS/8.3 AppleTV/7.2 model/AppleTV3,2 build/12F69 (3; dt:12)

18:30:40 WebServer: http request path:
/appletv/us/js/application.js
18:30:40 Localize: aTVLanguage: fr
18:30:40 WebServer: pms address:

18:30:40 WebServer: cleaned path:
/appletv/us/js/application.js
18:30:40 WebServer: PlexConnect options:
{‘aTVScreenResolution’: ‘1080’, ‘aTVFirmwareVersion’: ‘7.2’, ‘aTVLanguage’: ‘fr’, ‘aTVAddress’: ‘192.168.x.xy’}
18:30:40 WebServer: additional arguments:

18:30:40 WebServer: serving /js/application.js
18:30:40 Settings: getsetting allow_gzip_atv=False
18:30:40 WebServer: http request header:
Host: trailers.apple.com
X-Apple-Store-Front: 143442-3,19
Accept: /
Accept-Encoding: gzip, deflate
Accept-Language: fr;q=0.9, en;q=0.8
Cookie: s_vi=[CS]v1|2A82003805012E1C-6000011260535F14[CE]
Connection: keep-alive
X-Apple-TV-Resolution: 1080
X-Apple-TV-Version: 7.2
User-Agent: AppleTV/7.2 iOS/8.3 AppleTV/7.2 model/AppleTV3,2 build/12F69 (3; dt:12)

18:30:40 WebServer: http request path:
/&PlexConnect=Discover&PlexConnectUDID=C0HM7VBVFF54
18:30:40 Localize: aTVLanguage: fr
18:30:40 WebServer: pms address:

18:30:40 WebServer: cleaned path:
/
18:30:40 WebServer: PlexConnect options:
{‘aTVAddress’: ‘192.168.x.xy’, ‘aTVScreenResolution’: ‘1080’, ‘PlexConnectUDID’: ‘C0HM7VBVFF54’, ‘aTVLanguage’: ‘fr’, ‘aTVFirmwareVersion’: ‘7.2’, '$
18:30:40 WebServer: additional arguments:
18:30:40 WebServer: additional arguments:

18:30:40 WebServer: serving .xml: /
18:30:40 XMLConverter: ---------------------------------------------
18:30:40 XMLConverter: PMS, path: /
18:30:40 XMLConverter: Initial Command: Discover
18:30:40 ATVSettings: getsetting mytoken
18:30:40 ATVSettings: getsetting False
18:30:40 PlexAPI: ***
18:30:40 PlexAPI: poke plex.tv - request Plex Media Server list
18:30:40 PlexAPI: ***
18:30:40 PlexAPI: URL: https://plex.tv/api/resources?includeHttps=1
18:30:40 PlexAPI: xargs: {‘X-Plex-Token’: ‘mytoken’, ‘X-Plex-Platform’: ‘iOS’, ‘X-Plex-Model’: ‘3,1’, ‘X-Plex-Client-Platform’: ‘iOS’, 18:30:41 PlexAPI: ====== received PMS-XML ====== 18:30:41 PlexAPI: <MediaContainer size="3"> <Device accessToken="mytoken" clientIdentifier="e8796c0650f567fd042e8161f571f51e05f64d96" createdAt="1438516672" device="DiskStation"
<Connection address=“192.168.x.xz” local=“1” port=“32400” protocol=“https” uri="https://192.168.x.xz.29a62912216c444fb3476cdf305e0c8d.plex.direc$
<Connection address=“my_external_IP_address” local=“0” port=“14472” protocol=“https” uri="https://my_external_IP_address.29a62912216c444fb3476cdf305e0c8d.plex.dir$

<Device accessToken=“mytoken” clientIdentifier=“DE235D56-E659-4A38-882B-3CEED4A23F38” createdAt=“1419543405” device=“iPhone” lastSeen$


<Device accessToken=“mytoken” clientIdentifier=“BE4BCC5D-C809-4607-BD47-760599EDCC6A” createdAt=“1428648577” device=“iPad” lastSeenAt$


18:30:41 PlexAPI: ====== PMS-XML finished ======
18:30:41 PlexAPI: URL: https://192-168-x-xz.29a62912216c444fb3476cdf305e0c8d.plex.direct:32400/
18:30:41 PlexAPI: xargs: {‘X-Plex-Token’: ‘mytoken’}
18:30:41 PlexAPI: No Response from Plex Media Server
18:30:41 PlexAPI: We failed to reach a server. Reason: [Errno -5] No address associated with hostname
18:30:41 PlexAPI: Traceback:
Traceback (most recent call last):
File “/usr/local/lib/PlexConnect-master/PlexAPI.py”, line 406, in getXMLFromPMS
response = urllib2.urlopen(request, timeout=20)
File “/usr/lib/python2.7/urllib2.py”, line 154, in urlopen
return opener.open(url, data, timeout)
File “/usr/lib/python2.7/urllib2.py”, line 431, in open
response = self._open(req, data)
File “/usr/lib/python2.7/urllib2.py”, line 449, in _open
‘_open’, req)
File “/usr/lib/python2.7/urllib2.py”, line 409, in _call_chain
result = func(*args)
File “/usr/lib/python2.7/urllib2.py”, line 1240, in https_open
context=self._context)
File “/usr/lib/python2.7/urllib2.py”, line 1197, in do_open
raise URLError(err)
URLError: <urlopen error [Errno -5] No address associated with hostname>

18:30:41 PlexAPI: Servers (local, plex.tv, MyPlex): 1
18:30:41 PlexAPI: {‘name’: ‘plex.tv’, ‘accesstoken’: ‘mytoken’, ‘address’: ‘plex.tv:443’, ‘enableGzip’: False, ‘ip’: ‘plex.tv’, 'scheme$
18:30:41 Settings: getsetting allow_gzip_atv=False
18:30:41 WebServer: http request header:
Host: trailers.apple.com
X-Apple-Store-Front: 143442-3,19
Accept: /
Accept-Encoding: gzip, deflate
Accept-Language: fr;q=0.9, en;q=0.8
Cookie: s_vi=[CS]v1|2A82003805012E1C-6000011260535F14[CE]
Connection: keep-alive
X-Apple-TV-Resolution: 1080

DNS-rebind to local host?

@baa said:
DNS-rebind to local host?

Hi Baa,
Thanks for your answer, however, I have to admit that I don’t understand what you mean (I am not an It ingeneer… :frowning: )
How can I achieve this DNS-rebind to local host?

Thks

Valyno

It’s supposed to be a security feature to mitigate … (well, yes, what?). My understanding: It is not allowed for a local computer (client) to access another local computer (host) using the public IP address. Formerly the router would have just picked this up (sometimes even routing every packet locally), and everything was good. But now typically routers prevent just that… which might result in network woes like you described.
Work around - in your router settings should be a “white list” to allow specific hosts to be accessed using that re-bind way. Add “plex.direct” to that list… and keep in mind that you now opened a door for some sort of security breach (hm, I have done it that way, no idea what might go wrong now).

Baa, thank you for the explanation.
If I get it correctly, my Pi with PlexConnect tries to contact the PMS on my external IP address and my router is preventing the request to be routed to the PMS, right?
If yes, I ma kinda stuck 'cause I couldn’t find in my router (ISP’s box) any setting to do so.
My ISP offers a reverse DNS option, but I don’t know if this is what could solved my issue, and if yes, how to use it (I tried to use plex.direct but the record was rejected…)

Hi Mudasir.k,

PlexGDM was seing nothing, that’s why I tried to hard code the IP address of my NAS.
I made some progress: fooling around in the router, I activated the DMZ and put the NAS with the PMS.
PlexConnect is now able to see the PMS.
I have removed the DMZ and the PMS is still visible…
However, now I can see my movie sections… but with no content!!!

I will have a look to the link you mention, thks!!

Some news…
So I tried with signing out from MyPlex, with PlexGDM to True : no server detected
Then I retried with plexgdm = False + hard code the PMS IP address, not signed in with MyPlex: no server found
Then I retried with plexgdm = False + hard code the PMS IP address, signed in with MyPlex: server found but no content in Libraries (they do show up, but empty)
Then I tried to insert the code mentioned on github in the link you have proposed: nothing more…
For now, the only way to detect the PMS, is to be signed in with My Plex…

The aTV, the Pi with PlexConnect and the NAS are all on the same local network…

Yes, my iOS and Android devices can see the content of the PMS… the web either…

Hello,
I finally found the issue: I had a PIN code to access to the user’s content…
After removing the PIN, PlexConnect is loading the content of the libraries.
It’s even written in the Limitations… stupid me.
Thks for those who tried to help me!!

You can still use a pin code.

You just need to switch user on the ATV and you will be prompted for the pin code. The ATV will even remember the pin code so you don’t need to enter it each time.

I’ve run into this same issue on Apple TV 3 with Plex connect all of a sudden refusing to recognize PMS. I’m using Python27 on the PC. Under “settings” on plex connect, I see that I am logged in, but servers: 0. I can sign out and then it says servers: 1, but of course I can’t access it until I log in and when I do, it says 0 servers again. I also tried switching users, but that doesn’t help. What do you need from me to get this going again?

Colonel Angus: Is your PMS published? Ie. known at plex.tv/myplex?

I don’t think so. Most of the fields in the “Network” section are blank, except for the cloud sync upload speed limit.

I had exactly the same problem. Noticed it only today, but haven’t been using PlexConnect for about a week, so don’t know exactly when that started. It turned out, that for some reason my server had publisdhed a bogus IP among the correct ones: 192.168.100.2. I don’t know where it comes from, neither of my interfaces have this IP. Unfortunately, that IP was the one that PlexConnect was choosing, so it was failing with the following exception:

00:37:36 PlexAPI: URL: https://192-168-100-2.xxx.plex.direct:32400/
00:37:36 PlexAPI: xargs: {'X-Plex-Token': 'xxx'}
00:37:56 PlexAPI: No Response from Plex Media Server
00:37:56 PlexAPI: We failed to reach a server. Reason: timed out
00:37:56 PlexAPI: Traceback:
Traceback (most recent call last):
  File "/opt/PlexConnect/PlexAPI.py", line 406, in getXMLFromPMS
    response = urllib2.urlopen(request, timeout=20)
  File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/usr/lib64/python2.7/urllib2.py", line 449, in _open
    '_open', req)
  File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 1258, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/usr/lib64/python2.7/urllib2.py", line 1214, in do_open
    raise URLError(err)
URLError: <urlopen error timed out>

I worked around this problem by simply checking for 192.168.100.2 in the getPMSListFromMyPlex() and skipping to the next connection if that was the case.

Stigger, thanks for the effort, but I don’t think we’re in exactly the same boat. In the Python window, IP_self is the same as my host computer. the IP address it is seeing DNS requests from is the the IP for my AppleTV, which makes sense to me. I’m not sure how to copy the log in here.

I’m also not sure what you mean by “getPMSListFromMyPlex()”

Update. I read on github that if you’re having trouble getting your PMS to be discovered, then you can sidestep it by editing the Settings.cfg file to disable plexgdm and manually entering the IP for your PMS. Here is what I have:
[PlexConnect]
enable_plexgdm = False (changed from true)
ip_pms = 192.168.1.186 (this is my PMS computer)
port_pms = 32400
enable_dnsserver = True
port_dnsserver = 53
ip_dnsmaster = 8.8.8.8
prevent_atv_update = True
enable_plexconnect_autodetect = False (I also read that you could disable this to help, too)
ip_plexconnect = 192.168.1.186 (again, my PMS)
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 = Normal
logpath = .

I save, then launch plexconnect and then click “trailers” from the apple TV, but it Python still winds up saying it could not reach the server.

bump… am I SOL?

I read on github that if you’re having trouble getting your PMS to be discovered, then you can sidestep it by editing the Settings.cfg file to disable plexgdm and manually entering the IP for your PMS.

That works when PlexConnect is NOT signed in to myplex. If it is signed in, it will grab the PMS address information from there…
A log of the initial discovery process could help to understand what’s going on in your case. Possible options: PMS not published. Or your router does not allow to address local hosts with public IP. Or your PMS has been published under multiple, maybe no longer working addresses.

@baa said:

Possible options: PMS not published. Or your router does not allow to address local hosts with public IP. Or your PMS has been published under multiple, maybe no longer working addresses.

Having the same issue. I have verified the first is not the issue. My PMS is published. PlexConnect sees 1 library when not signed in to MyPlex and 0 libraries after I sign in. Your second suggestion is that the router is the issue; is there any way around this? Can you point me to more info on how to verify this, as well? I’m having trouble finding any resources online. Thanks!

Router

I can only talk about a fritz-box here… but a similar setting is most likely available on most other routers.
The feature creating trouble is “DNS rebind protection”, there is a “white-list” available in the home/network settings. Add “plex.direct” as an exception.