Errno 98 - ATV not finding Plex Server



Hi all

I know there are several threats regarding this or a similar issue, but I can 't figure it out... I'm responsible for the IT-department at a high school. We use ATV to stream media in the classrooms (54 of them).
This is our setup
*we run a Ubuntu server exclusively for this purpose. So there's nothing else going on on this machine, just Plex Media Server and Plexconnect.
*No Apache Web server.
*54 ATV's, all of them in the same VLAN as the server.
*All of the ATV's have the profile that leads to the certificate on the server, all of them logged in to ou Plex account.
*Plex Media Server is updated, ATV has iOs 7.2.1
*Nothing blocked in the firewall

We recently switched to a Plex Media Server to stream the media (we used iTunes libraries before). Everything worked fine in out our tests, but now we have a few issues:

  1. In a number of classrooms, the ATV can't find the Plex Server (you can see the Plex app, but it can't find the server). After rebooting the ATV twice, the server is usually found. This is ok for now, but hardly seems like a long-term solution.

  2. When I run, it gives me ErrNo 98 and tells me the address is already in use, so the webserver is shut down.
    09:34:05 PlexConnect: ***
    09:34:05 PlexConnect: PlexConnect
    09:34:05 PlexConnect: Press CTRL-C to shut down.
    09:34:05 PlexConnect: ***
    09:34:05 PlexConnect: started: 09:34:05
    09:34:05 PlexConnect: Version: 0.5-dev-110616
    09:34:05 PlexConnect: Python: 2.7.12 (default, Nov 19 2016, 06:48:10)
    [GCC 5.4.0 20160609]
    09:34:05 PlexConnect: Host OS: linux2
    09:34:05 PlexConnect: PILBackgrounds: Is PIL installed? True
    09:34:05 PlexConnect: IP_self:
    09:34:05 DNSServer: started: 09:34:05
    09:34:05 DNSServer: ***
    09:34:05 DNSServer: DNSServer: Serving DNS on port 53.
    09:34:05 DNSServer: intercept: [''] =>
    09:34:05 DNSServer: restrain: ['', '', ''] =>
    09:34:05 DNSServer: forward other to higher level DNS:
    09:34:05 DNSServer: ***
    09:34:05 WebServer: started: 09:34:05
    09:34:05 WebServer: Failed to connect to HTTP on port 80: [Errno 98] Address already in use
    09:34:06 PlexConnect: WebServer not alive. Shutting down.
    09:34:06 PlexConnect: Shutting down.
    09:34:10 DNSServer: Shutting down.
    09:34:10 PlexConnect: shutdown
    09:34:10 PlexConnect: shutdown

  3. If I then run sudo netstat -tulpn l grep ":80", it gives me:
    tcp 0 0* LISTEN 21486/python

This seems perfectly normal, PlexConnect is listening on port 80.

  1. Something weird with Youtube: When an ATV is using the Youtube App, it sometimes shows up as TIME_WAIT when I run sudo netstat -an l grep ":80" (see below). Other ATV's couldn't find the server when this happened. When we closed the Youtube App on the ATV where it was open, and tested another ATV right after, it would work... We can't however seem to find a pattern to this, so I don't know if we're assessing the situation correctly.

plex@plex:~$ netstat -an | grep ":80"
tcp 0 0* LISTEN
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT
tcp 0 0 TIME_WAIT

Any help would be greatly appreciated!


Hi, as the PlexConnect developers seem to no longer follow this forum, here is a quick, but probably incorrect opinion.

PlexConnect was not designed, probably, to handle 54 ATV's simultaneously. Or the ATV's were not designed to wait for a "very busy" PlexConnect server. I would suggest that you find a way to run multiple PlexConnect instances (you can share the same certificate among them) and group 5-6 ATV's per PlexConnect instance.

Another option that may help, certainly with your YouTube problem but probably also with your other problems, is to have a router (or RasPI) with dnsmasq active, so that non-Plex traffic is handled by the router and not by PlexConnect. Or install a DNS server in Ubuntu and disable DNS service in PlexConnect. This will free the PlexConnect instance for Plex-only requests.



Thanks for the response!

I'll see what it does with your suggestions tomorrow. (I'm from Belgium, so the workday is through here ;) )

I'm still wondering why it keeps telling me the webserver has to shutdown and "the address is already in use"... I see no traffic on port 80 that would keep PlexConnect from keeping it open.


