No servers found

PlexConnect used to be working fine for me, with both PMS and PlexConnect running in jails on FreeNAS 9.3. An update somewhere along the line has prevented PlexConnect from finding or connecting to my Plex server.

 

- Your ATV model (2 or 3) and firmware version (found under the ATV settings > general > about > Apple TV software):
ATV 2 ,running 6.2.1

- The DNS server set on the ATV (found under the ATV settings > general > network > DNS):
192.168.1.1 (running dnsmasq which forwards trailers.apple.com to 192.168.1.139)

- The local IP address of the device that PlexConnect is installed on:
192.168.1.139

- The device and operating system (including version number) that PlexConnect is installed on:
FreeNAS 9.3 jail

- The device and operating system (including version number) that the Plex media server (PMS) is installed on:
FreeNAS 9.3 jail, not the same jail as plexconnect

- The Plex media server (PMS) version number you are running (do not put 'latest'):
0.9.11.7

- The local IP address of the device that the Plex media server (PMS) is installed on:
192.168.1.137

- 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 e.g. Plexify or a fork.
PlexConect pulled from GitHub on Feb 15, commit afd8638774ded4e0e3241af45cd6516b1566d5ab

-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.1.137
port_pms = 32400
enable_dnsserver = True
port_dnsserver = 53
ip_dnsmaster = 8.8.8.8
prevent_atv_update = False
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 = High
logpath = .

- A detailed description of the issue (the clearer you can make this the better):
PlexConnect on the ATV can't find any servers. I've changed a few things recently so I'm not sure what broke it - it's either an update of FreeNAS or an update to PMS, of perhaps using PlexHome. I've never had much luck with GDM so I've always specified the IP address of the server in PlexConnect's config. Looking at the logs it looks like PMS is refusing the connection from PlexConnect.

 

PlexConnect log is at: http://pastebin.com/VMg1iMNG

 

Cheers,

Paul

 

There seems to be an issue with non-GDM-servers and PlexHome tokens. I am trying to get my head around the "real" process, but currently things get lost in too many layers of access tokens...

@Baa any clue what commit is the last one that works fine?

It's not an issue with PlexConnect per se. It just doesn't support PlexHome with a server defined directly with IP rather than GDM. If you don't use PlexHome, you should be good.

Ok, I think I can explain the issue a little better now...

GDM off: PlexAPI.py triggers the given IP:Port to get in contact with your PMS. PMS is supposed to answer with some basic information, like machine type it is running on and so on. Unfortunately with PlexHome (or RequireAuthorisation for that matter) it wouldn't take to us... :-(

What's really interesting for PlexConnect at that stage is the host UDID to distinguish the servers going forward. And with PlexHome enabled that UDID wasn't given.

GDM on: PlexAPI.py checks for servers in its surroundings, and those with GDM enabled will answer accordingly, handing over the UDID.

PlexConnect memorizes the servers being local at that point.

Now we go on and check MyPlex, which doesn't do any harm. It adds some information about local servers (like ownership...) and shared, probably remote servers that were not found earlier. Double checking the UDID, PlexConnect either updates or adding PMS data.

That process worked pretty well, as long as the manually specified PMS didn't require authentication...

Along came PlexHome: "Require authentication" is used now for every server in your neighborhood. The manually defined PMS (remember, it didn't answer during initial lookup: no UDID) basically gets lost in memory - and might be double-added using it's external/public IP plus UDID from myPlex data...

This also doesn't do much harm (though it doesn't help either) if your router supports "looping back" a request from your LAN back into your LAN using the public IP. If not, as of today, we don't have a chance to talk to our lost PMS...

So long - at least that's my current understanding.

Questions to pdonovan:

Does you router support "loop back"? Do you have a chance to enable it (I remember with my FritzBox, I had to update the firmware...)? Does it help with your issue? I know it's not a perfect solution, and I am thinking about other ways to solve it.


Questions to pdonovan:

Does you router support "loop back"? Do you have a chance to enable it (I remember with my FritzBox, I had to update the firmware...)? Does it help with your issue? I know it's not a perfect solution, and I am thinking about other ways to solve it.

My problems with GDM have been related to the FreeNAS/FreeBAD jails setup, GDM works on my home network generally OK - I just re-installed Plex Home Theatre on my iMac and it found the PMS in a jail just fine. The problem I have is that PlexConnect running in jail A can't see PMS running in jail B. I'm not sure what questions to ask about how to fix the problem in the FreeNAS forums.

I'll try running an instance of PlexConnect in the same jail as PMS as a solution.

PlexConnect inside the same jail couldn't find the server via GDM either.

