If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

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 PlexConnect.py, 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: 192.168.3.21 09:34:05 DNSServer: started: 09:34:05 09:34:05 DNSServer: *** 09:34:05 DNSServer: DNSServer: Serving DNS on 192.168.3.21 port 53. 09:34:05 DNSServer: intercept: ['trailers.apple.com'] => 192.168.3.21 09:34:05 DNSServer: restrain: ['mesu.apple.com', 'appldnld.apple.com', 'appldnld.apple.com.edgesuite.net'] => 127.0.0.1 09:34:05 DNSServer: forward other to higher level DNS: 192.168.0.1 09:34:05 DNSServer: *** 09:34:05 WebServer: started: 09:34:05 09:34:05 WebServer: Failed to connect to HTTP on 192.168.3.21 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 192.168.3.21:80 0.0.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 192.168.3.21:80 0.0.0.0:* LISTEN tcp 0 0 192.168.3.21:80 192.168.3.102:56309 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56340 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56338 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56339 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56329 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56336 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56312 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56341 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56335 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56330 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56328 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56314 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56319 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56318 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56348 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56323 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56311 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56332 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56316 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56315 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56333 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56317 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56326 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56320 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56331 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56334 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56313 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56347 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56325 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56322 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56327 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56321 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56324 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56345 TIME_WAIT tcp 0 0 192.168.3.21:80 192.168.3.102:56310 TIME_WAIT

Any help would be greatly appreciated!

aTV3 - firmware 7.2.1(54 pcs, High School Network)
Ubuntu 16.04 Virtual Machine (VMWare) + PlexConnect 0.5-dev-110516 + PMS 1.3.3.3165

PS3, Android
Xubuntu 17.04 + PMS 1.3.3.3165

Best Answer

  • moody_bluemoody_blue Posts: 2,899Members, Plex Pass, Plex Ninja Plex Ninja
    edited January 18 Accepted Answer

    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 -> https://forums.plex.tv/discussion/72356/plexconnect-on-synology/p1. 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.

    QNAP TS-253A 4G QTS 4.3.4.0411 (beta3) + PMS 1.10.1.4561 (beta) + QPython2 2.7.12.0 + PlexConnect 0.5-dev-161017

    TV Sony KDL-32V2500 (720p) + aTV3 Rev. A firmware 7.2.2 + Denon AVR-1604 A/V Receiver 5.1 + Harmony Touch

    Portables 1x iPad4, 2x Android phone, 1x Android tablet, 2x PMP on Win10

    No support via PM unless requested by me