Probably you should try the DNS alternative first. You can find what some (rare) Synology users are doing in the end of first post here -> Or the dnsmasq alternative if your router supports it (this would require pointing ATV's to the router and not to PlexConnect, or leave DNS as automatic if possible).

Freeing PlexConnect from DNS activity will help solve most of your problems. Running a DNS server under Python is not efficient, but it's what PlexConnect does...

Regarding some ATV's not finding the server randomly, probably it's better to bypass GDM and use IP fixed routing instead. Probably this will also force ATV's and PMS to not be logged to MyPlex, would that be a problem ? If not a problem you would need to authorize (in PMS settings advanced) that ATV's in the same LAN can access PMS (this is required by PMS 1.1 or later).

PlexConnect uses async comms with ATV's and PMS. I'm not sure what happens if an ATV makes a request while PlexConnect is handling another request (or waiting for PMS). In an environment as your's, where classes can start using ATV's in the same second, this can happen. PlexConnect is used when DNS service is requested or when you navigate through PMS metadata screens (which require html translation between ATV and PMS). Otherwise, during streaming, the ATV contacts the provider directly (PMS, YouTube, etc) without requiring PlexConnect to be active.

Lastly, it would not be the first time that someone attemps to run two PlexConnect instances in the same computer. Apparently this is what you have tried to do, although inadvertently.



Thank you so much for thinking with me!

You're right, I was inadvertently trying to run two instances of PlexConnect. That's ofcourse the reason for the initial Errno 98! I just wanted to see the live log that shows. But PlexConnect was already running, because I run it as daemon! Stupid me...

We do run the Ubuntu machine in VMware. Appearently that can cause trouble when GDM is enabled. So I did as you said, I disabled GDM and used a fixed IP for my PMS and PlexConnect.
enable_plexgdm = False
ip_pms =
port_pms = 32400
enable_dnsserver = True
port_dnsserver = 53
ip_dnsmaster =
prevent_atv_update = True
enable_plexconnect_autodetect = True
ip_plexconnect =
hosttointercept =
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'

This seems to completely solve the problem of the ATV's not finding the server. I'll know for shure in a week or so. I'll monitor this the next week, to see if there are still teachers complaining ;)

As for the YouTube/DNS problem, I'll be able to give this a shot next week. But if all troubles are fixed with the fixed IP, the issue isn't as pressing as it was.

I'll post next week if the issue is resolved!

Thanks again!


loglevel=High ? Any reason for it ? Normally it should be loglevel=Normal unless you are attempting to diagnose a specific problem


I've already reset it to normal, wanted to see how high 'High' meant. Turns out, very high ;)


Great. I hope it's a successfull experience in such an environment. Incidently I was planning to do something similar in an institution where I'm a volunteer in Portugal. I was thinking about RPi's but with an ATV3 low price who knows ?


Alright, everything seems to be working much better now.

From time to time, an ATV can't find the server, but after quitting the trailers app and going back in, there's no problem.

Now I'm trying to free PlexConnect from DNS... As I understand it, I could install a DNS server on my Ubuntu machine, which then would handle all incoming DNS requests, thus making shure PlexConnect isn't bothered by this.

But then I got to thinking, we have a DNS server running on de DC of the school (Windows Server). Couldn't I just use that server to handle the DNS requests? How would I go about this?

I tried to follow the Synology guide and apply it to my setting, but so far with no luck. I edited the settings.cfg file in these lines:
enable_dnsserver = False
ip_dnsmaster = is where the DC is.

Then I created two forward Lookup Zones. One for, one for atv.plexconnect. In each zone I created a host (type A), left the name blank and put (my Plex server) as the IP-address. Result is that the Apple TV doesn't find PlexConnect at all. No Trailers app, no Youtube, nothing.

Is this at all possible, or is it better to use a DNS server on the ubuntu machine?


Oh wait, I think I found it!

When installing and configuring PlexConnect, I set the DNS IP address on the ATV to (the Plex server). That should ofcourse be changed to again.

The question remains for me, is this an eficient way to free PlexConnect from DNS?


@lemmekens said:
The question remains for me, is this an eficient way to free PlexConnect from DNS?
To be honest I don't know. But you are in position to test...


I rerouted the DNS to our network DNS server and that seems to do the trick.

Some of the ATVs needed about a minute or two to find the Plex server the first time, but once they found it, there aren't any problems, even after rebooting.

So thank you so much for helping, all of our issues with PlexConnect have been resolved!


Great, thanks for letting us know.