However, I discovered another implementation of GDM in Python and it does work! It's part of Plexbmc and is here: https://github.com/hippojay/script.plexbmc.helper/blob/master/resources/lib/plexgdm.py

Running that Python script both finds the server both inside the same jail as the server and from another jail (but, oddly, not outside the jail system - I think that might be some kind of multicast problem with FreeBSD jails).

Do you think you could take a look at why that GDM code works? If PlexConnect's GDM was more reliable it would solve some of the issues with PlexHome.
 

Well, Hippojay's GDM code is not really different. In fact, PlexConnect is directly based on it:

PlexAPI.py, lines 9,10:

loosely based on hippojay's plexGDM:

https://github.com/hippojay/plugin.video.plexbmc 

PlexAPI.py, lines 177ff - compare to Hippojay's code lines 195ff.

It's interesting that the original code should find servers better, though...

Edit: Hm, he now a multicast instead of a broadcast. I guess I will have to dig deeper. :-)

pdonovan: I changed PlexAPI/PlexGDM from broadcast to multicast - as seen in hippojay's code. Could you give it a try? Does it now find your PMS?

Baa, the attached updated PlexAPI.py exhibits the following error when applied to PlexConnect v0.5-dev / Mac mini / OS X 10.10.2: (some log context given)

20:46:18 DNSServer: DNS request received!

20:46:18 DNSServer: Source: ('192.168.254.3', 57663)
20:46:18 DNSServer: Domain: trailers.apple.com
20:46:18 DNSServer: ***intercept request
20:46:18 DNSServer: -> DNS response: 192.168.254.10
20:46:18 WebServer: serving .xml: /api/home/users
20:46:18 PlexAPI: ***
20:46:18 PlexAPI: looking up Plex Media Server
20:46:18 WebServer: serving /js/application.js
20:46:18 WebServer: serving .xml: /api/home/users
20:46:18 WebServer: serving .xml: /PlexConnect.xml
20:46:19 PlexAPI: ***
20:46:19 DNSServer: DNS request received!
20:46:19 DNSServer: Source: ('192.168.254.3', 55798)
20:46:19 DNSServer: Domain: p11-buy.itunes-apple.com.akadns.net
20:46:19 DNSServer: ***forward request
20:46:19 DNSServer: -> DNS response from higher level
20:46:19 PlexAPI: MyPlex switch HomeUser change successfull
20:46:19 PlexAPI: ***
20:46:19 PlexAPI: looking up Plex Media Server
20:46:19 PlexAPI: ***
20:46:20 PlexAPI: GDM: No servers discovered
20:46:20 PlexAPI: Servers (local, plex.tv, MyPlex): 1
20:46:20 DNSServer: DNS request received!
20:46:20 DNSServer: Source: ('192.168.254.3', 59682)
20:46:20 DNSServer: Domain: se-cdn.itunes-apple.com.akadns.net
20:46:20 DNSServer: ***forward request
20:46:20 DNSServer: -> DNS response from higher level
20:46:20 WebServer: Internal Server Error:
Traceback (most recent call last):
  File "/Applications/PlexConnect-master/WebServer.py", line 229, in do_GET
    XML = XMLConverter.XML_PMS2aTV(PMSaddress, self.path + query, options)
  File "/Applications/PlexConnect-master/XMLConverter.py", line 373, in XML_PMS2aTV
    PMS = PlexAPI.getXMLFromPMS(PMS_baseURL, path, options, auth_token, enableGzip)
  File "/Applications/PlexConnect-master/PlexAPI.py", line 377, in getXMLFromPMS
    response = urllib2.urlopen(request, timeout=20)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 423, in open
    protocol = req.get_type()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 285, in get_type
    raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: /api/home/users

I don't see how this could be related to the changes made. I will double check the home-feature, though.

Are you able to post a high level log?

Not sure if this would help but I had a user downgrade to iOS 5.3 in this topic and run PlexConnect as a host directly on his aTV and he had success. If all else fails debugging you could try this as a alternative if desired but for the community this would help if you could find the culprit to help other users in the future working with @baa to debug the issue:

     install problem - Failed to create socket on UDP port 53    

This appears to be related to the ssl poodle vulnerability updates in python on freenas.

See [this topic](https://forums.plex.tv/topic/134854-freenas-myplex-does-not-log-in/), it could fix your problem (if not previously done). 

Baa, yes, that PlexAPI.py file works fine. It finds my PMS using GDM, PlexHome is working too.

I don't see how this could be related to the changes made. I will double check the home-feature, though.

Are you able to post a high level log?

Baa, apologies, that error popped up for the first time after applying your updated PlexAPI.py.  After looking at the diff of the update, it was not clear to me how it could have been caused by it either.  Unfortunately, it did not solve my GDM-AWOL server.

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