Answers

  • moody_bluemoody_blue Posts: 2,899Members, Plex Pass, Plex Ninja Plex Ninja
    edited January 18

    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.

    QNAP TS-253A 4G QTS 4.3.4.0411 (beta3) + PMS 1.10.1.4561 (beta) + QPython2 2.7.12.0 + PlexConnect 0.5-dev-161017

    TV Sony KDL-32V2500 (720p) + aTV3 Rev. A firmware 7.2.2 + Denon AVR-1604 A/V Receiver 5.1 + Harmony Touch

    Portables 1x iPad4, 2x Android phone, 1x Android tablet, 2x PMP on Win10

    No support via PM unless requested by me

  • lemmekenslemmekens Posts: 23Members ✭✭

    Hi

    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.

    aTV3 - firmware 7.2.1(54 pcs, High School Network)
    Ubuntu 16.04 Virtual Machine (VMWare) + PlexConnect 0.5-dev-110516 + PMS 1.3.3.3165

    PS3, Android
    Xubuntu 17.04 + PMS 1.3.3.3165

  • moody_bluemoody_blue Posts: 2,899Members, Plex Pass, Plex Ninja Plex Ninja
    edited January 18 Accepted Answer

    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 -> https://forums.plex.tv/discussion/72356/plexconnect-on-synology/p1. 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.

    QNAP TS-253A 4G QTS 4.3.4.0411 (beta3) + PMS 1.10.1.4561 (beta) + QPython2 2.7.12.0 + PlexConnect 0.5-dev-161017

    TV Sony KDL-32V2500 (720p) + aTV3 Rev. A firmware 7.2.2 + Denon AVR-1604 A/V Receiver 5.1 + Harmony Touch

    Portables 1x iPad4, 2x Android phone, 1x Android tablet, 2x PMP on Win10

    No support via PM unless requested by me

  • lemmekenslemmekens Posts: 23Members ✭✭

    Hi

    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 PlexConnect.py 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.
    '[PlexConnect]
    enable_plexgdm = False
    ip_pms = 192.168.3.21
    port_pms = 32400
    enable_dnsserver = True
    port_dnsserver = 53
    ip_dnsmaster = 192.168.0.1
    prevent_atv_update = True
    enable_plexconnect_autodetect = True
    ip_plexconnect = 192.168.3.21
    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'

    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!

    aTV3 - firmware 7.2.1(54 pcs, High School Network)
    Ubuntu 16.04 Virtual Machine (VMWare) + PlexConnect 0.5-dev-110516 + PMS 1.3.3.3165

    PS3, Android
    Xubuntu 17.04 + PMS 1.3.3.3165

  • moody_bluemoody_blue Posts: 2,899Members, Plex Pass, Plex Ninja Plex Ninja
    edited January 19

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

    QNAP TS-253A 4G QTS 4.3.4.0411 (beta3) + PMS 1.10.1.4561 (beta) + QPython2 2.7.12.0 + PlexConnect 0.5-dev-161017

    TV Sony KDL-32V2500 (720p) + aTV3 Rev. A firmware 7.2.2 + Denon AVR-1604 A/V Receiver 5.1 + Harmony Touch

    Portables 1x iPad4, 2x Android phone, 1x Android tablet, 2x PMP on Win10

    No support via PM unless requested by me

  • lemmekenslemmekens Posts: 23Members ✭✭

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

    aTV3 - firmware 7.2.1(54 pcs, High School Network)
    Ubuntu 16.04 Virtual Machine (VMWare) + PlexConnect 0.5-dev-110516 + PMS 1.3.3.3165

    PS3, Android
    Xubuntu 17.04 + PMS 1.3.3.3165

  • moody_bluemoody_blue Posts: 2,899Members, Plex Pass, Plex Ninja Plex Ninja
    edited January 19

    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 ?

    QNAP TS-253A 4G QTS 4.3.4.0411 (beta3) + PMS 1.10.1.4561 (beta) + QPython2 2.7.12.0 + PlexConnect 0.5-dev-161017

    TV Sony KDL-32V2500 (720p) + aTV3 Rev. A firmware 7.2.2 + Denon AVR-1604 A/V Receiver 5.1 + Harmony Touch

    Portables 1x iPad4, 2x Android phone, 1x Android tablet, 2x PMP on Win10

    No support via PM unless requested by me

  • lemmekenslemmekens Posts: 23Members ✭✭

    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 = 192.168.0.1

    192.168.0.1 is where the DC is.

    Then I created two forward Lookup Zones. One for trailers.apple.com, one for atv.plexconnect. In each zone I created a host (type A), left the name blank and put 192.168.3.22 (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?

    aTV3 - firmware 7.2.1(54 pcs, High School Network)
    Ubuntu 16.04 Virtual Machine (VMWare) + PlexConnect 0.5-dev-110516 + PMS 1.3.3.3165

    PS3, Android
    Xubuntu 17.04 + PMS 1.3.3.3165

  • lemmekenslemmekens Posts: 23Members ✭✭

    Oh wait, I think I found it!

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

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

    aTV3 - firmware 7.2.1(54 pcs, High School Network)
    Ubuntu 16.04 Virtual Machine (VMWare) + PlexConnect 0.5-dev-110516 + PMS 1.3.3.3165

    PS3, Android
    Xubuntu 17.04 + PMS 1.3.3.3165

  • moody_bluemoody_blue Posts: 2,899Members, Plex Pass, Plex Ninja Plex Ninja

    @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...

    QNAP TS-253A 4G QTS 4.3.4.0411 (beta3) + PMS 1.10.1.4561 (beta) + QPython2 2.7.12.0 + PlexConnect 0.5-dev-161017

    TV Sony KDL-32V2500 (720p) + aTV3 Rev. A firmware 7.2.2 + Denon AVR-1604 A/V Receiver 5.1 + Harmony Touch

    Portables 1x iPad4, 2x Android phone, 1x Android tablet, 2x PMP on Win10

    No support via PM unless requested by me

  • lemmekenslemmekens Posts: 23Members ✭✭

    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!

    aTV3 - firmware 7.2.1(54 pcs, High School Network)
    Ubuntu 16.04 Virtual Machine (VMWare) + PlexConnect 0.5-dev-110516 + PMS 1.3.3.3165

    PS3, Android
    Xubuntu 17.04 + PMS 1.3.3.3165

  • moody_bluemoody_blue Posts: 2,899Members, Plex Pass, Plex Ninja Plex Ninja

    Great, thanks for letting us know.

    QNAP TS-253A 4G QTS 4.3.4.0411 (beta3) + PMS 1.10.1.4561 (beta) + QPython2 2.7.12.0 + PlexConnect 0.5-dev-161017

    TV Sony KDL-32V2500 (720p) + aTV3 Rev. A firmware 7.2.2 + Denon AVR-1604 A/V Receiver 5.1 + Harmony Touch

    Portables 1x iPad4, 2x Android phone, 1x Android tablet, 2x PMP on Win10

    No support via PM unless requested by me

Sign In or Register to comment.